diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9d8e391a4a..91a6e61352 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,12 +11,12 @@ permissions: jobs: - build: + test: permissions: contents: read # to fetch code (actions/checkout) checks: write # to create a new check based on the results (shogo82148/actions-goveralls) - name: Build + name: Test runs-on: ${{ matrix.os }} strategy: matrix: @@ -38,21 +38,28 @@ jobs: run: | go get -v -t -d ./... - - name: Install additional CI for nektos/act - run: | - apt update - apt install -y make gcc libc-dev git - if: github.actor == 'nektos/act' && matrix.os == 'ubuntu-latest' - - name: Test env: - GOMAXPROCS: 1 - GOMEMLIMIT: 2048MiB - run: make test + GOMAXPROCS: 4 + GOMEMLIMIT: 8192MiB + run: make go-test - name: Send coverage - uses: shogo82148/actions-goveralls@v1 + uses: coverallsapp/github-action@v2 with: - path-to-profile: profile.cov - if: github.actor != 'nektos/act' && matrix.os == 'ubuntu-latest' + file: profile.cov + format: golang + flag-name: run-${{ join(matrix.*, '-') }} + parallel: true continue-on-error: true + + finish: + needs: test + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + parallel-finished: true + carryforward: "run-ubuntu-latest,run-macos-latest" diff --git a/Makefile b/Makefile index ee8605fe13..268d2ba631 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,14 @@ crd: controller-gen-install #? test: The verify target runs tasks similar to the CI tasks, but without code coverage .PHONY: test test: + go test -race ./... + + +.PHONY: test +go-test: go test -race -coverprofile=profile.cov ./... + go tool cover -func=profile.cov > coverage.summary + @tail -n 1 coverage.summary #? build: The build targets allow to build the binary and container image .PHONY: build