Skip to content

Commit

Permalink
chore: decouple unit tests and upload to codecov (#103)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly authored Sep 11, 2024
1 parent 355b762 commit 1cf79d5
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- '*'

jobs:
codecov:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -19,9 +19,26 @@ jobs:
uses: actions/setup-go@v5
- name: Run coverage
run: go test ./... -cover -coverpkg ./... -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
- name: Upload coverage
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
files: ./coverage.out
fail_ci_if_error: true
verbose: true
name: coverage.out
path: coverage.out
retention-days: 1
if-no-files-found: error

upload-to-codecov:
needs:
- unit-tests
runs-on: ubuntu-latest
steps:
- name: Download coverage
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: coverage.out
- name: Upload Report to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: ./coverage.out
fail_ci_if_error: true
verbose: true

0 comments on commit 1cf79d5

Please sign in to comment.