Skip to content

Commit

Permalink
enhancement: added codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
leonsteinhaeuser committed Apr 20, 2022
1 parent fd97721 commit 2ab4e59
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
codecov:
branch: main
strict_yaml_branch: main

coverage:
range: 70..100
round: nearest
precision: 2

comment:
layout: ""
require_base: false
require_head: yes
branches:
- "M3GmRUVDUZcwg8nK1GmvERHAttwdAYVH" # set it to M3GmRUVDUZcwg8nK1GmvERHAttwdAYVH so that no comments are written.

ignore:
- "_example/"
14 changes: 13 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
unit:
name: unit tests
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVER_FILE: coverage.txt
steps:
- name: Setup Go ${{ env.go_version }}
uses: actions/setup-go@v3
Expand All @@ -23,4 +26,13 @@ jobs:

- name: Run tests
shell: bash
run: go test -race -cover ./...
run: go test -race -coverprofile=$COVER_FILE -covermode=atomic $(go list ./...)

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ env.CODECOV_TOKEN }}
env_vars: OS,GOLANG
fail_ci_if_error: true
files: ${{ env.COVER_FILE }}
flags: unittests

0 comments on commit 2ab4e59

Please sign in to comment.