Skip to content

Upload code coverage #75

Upload code coverage

Upload code coverage #75

name: Upload code coverage
on:
workflow_run:
workflows: [Build]
types: [completed]
branches: [master]
jobs:
upload-code-coverage:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Run tests and write coverprofile
shell: bash
run: |
go test -v -race -coverprofile=profile.out -covermode=atomic ./...
- name: Upload testcoverage to codecov.io
uses: codecov/codecov-action@v3
with:
file: ./profile.out
fail_ci_if_error: true