Skip to content

url_path join updated (#510) #1849

url_path join updated (#510)

url_path join updated (#510) #1849

Workflow file for this run

# Copyright Contributors to the L3AF Project.
# SPDX-License-Identifier: Apache-2.0
#
# For documentation on the github environment, see
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
#
# For documentation on the syntax of this file, see
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: CI Ubuntu build
on:
pull_request: {}
push:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Setup Go 1.22.3
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
with:
go-version: '1.22.3'
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Set up environment
run: |
sudo apt-get update
sudo apt-get remove containerd.io
sudo apt-get install -y gcc libc-dev bash perl curl make docker docker.io
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Format
run: |
go install golang.org/x/tools/cmd/goimports@latest
res="$(goimports -l .)"
if [[ "$(printf '%s' "$res")" != '' ]]; then
echo "Unformatted source code:"
echo "$res"
exit 1
fi
- name: Vet
run: |
go vet ./...
- name: Test
run: |
go test ./...
go clean -modcache
- uses: dominikh/staticcheck-action@fe1dd0c3658873b46f8c9bb3291096a617310ca6
with:
version: "2024.1.1"
install-go: false
cache-key: "1.22.x"
- name: Build
run: |
make
- name: Copy files
if: github.ref == 'refs/heads/main'
run: |
sudo cp ./config/l3afd.cfg ./build-docker
sudo cp l3afd ./build-docker
- name: login to docker registry
if: github.ref == 'refs/heads/main'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_TOKEN}}
- name: build and push docker image to registry
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
with:
context: ./build-docker
push: true
tags: linuxfoundationl3af/l3afd:latest
- name: upload l3afd binary
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
with:
name: l3afd-latest-linux-x86_64
path: l3afd