Skip to content

Bump ubi8/go-toolset from 1.20.10-3 to 1.20.10-10 #319

Bump ubi8/go-toolset from 1.20.10-3 to 1.20.10-10

Bump ubi8/go-toolset from 1.20.10-3 to 1.20.10-10 #319

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- downstream
- main
jobs:
validate-pr:
name: 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@v3
- name: Verify generated Manifests are up to date
run: make verify-manifests
unit-tests:
name: 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: Install kubebuilder
run : |
os=$(go env GOOS)
arch=$(go env GOARCH)
curl -L "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_${os}_${arch}.tar.gz" | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
- name: Run tests
run: |
make generate manifests
go test ./... -v -coverprofile cover.out -covermode=atomic
- name: Upload test coverage file
uses: actions/upload-artifact@v4
with:
name: coverage
path: cover.out
coverage:
name: 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@v3
with:
file: ./cover.out
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
sonarcloud:
name: SonarCloud
needs: [validate-pr,unit-tests]
runs-on: ubuntu-20.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: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}