test: run the integration and lifecycle suites against an OpenShift cluster #1489
Workflow file for this run
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: pull request checks | |
| on: | |
| pull_request: | |
| branches: ["*"] | |
| jobs: | |
| check-license: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 3 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check License Header | |
| uses: apache/skywalking-eyes@cd7b195c51fd3d6ad52afceb760719ddc6b3ee91 | |
| build-meta: | |
| name: Compute build metadata | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| build_version: ${{ steps.meta.outputs.build_version }} | |
| build_commit: ${{ steps.meta.outputs.build_commit }} | |
| build_date: ${{ steps.meta.outputs.build_date }} | |
| steps: | |
| - name: Compute build metadata | |
| id: meta | |
| env: | |
| HEAD_REF: ${{ github.head_ref }} | |
| PR_NUMBER: ${{ github.event.number }} | |
| run: | | |
| echo "build_version=pr-${PR_NUMBER}-${HEAD_REF}" >> "$GITHUB_OUTPUT" | |
| echo "build_commit=${GITHUB_SHA}" >> "$GITHUB_OUTPUT" | |
| echo "build_date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT" | |
| build: | |
| name: Build (Go 1.25 - amd64) | |
| runs-on: ubuntu-24.04 | |
| needs: build-meta | |
| env: | |
| BUILD_VERSION: ${{ needs.build-meta.outputs.build_version }} | |
| BUILD_COMMIT: ${{ needs.build-meta.outputs.build_commit }} | |
| BUILD_DATE: ${{ needs.build-meta.outputs.build_date }} | |
| steps: | |
| - name: Checkout bpfman-operator | |
| uses: actions/checkout@v6 | |
| - name: Install go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| cache: false | |
| - name: Restore Go build cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/go-build | |
| key: go-build-${{ github.sha }} | |
| restore-keys: | | |
| go-build- | |
| - name: Build Operator and Agent | |
| run: make build | |
| - name: Print version of each binary | |
| run: | | |
| for bin in bin/bpfman-operator bin/bpfman-agent bin/metrics-proxy bin/bpfman-crictl; do | |
| ./"$bin" --version | |
| done | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| steps: | |
| - name: Checkout bpfman-operator | |
| uses: actions/checkout@v6 | |
| - name: Install go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| cache: false | |
| - name: Restore Go module cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: go-mod-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| go-mod- | |
| - name: Restore Go build cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/go-build | |
| key: go-build-${{ github.sha }} | |
| restore-keys: | | |
| go-build- | |
| - name: Check format | |
| run: make fmt && git add -A && git diff --exit-code | |
| - name: Run lint | |
| run: make lint | |
| test: | |
| name: Test | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| steps: | |
| - name: Checkout bpfman-operator | |
| uses: actions/checkout@v6 | |
| - name: Install go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| cache: false | |
| - name: Restore Go module cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: go-mod-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| go-mod- | |
| - name: Restore Go build cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/go-build | |
| key: go-build-${{ github.sha }} | |
| restore-keys: | | |
| go-build- | |
| - name: Run test | |
| run: make test | |
| - name: Archive Go code coverage results | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: coverage-go | |
| path: cover.out | |
| if-no-files-found: error | |
| verify: | |
| name: Verify | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| steps: | |
| - name: Checkout bpfman-operator | |
| uses: actions/checkout@v6 | |
| - name: Install go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| cache: false | |
| - name: Restore Go module cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: go-mod-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| go-mod- | |
| - name: Restore Go build cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/go-build | |
| key: go-build-${{ github.sha }} | |
| restore-keys: | | |
| go-build- | |
| - name: Verify Autogenerated Code | |
| run: make verify | |
| - name: Check clean vendors | |
| run: | | |
| go mod tidy | |
| go mod vendor | |
| if [ -n "$(git status --porcelain vendor go.mod go.sum)" ]; then | |
| echo "vendor/, go.mod or go.sum is out of sync with 'go mod tidy && go mod vendor':" | |
| git status --porcelain vendor go.mod go.sum | |
| git diff -- vendor go.mod go.sum | |
| exit 1 | |
| fi | |
| - name: Verify generated bundle manifest | |
| run: | | |
| make bundle | |
| git diff --exit-code -I'^ createdAt: ' bundle | |
| cross-build: | |
| name: Cross-compile (Go 1.25 - arm64, ppc64le, s390x) | |
| runs-on: ubuntu-24.04 | |
| needs: [build, build-meta] | |
| env: | |
| BUILD_VERSION: ${{ needs.build-meta.outputs.build_version }} | |
| BUILD_COMMIT: ${{ needs.build-meta.outputs.build_commit }} | |
| BUILD_DATE: ${{ needs.build-meta.outputs.build_date }} | |
| steps: | |
| - name: Checkout bpfman-operator | |
| uses: actions/checkout@v6 | |
| - name: Install go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| cache: false | |
| - name: Restore Go build cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/go-build | |
| key: go-build-all-${{ github.sha }} | |
| restore-keys: | | |
| go-build-all- | |
| go-build- | |
| - name: Build arm64 | |
| run: GOARCH=arm64 make build | |
| - name: Build ppc64le | |
| run: GOARCH=ppc64le make build | |
| - name: Build s390x | |
| run: GOARCH=s390x make build | |
| coverage: | |
| needs: [test] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Download golang coverage artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: coverage-go | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| files: ./cover.out | |
| flags: unittests | |
| fail_ci_if_error: false | |
| verbose: true | |
| integration-tests: | |
| needs: build | |
| uses: ./.github/workflows/integration_test.yml | |
| secrets: inherit | |
| olm-bundle-tests: | |
| needs: build | |
| uses: ./.github/workflows/olm_bundle_test.yml | |
| secrets: inherit | |
| build-workflow-complete: | |
| needs: [check-license, build, lint, test, verify, cross-build, coverage, integration-tests, olm-bundle-tests] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Build Complete | |
| run: echo "Build Complete" |