@@ -2,7 +2,6 @@ name: Tests (pytest + coverage)
22
33on :
44 push :
5- pull_request :
65 branches : [ main ]
76
87permissions :
1514 strategy :
1615 matrix :
1716 python-version : ["3.10"]
17+
1818 steps :
1919 - name : Checkout
2020 uses : actions/checkout@v4
@@ -44,43 +44,21 @@ jobs:
4444 pip install .
4545 pip install pytest pytest-cov
4646
47- - name : Show installed packages (top)
48- run : |
49- pip freeze | sed -n '1,200p'
47+ - name : Show installed packages
48+ run : pip freeze | sed -n '1,200p'
5049
51- - name : Run pytest (verbose) with coverage and generate JUnit XML
50+ - name : Run pytest with coverage
5251 run : |
5352 mkdir -p test-output
5453 pytest -vv --maxfail=1 --disable-warnings \
5554 --junitxml=test-output/report.xml \
56- --cov=user_scanner --cov-report=xml:test-output/coverage.xml --cov-report=term
57-
58- - name : Show pytest junit xml (head)
59- if : always()
60- run : |
61- echo "==== JUnit report (head) ===="
62- sed -n '1,200p' test-output/report.xml || true
63- echo "==== JUnit report (tail) ===="
64- sed -n '200,400p' test-output/report.xml || true
55+ --cov=user_scanner \
56+ --cov-report=xml:test-output/coverage.xml \
57+ --cov-report=term
6558
66- - name : Show coverage xml (head)
67- if : always()
68- run : |
69- echo "==== Coverage XML (head) ===="
70- sed -n '1,200p' test-output/coverage.xml || true
71-
72- - name : Upload test & coverage artifacts
59+ - name : Upload test artifacts
7360 if : always()
7461 uses : actions/upload-artifact@v4
7562 with :
7663 name : test-reports-${{ matrix.python-version }}
7764 path : test-output
78-
79- - name : (Optional) Upload coverage to Codecov
80- if : success() && env.CODECOV_TOKEN != ''
81- uses : codecov/codecov-action@v4
82- with :
83- files : test-output/coverage.xml
84- token : ${{ secrets.CODECOV_TOKEN }}
85- env :
86- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
0 commit comments