11# This is a workflow for Unit, Integration, and Regression Tests
22
3- name : Tests
3+ name : Unit, Integration and Regression Tests
44
5- # Controls when the workflow will run
65on :
7- # Triggers the workflow on push or pull request events but only for the main branch
86 push :
97 branches : [ main ]
108 pull_request :
119 branches : [ main ]
12-
13- # Allows you to run this workflow manually from the Actions tab
1410 workflow_dispatch :
1511
1612jobs :
@@ -35,13 +31,11 @@ jobs:
3531 run : |
3632 source .venv/bin/activate
3733 coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
38- coverage xml -o coverage.unit.xml
39- coverage html
40- - name : " Upload coverage report for unit and integration tests"
34+ - name : " Upload coverage data for unit and integration tests"
4135 uses : actions/upload-artifact@v2
4236 with :
4337 name : coverage-unit
44- path : ./coverage.unit.xml
38+ path : ./.coverage
4539
4640 regression_tests :
4741 strategy :
@@ -64,13 +58,11 @@ jobs:
6458 run : |
6559 source .venv/bin/activate
6660 coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
67- coverage xml -o coverage.regression.xml
68- coverage html
69- - name : " Upload coverage report for regression tests"
61+ - name : " Upload coverage data for regression tests"
7062 uses : actions/upload-artifact@v2
7163 with :
7264 name : coverage-regression
73- path : ./coverage.regression.xml
65+ path : ./.coverage
7466
7567 combine_coverage :
7668 needs : [unit_and_integration_tests, regression_tests]
@@ -80,23 +72,27 @@ jobs:
8072 - uses : actions/setup-python@v4
8173 with :
8274 python-version : 3.11
83- - name : Download coverage reports
75+ - name : Install coverage
76+ run : pip install coverage
77+ - name : Download coverage data
8478 uses : actions/download-artifact@v2
8579 with :
8680 name : coverage-unit
87- - name : Download coverage reports
81+ path : unit
82+ - name : Download coverage data
8883 uses : actions/download-artifact@v2
8984 with :
9085 name : coverage-regression
91- - name : Install coverage
92- run : pip install coverage
93- - name : Combine reports
86+ path : regression
87+ - name : Combine coverage data
9488 run : |
95- coverage combine coverage.unit.xml coverage.regression.xml
96- coverage xml -o coverage.combined.xml
89+ mv unit/.coverage .coverage.unit
90+ mv regression/.coverage .coverage.regression
91+ coverage combine
92+ coverage xml
9793 - name : " Upload combined coverage to Codecov"
9894 uses : codecov/codecov-action@v3
9995 with :
10096 token : ${{ secrets.CODECOV_TOKEN }}
101- files : ./coverage.combined. xml
97+ files : ./coverage.xml
10298 name : codecov-umbrella
0 commit comments