Skip to content

Commit

Permalink
chore: upload coverage of unittests together (#2301)
Browse files Browse the repository at this point in the history
* chore: upload coverage of unittests together

Before this each run for respective OS carried out upload to codecov
server however this consumes codecov tokenless upload limit.

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* fixup: decrease artifact retention period

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* fixup: added the checkout action

I would not expect that this would be needed for codecov upload.

Signed-off-by: Matej Vašek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
  • Loading branch information
matejvasek committed May 15, 2024
1 parent 17c1502 commit 0967035
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/test-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,24 @@ jobs:
FUNC_REPO_BRANCH_REF: ${{ github.head_ref }}
- name: Template Unit Tests
run: make test-templates
- name: "Archive code coverage results"
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}
path: ./coverage.txt
retention-days: 1
upload-coverage:
needs: [test]
name: "Upload coverage"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Download Coverage
run: |
gh run download -R ${{ github.repository }} ${{ github.run_id }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
flags: unit-tests-${{ matrix.os }}
files: ./coverage-ubuntu-latest/coverage.txt,./coverage-windows-latest/coverage.txt,./coverage-macos-latest/coverage.txt
flags: unit-tests

0 comments on commit 0967035

Please sign in to comment.