Skip to content
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

Ability to resume workflow when codecov push fails #909

Merged
merged 12 commits into from
Feb 20, 2024
5 changes: 4 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
branch = True
concurrency = multiprocessing
data_file = .coverage
source_pkgs =
source_pkgs =
scilpy
scripts
relative_files = True
Expand All @@ -17,6 +17,9 @@ omit =
[report]
skip_empty = True
skip_covered = True
exclude_also =
if __name__ == "__main__":
(?<!def )main()

[html]
title = Scilpy Coverage Report
Expand Down
44 changes: 36 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ jobs:
test:
runs-on: scilus-runners
if: github.repository == 'scilus/scilpy'

steps:
- name: Checkout repository for merge
- name: Checkout repository at merge
uses: actions/checkout@v4

- name: Fetch python version from repository
Expand Down Expand Up @@ -55,19 +56,46 @@ jobs:
export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH
pytest --cov-report term-missing:skip-covered

- name: Save test results and coverage
uses: actions/upload-artifact@v4
id: test-coverage-results
with:
name: test-coverage-${{ github.run_id }}
retention-days: 1
path: |
.coverage
.test_reports/

coverage:
runs-on: scilus-runners
if: github.repository == 'scilus/scilpy'
needs: test

steps:
- name: Checkout repository at merge
uses: actions/checkout@v4

- name: Set up Python for codecov upload
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'pip'

- name: Install pycoverage
run: pip install coverage

- name: Download test results and coverage
uses: actions/download-artifact@v4
with:
name: test-coverage-${{ github.run_id }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: scilpy-unittests-${{ github.run_id }}
name: scilpy-unittests-${{ github.run_id }}-${{ github.run_attempt }}
verbose: true
fail_ci_if_error: true
plugin: pycoverage

- name: Upload test reports and coverage to artifacts
uses: actions/[email protected]
with:
name: test-reports
path: |
.test_reports/*