Skip to content

feat: Track code coverage #2

feat: Track code coverage

feat: Track code coverage #2

Workflow file for this run

name: PR checks
on:
pull_request:
branches:
- master
- 'v*.*'
env:
GO111MODULE: on
SDK_VERSION: "1.17.0"
MINIKUBE_WANTUPDATENOTIFICATION: false
MINIKUBE_WANTREPORTERRORPROMPT: false
K8S_VERSION: "1.21.3"
MINIKUBE_VERSION: "1.26.0"
OLM_VERSION: "0.22.0"
TEST_ACCEPTANCE_CLI: "kubectl"
TEST_RESULTS: "out/acceptance-tests"
jobs:
lint:
name: Code Quality
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "^1.18"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: "x64"
- name: Checkout repo
uses: actions/checkout@v4
- name: Run linters
run: make lint
unit:
name: Unit Tests with Code coverage
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "^1.18"
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Unit Tests with Code Coverage
run: |
make test
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v3
with:
file: cover.out
verbose: true
fail_ci_if_error: true
source-scan:
name: Gosec code scanning
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run gosec
uses: securego/gosec@v2.18.2
with:
args: '-no-fail -fmt sarif -out gosec.sarif ./...'
- name: Upload gosec scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'gosec.sarif'