Skip to content

Commit

Permalink
Add coverage report and badge generation to go-test.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Th3Shadowbroker committed Mar 15, 2024
1 parent 6250c3c commit 175a4fd
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,23 @@ jobs:
MONGO_HOST: localhost:27017
MONGO_IMAGE: mongo
MONGO_TAG: 7.0.5-rc0
run: go test -v ./...
run: go test -v ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...

- name: Prepare Archive
run: mkdir -p ./out/reports ./out/badges

- name: Generate coverage report
run: go tool cover -html=cover.out -o=./out/reports/coverage-report.html

- name: Check test coverage
uses: vladopajic/go-test-coverage@v2
with:
profile: cover.out
local-prefix: github.com/telekom/pubsub-horizon-vortex
badge-file-name: ./out/badges/coverage.svg

- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: ./out/**

0 comments on commit 175a4fd

Please sign in to comment.