Skip to content

Upload code coverage #25

Upload code coverage

Upload code coverage #25

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@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.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