Skip to content

[skip changelog] Move upload of coverage data to dedicated job in test workflow #1915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Test Go
env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.17"
COVERAGE_ARTIFACT: coverage-data

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
Expand Down Expand Up @@ -99,18 +100,30 @@ jobs:
if: runner.os == 'Linux'
run: task test-legacy

- name: Send unit tests coverage to Codecov
- name: Upload coverage data to workflow artifact
if: runner.os == 'Linux'
uses: codecov/codecov-action@v3
uses: actions/upload-artifact@v3
with:
file: ./coverage_unit.txt
flags: unit
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}
if-no-files-found: error
name: ${{ env.COVERAGE_ARTIFACT }}
path: |
./coverage_unit.txt
./coverage_legacy.txt

- name: Send legacy tests coverage to Codecov
if: runner.os == 'Linux'
coverage-upload:
runs-on: ubuntu-latest
needs: test
steps:
- name: Download coverage data artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.COVERAGE_ARTIFACT }}

- name: Send unit tests coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage_legacy.txt
files: >
./coverage_unit.txt,
./coverage_legacy.txt
flags: unit
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}