From 55b49e834754598277a46126c56a4841894782e5 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Arango Gutierrez Date: Tue, 4 Mar 2025 12:13:46 +0100 Subject: [PATCH] [no-relnote] Enable CodeCov Signed-off-by: Carlos Eduardo Arango Gutierrez --- .github/workflows/golang.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/golang.yaml b/.github/workflows/golang.yaml index 0a7e07d9..6e2fa4bb 100644 --- a/.github/workflows/golang.yaml +++ b/.github/workflows/golang.yaml @@ -30,54 +30,74 @@ jobs: steps: - uses: actions/checkout@v4 name: Checkout code + - name: Get Golang version id: vars run: | GOLANG_VERSION=$(./hack/golang-version.sh) echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV + - name: Install Go uses: actions/setup-go@v5 with: go-version: ${{ env.GOLANG_VERSION }} + - name: Lint uses: golangci/golangci-lint-action@v6 with: version: latest args: -v --timeout 5m skip-cache: true + - name: Check golang modules run: | make check-vendor make -C deployments/devel check-modules + test: name: Unit test runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 + - name: Get Golang version id: vars run: | GOLANG_VERSION=$(./hack/golang-version.sh) echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV + - name: Install Go uses: actions/setup-go@v5 with: go-version: ${{ env.GOLANG_VERSION }} + - run: make test + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.out + fail_ci_if_error: true + verbose: true + build: name: Build runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 + - name: Get Golang version id: vars run: | GOLANG_VERSION=$(./hack/golang-version.sh) echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_ENV + - name: Install Go uses: actions/setup-go@v5 with: go-version: ${{ env.GOLANG_VERSION }} + - run: make build