11name : Test
22
3- on : push
3+ on : [ push, pull_request]
44
55jobs :
66 build :
7- runs-on : ubuntu-latest
87 strategy :
8+ fail-fast : false
99 matrix :
10- python-version : [3.7, 3.8, 3.9]
10+ include :
11+ - django-version : " 2.2"
12+ python-version : " 3.8"
13+ - django-version : " 2.2"
14+ python-version : " 3.8"
15+ grappelli : " 1"
16+ - django-version : " 3.2"
17+ python-version : " 3.9"
18+ - django-version : " 3.2"
19+ python-version : " 3.10"
20+ grappelli : " 1"
21+ - django-version : " 4.2"
22+ python-version : " 3.10"
23+ - django-version : " 4.2"
24+ python-version : " 3.11"
25+ grappelli : " 1"
26+ - django-version : " 5.1"
27+ python-version : " 3.12"
28+ - django-version : " 5.2"
29+ python-version : " 3.12"
30+ - django-version : " 5.2"
31+ python-version : " 3.13"
32+ grappelli : " 1"
33+
34+ runs-on : ubuntu-latest
35+ name : Django ${{ matrix.django-version }} (Python ${{ matrix.python-version }})${{ matrix.grappelli == '1' && ' + grappelli' || '' }}${{ matrix.s3 == '1' && ' + s3' || '' }}
36+ env :
37+ PYTHON : ${{ matrix.python-version }}
38+ DJANGO : ${{ matrix.django-version }}
39+ GRAPPELLI : ${{ matrix.grappelli || '0' }}
1140
1241 steps :
1342 - uses : actions/checkout@v3
@@ -17,16 +46,59 @@ jobs:
1746 with :
1847 python-version : ${{ matrix.python-version }}
1948
20- - name : Setup chromedriver
21- 22-
23- - name : Install dependencies
49+ - name : Install tox
2450 run : |
25- python -m pip install --upgrade pip
26- pip install tox tox-gh-actions
51+ python3 -m pip install tox tox-gh-actions
2752
28- - name : Test with tox
53+ - name : Run tests
2954 run : |
3055 tox -- -v --selenosis-driver=chrome-headless || \
3156 tox -- -v --selenosis-driver=chrome-headless || \
3257 tox -- -v --selenosis-driver=chrome-headless
58+
59+ - name : Upload junit xml
60+ if : always()
61+ uses : actions/upload-artifact@v4
62+ with :
63+ name : junit-reports-django-${{ matrix.django-version }}-python${{ matrix.python-version }}${{ matrix.grappelli == '1' && '-grappelli' || '' }}${{ matrix.s3 == '1' && '-s3' || '' }}-${{ github.sha }}
64+ path : reports/*.xml
65+ overwrite : true
66+
67+ - name : Combine coverage
68+ run : tox -e coverage-report
69+
70+ - name : Upload coverage
71+ uses : codecov/codecov-action@v5
72+ with :
73+ name : ${{ github.workflow }}
74+ files : .tox/coverage/coverage.xml
75+ env_vars : " DJANGO,GRAPPELLI,PYTHON"
76+ token : ${{ secrets.CODECOV_TOKEN }}
77+
78+ report :
79+ if : always()
80+ needs : build
81+ runs-on : ubuntu-latest
82+ name : " Report Test Results"
83+ steps :
84+ - uses : actions/download-artifact@v4
85+ with :
86+ merge-multiple : true
87+
88+ - name : Publish Unit Test Results
89+ if : always()
90+ uses : mikepenz/action-junit-report@1a91e26932fb7ba410a31fab1f09266a96d29971
91+ with :
92+ report_paths : ./*.xml
93+ require_tests : true
94+ fail_on_failure : true
95+ check_name : Test Report
96+ github_token : ${{ secrets.GITHUB_TOKEN }}
97+
98+ success :
99+ needs : [report]
100+ runs-on : ubuntu-latest
101+ name : Test Successful
102+ steps :
103+ - name : Success
104+ run : echo Test Successful
0 commit comments