@@ -14,26 +14,28 @@ jobs:
1414 container :
1515 image : python:2.7.18-buster
1616 steps :
17- - uses : actions/checkout@v3
18- - name : Set up Python ${{ matrix.python-version }}
19- uses : actions/setup-python@v4
20- with :
21- python-version : ${{ matrix.python-version }}
17+ - uses : actions/checkout@v4
2218 - name : Install dependencies
2319 run : |
2420 python -m pip install -r requirements.txt && \
2521 python -m pip install -r requirements_dev.txt
26- - name : Test with pytest
22+ - name : Test with pytest and coverage
2723 run : |
28- pytest
24+ pytest --cov=./cert_chain_resolver --cov-report term-missing -n auto
25+ - name : Upload coverage artifact
26+ if : success()
27+ uses : actions/upload-artifact@v4
28+ with :
29+ name : coverage-2.7
30+ path : .coverage
2931
3032 Test :
3133 runs-on : ubuntu-latest
3234 strategy :
3335 matrix :
3436 python-version : ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
3537 steps :
36- - uses : actions/checkout@v3
38+ - uses : actions/checkout@v4
3739 - name : Set up Python ${{ matrix.python-version }}
3840 uses : actions/setup-python@v4
3941 with :
@@ -42,10 +44,48 @@ jobs:
4244 run : |
4345 python -m pip install -r requirements.txt && \
4446 python -m pip install -r requirements_dev.txt
45- - name : Test with pytest
47+ - name : Test with pytest and coverage
48+ run : |
49+ pytest --cov=./cert_chain_resolver --cov-report term-missing -n auto
50+ - name : Upload coverage artifact
51+ if : success()
52+ uses : actions/upload-artifact@v4
53+ with :
54+ name : coverage-${{ matrix.python-version }}
55+ path : .coverage
56+
57+ combine-coverage :
58+ runs-on : ubuntu-latest
59+ needs :
60+ - Test
61+ - Test-python-27
62+ steps :
63+ - uses : actions/checkout@v4
64+ - name : Set up Python
65+ uses : actions/setup-python@v4
66+ with :
67+ python-version : 3.12
68+ - name : Install coverage tools
69+ run : |
70+ python -m pip install coverage codecov
71+ - name : Download coverage artifacts
72+ uses : actions/download-artifact@v4
73+ with :
74+ pattern : coverage-*
75+ - name : Combine coverage reports
4676 run : |
47- pytest
77+ ls -lashR .
78+ set -x
79+ coverage combine coverage-*/.coverage
80+ coverage report
81+ coverage xml -o combined_coverage.xml
4882
83+ coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
84+ - name : Upload coverage to Codecov
85+ uses : codecov/codecov-action@v4
86+ with :
87+ file : ./combined_coverage.xml
88+ token : ${{ secrets.CODECOV_TOKEN }}
4989 mypy :
5090 runs-on : ubuntu-latest
5191 strategy :
0 commit comments