NO MERGE - TRIGGER KONFLUX CI #944
This file contains 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: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- downstream | |
- main | |
jobs: | |
validate-pr: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
- name: Verify generated Manifests are up to date | |
run: make verify-manifests | |
unit-tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Display build environment | |
run: printenv | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Run tests | |
run: make test | |
- name: Upload test coverage file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: cover.out | |
unit-tests-qemu: | |
strategy: | |
matrix: | |
# arch: [arm64, s390x, ppc64le] # kubebuilder is not available for s390x yet | |
arch: [arm64, ppc64le] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Install QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Run tests via qemu/binfmt | |
run: | | |
go env | |
make test-qemu | |
env: | |
GOARCH: ${{ matrix.arch }} | |
coverage: | |
needs: unit-tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
# this checkout is required for the coverage report. If we don't do this, then | |
# the uploaded report is invalid and codecov doesn't know how to process it. | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download coverage result from unit-tests | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage | |
- name: Upload coverage | |
uses: codecov/codecov-action@v4.2.0 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
file: ./cover.out | |
flags: unittests | |
fail_ci_if_error: true | |
plugin: pycoverage # Only run one plugin even though we don't want any to run. |