Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading