Cherry-pick PR #436 to release-v1.3 #1806
Workflow file for this run
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: Build, Lint, and Test | |
env: | |
EXPORT_RESULT: true | |
on: | |
push: | |
branches: | |
- main | |
- 'release-*' | |
pull_request: | |
jobs: | |
build-container: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "^1.22" | |
- name: Verify that generated manifests committed to the repository are up to date | |
run: make verify-manifests | |
- name: Build | |
run: make generate fmt vet build | |
- name: Lint | |
run: make lint | |
- name: Run unit tests | |
run: make unit-test | |
- name: Run coverage report | |
run: make coverage | |
- name: Codecov | |
uses: codecov/codecov-action@v3.1.4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
file: ./coverage.xml # Replace with the path to your coverage report | |
fail_ci_if_error: true | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@0.16.1 | |
with: | |
scan-type: "fs" | |
ignore-unfixed: true | |
format: "table" | |
exit-code: "1" | |
vuln-type: "os,library" | |
severity: "CRITICAL,HIGH" |