Skip to content

Commit

Permalink
enable codecoverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorel-35 authored Dec 23, 2021
1 parent 5c52453 commit 2252055
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- id: cache-paths
- id: go-env
run: |
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
- name: Cache go modules
uses: actions/cache@v2
with:
path: |
${{ steps.cache-paths.outputs.cache }}
${{ steps.cache-paths.outputs.mod-cache }}
${{ steps.go-env.outputs.cache }}
${{ steps.go-env.outputs.mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Test
run: |
go test ./...
go test -coverprofile='coverage.out' -covermode=atomic ./...
- name: Upload Code Coverage
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: coverage.out
flags: ${{ matrix.os }},go-${{ matrix.go-version }}
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 2252055

Please sign in to comment.