Skip to content

Commit

Permalink
ci: add codecov report upload (#509)
Browse files Browse the repository at this point in the history
* ci: add codecov report upload
  • Loading branch information
gfyrag committed Oct 23, 2024
1 parent d0b620e commit 5c5d88a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ jobs:
token: ${{ secrets.NUMARY_GITHUB_TOKEN }}
- run: >
earthly
--no-output
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+tests
+tests --coverage=true
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

GoReleaser:
runs-on: "formance-runner"
Expand Down
8 changes: 4 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ tests:
SET goFlags="$goFlags,github.com/formancehq/ledger/pkg/accounts/..."
SET goFlags="$goFlags,github.com/formancehq/ledger/pkg/assets/..."
SET goFlags="$goFlags,github.com/formancehq/ledger/cmd/..."
SET goFlags="$goFlags -coverprofile cover.out"
SET goFlags="$goFlags -coverprofile coverage.txt"
END

IF [ "$includeIntegrationTests" = "true" ]
Expand All @@ -88,9 +88,9 @@ tests:
IF [ "$coverage" = "true" ]
# as special case, exclude files suffixed by debug.go
# toremovelater: exclude machine code as it will be updated soon
RUN cat cover.out | grep -v debug.go | grep -v "/machine/" > cover2.out
RUN mv cover2.out cover.out
SAVE ARTIFACT cover.out AS LOCAL cover.out
RUN cat coverage.txt | grep -v debug.go | grep -v "/machine/" > coverage2.txt
RUN mv coverage2.txt coverage.txt
SAVE ARTIFACT coverage.txt AS LOCAL coverage.txt
END

deploy:
Expand Down

0 comments on commit 5c5d88a

Please sign in to comment.