File tree Expand file tree Collapse file tree 1 file changed +24
-17
lines changed
Expand file tree Collapse file tree 1 file changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -5,31 +5,38 @@ name: Python application
55
66on :
77 push :
8- branches : [ "main" ]
8+ branches : ["main"]
99 pull_request :
10- branches : [ "main" ]
10+ branches : ["main"]
1111 workflow_dispatch :
1212
1313permissions :
1414 contents : read
1515
1616jobs :
1717 build :
18-
1918 runs-on : ubuntu-latest
19+ strategy :
20+ matrix :
21+ python-version : ["3.12", "3.13"]
2022
2123 steps :
22- - uses : actions/checkout@v5
23- - name : Set up Python
24- uses : actions/setup-python@v5
25- with :
26- python-version : ' 3.x'
27- - name : Install dependencies
28- run : |
29- python -m pip install --upgrade pip
30- pip install requests
31- - name : Test with pytest
32- run : |
33- pip install pytest pytest-cov
34- pytest -q --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
35-
24+ - uses : actions/checkout@v5
25+ - name : Set up Python
26+ uses : actions/setup-python@v5
27+ with :
28+ python-version : ${{ matrix.python-version }}
29+ - name : Install dependencies
30+ run : |
31+ python -m pip install --upgrade pip
32+ pip install requests pytest
33+ - name : Test with pytest
34+ run : |
35+ pytest --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml
36+ - name : Upload pytest test results
37+ uses : actions/upload-artifact@v4
38+ with :
39+ name : pytest-results-${{ matrix.python-version }}
40+ path : junit/test-results-${{ matrix.python-version }}.xml
41+ # Use always() to always run this step to publish test results when there are test failures
42+ if : ${{ always() }}
You can’t perform that action at this time.
0 commit comments