Skip to content

Commit

Permalink
Add a token to upload code coverage (#80)
Browse files Browse the repository at this point in the history
* Add a token to upload code coverage

Signed-off-by: Andrea Frittoli <[email protected]>

* Move test+coverage to dedicated job that runs on pull request and push

Signed-off-by: Andrea Frittoli <[email protected]>

---------

Signed-off-by: Andrea Frittoli <[email protected]>
  • Loading branch information
afrittoli authored May 17, 2024
1 parent 6bcc745 commit 7eb4b5a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,3 @@ jobs:
version: v1.52
- name: Check generated code
run: make generate

test:
runs-on: ubuntu-latest
env:
GOPATH: /home/runner/go
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.19
- name: Test
run: make test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
35 changes: 35 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test and Coverage

on:
pull_request:
types:
- opened
- synchronize
paths-ignore:
- README.md
- .gitignore
push:
branches:
- main
merge_group:

jobs:
coverage:
runs-on: ubuntu-latest
env:
GOPATH: /home/runner/go
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.19
- name: Generate coverage report
run: make test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 7eb4b5a

Please sign in to comment.