@@ -3,53 +3,87 @@ name: CI
33on :
44 push :
55 branches :
6- - master
6+ - main
77 pull_request :
88
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.ref }}
11+ cancel-in-progress : true
12+
913jobs :
14+ pre-commit :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v6
18+ with :
19+ fetch-depth : 0
20+
21+ - uses : actions/setup-python@v6
22+ with :
23+ python-version : " 3.10"
24+
25+ - uses : pre-commit/action@v3.0.1
26+
1027 tests :
1128 name : Python ${{ matrix.python-version }}
12- runs-on : ubuntu-20 .04
29+ runs-on : ubuntu-24 .04
1330
1431 strategy :
1532 matrix :
1633 python-version :
17- - ' 3.6'
18- - ' 3.7'
19- - ' 3.8'
20- - ' 3.9'
34+ - ' 3.10'
35+ - ' 3.11'
36+ - ' 3.12'
37+ - ' 3.13'
38+ - ' 3.14'
2139
2240 steps :
23- - uses : actions/checkout@v2
41+ - uses : actions/checkout@v6
2442
25- - uses : actions/setup-python@v2
43+ - uses : actions/setup-python@v6
2644 with :
2745 python-version : ${{ matrix.python-version }}
28-
29- - uses : actions/cache@v2
30- with :
31- path : ~/.cache/pip
32- key : ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
33- restore-keys : |
34- ${{ runner.os }}-pip-
46+ allow-prereleases : true
47+ cache : ' pip'
3548
3649 - name : Upgrade packaging tools
3750 run : python -m pip install --upgrade pip setuptools virtualenv wheel
3851
3952 - name : Install dependencies
40- run : python -m pip install --upgrade codecov tox tox-py
53+ run : python -m pip install --upgrade tox
4154
4255 - name : Run tox targets for ${{ matrix.python-version }}
43- run : tox --py current
56+ run : tox run -f py$(echo ${{ matrix.python-version }} | tr -d . | cut -f 1 -d '-')
4457
4558 - name : Run extra tox targets
46- if : ${{ matrix.python-version == '3.9 ' }}
59+ if : ${{ matrix.python-version == '3.13 ' }}
4760 run : |
48- python setup.py bdist_wheel
49- rm -r djangorestframework.egg-info # see #6139
5061 tox -e base,dist,docs
51- tox -e dist --installpkg ./dist/djangorestframework-*.whl
5262
5363 - name : Upload coverage
54- run : |
55- codecov -e TOXENV,DJANGO
64+ uses : codecov/codecov-action@v5
65+ with :
66+ env_vars : TOXENV,DJANGO
67+
68+ test-docs :
69+ name : Test documentation links
70+ runs-on : ubuntu-24.04
71+ steps :
72+ - uses : actions/checkout@v6
73+
74+ - uses : actions/setup-python@v6
75+ with :
76+ python-version : ' 3.13'
77+
78+ - name : Install dependencies
79+ run : pip install --group docs
80+
81+ # Start mkdocs server and wait for it to be ready
82+ - run : mkdocs serve &
83+ - run : WAIT_TIME=0 && until nc -vzw 2 localhost 8000 || [ $WAIT_TIME -eq 5 ]; do sleep $(( WAIT_TIME++ )); done
84+ - run : if [ $WAIT_TIME == 5 ]; then echo cannot start mkdocs server on http://localhost:8000; exit 1; fi
85+
86+ - name : Check links
87+ run : pylinkvalidate.py -P http://localhost:8000/
88+
89+ - run : echo "Done"
0 commit comments