Skip to content

Commit

Permalink
Add code coverage to GitHub Action
Browse files Browse the repository at this point in the history
Add upload of Code Coverage data.
  • Loading branch information
HeavyWombat committed Aug 26, 2024
1 parent 30856fb commit f275036
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,35 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Compile Go source
run: go test -c -o /dev/null ./...

- name: Build Ginkgo CLI
run: go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo

- name: Build test image
run: docker build --tag test:me -f test/sample/Dockerfile test/sample/data

- name: Test
run: |
docker build --tag test:me -f test/sample/Dockerfile test/sample/data
go run -mod=mod github.com/onsi/ginkgo/v2/ginkgo run -v ./...
ginkgo run \
--coverprofile=unit.coverprofile \
--randomize-all \
--randomize-suites \
--fail-on-pending \
--keep-going \
--compilers=2 \
--race \
--trace \
-v \
./...
- name: Upload Code Coverage Profile
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: unit.coverprofile
flags: unittests
fail_ci_if_error: true
verbose: false

0 comments on commit f275036

Please sign in to comment.