Init Commit with all features #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-test: | |
| runs-on: fedora-latest | |
| container: | |
| image: registry.fedoraproject.org/fedora:latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Install git and BPF/CGO dependencies | |
| run: | | |
| dnf install -y git ca-certificates libbpf-devel clang llvm gcc make | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: gofmt | |
| run: | | |
| test -z "$(gofmt -l .)" || (echo "Run: gofmt -w on:" && gofmt -l . && exit 1) | |
| - name: go vet | |
| run: go vet ./... | |
| - name: go test | |
| run: go test ./... -short -count=1 | |
| - name: go generate (BPF / bpf2go) | |
| run: go generate ./... | |
| - name: go build (CGO, after generate) | |
| run: | | |
| COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7) | |
| TS=$(date -u +%Y-%m-%dT%H:%M:%SZ) | |
| CGO_ENABLED=1 go build -ldflags "-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}" -o spectral-mesh . | |
| - name: go build spectral-edge (no CGO) | |
| run: | | |
| COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7) | |
| TS=$(date -u +%Y-%m-%dT%H:%M:%SZ) | |
| CGO_ENABLED=0 go build -ldflags "-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}" -o spectral-edge ./cmd/spectral-edge |