Skip to content

Commit

Permalink
Merge pull request #909 from AlexVCaron/fix/separate_codecov_job
Browse files Browse the repository at this point in the history
Ability to resume workflow when codecov push fails
  • Loading branch information
arnaudbore authored Feb 20, 2024
2 parents 9381895 + 747da90 commit 9412961
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
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/*

0 comments on commit 9412961

Please sign in to comment.