Skip to content

Commit

Permalink
daving .coverage instead of xml
Browse files Browse the repository at this point in the history
  • Loading branch information
STS committed Jun 13, 2023
1 parent e86d363 commit c3b59c9
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# This is a workflow for Unit, Integration, and Regression Tests

name: Tests
name: Unit, Integration and Regression Tests

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
Expand All @@ -35,13 +31,11 @@ jobs:
run: |
source .venv/bin/activate
coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
coverage xml -o coverage.unit.xml
coverage html
- name: "Upload coverage report for unit and integration tests"
- name: "Upload coverage data for unit and integration tests"
uses: actions/upload-artifact@v2
with:
name: coverage-unit
path: ./coverage.unit.xml
path: ./.coverage

regression_tests:
strategy:
Expand All @@ -64,13 +58,11 @@ jobs:
run: |
source .venv/bin/activate
coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
coverage xml -o coverage.regression.xml
coverage html
- name: "Upload coverage report for regression tests"
- name: "Upload coverage data for regression tests"
uses: actions/upload-artifact@v2
with:
name: coverage-regression
path: ./coverage.regression.xml
path: ./.coverage

combine_coverage:
needs: [unit_and_integration_tests, regression_tests]
Expand All @@ -80,23 +72,27 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Download coverage reports
- name: Install coverage
run: pip install coverage
- name: Download coverage data
uses: actions/download-artifact@v2
with:
name: coverage-unit
- name: Download coverage reports
path: unit
- name: Download coverage data
uses: actions/download-artifact@v2
with:
name: coverage-regression
- name: Install coverage
run: pip install coverage
- name: Combine reports
path: regression
- name: Combine coverage data
run: |
coverage combine coverage.unit.xml coverage.regression.xml
coverage xml -o coverage.combined.xml
mv unit/.coverage .coverage.unit
mv regression/.coverage .coverage.regression
coverage combine
coverage xml
- name: "Upload combined coverage to Codecov"
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.combined.xml
files: ./coverage.xml
name: codecov-umbrella

0 comments on commit c3b59c9

Please sign in to comment.