|
1 | 1 | name: CI |
2 | | - |
3 | 2 | on: |
4 | 3 | push: |
5 | 4 | branches: |
6 | 5 | - main |
7 | 6 | pull_request: |
8 | | - |
9 | 7 | jobs: |
10 | | - |
11 | | - lint: |
12 | | - runs-on: ubuntu-latest |
13 | | - strategy: |
14 | | - matrix: |
15 | | - lint-command: |
16 | | - - bandit -r . -x ./tests |
17 | | - - black --check --diff . |
18 | | - - flake8 . |
19 | | - - isort --check-only --diff . |
20 | | - - pydocstyle . |
21 | | - steps: |
22 | | - - uses: actions/checkout@v6 |
23 | | - - uses: actions/setup-python@v6 |
24 | | - with: |
25 | | - python-version: "3.x" |
26 | | - cache: 'pip' |
27 | | - cache-dependency-path: 'pyproject.toml' |
28 | | - - run: python -m pip install -e .[lint] |
29 | | - - run: ${{ matrix.lint-command }} |
30 | | - |
31 | 8 | dist: |
32 | 9 | runs-on: ubuntu-latest |
33 | 10 | steps: |
34 | 11 | - uses: actions/checkout@v6 |
35 | | - - uses: actions/setup-python@v6 |
36 | | - with: |
37 | | - python-version: "3.x" |
38 | | - - run: python -m pip install --upgrade pip build wheel twine |
39 | | - - run: python -m build --sdist --wheel |
40 | | - - run: python -m twine check dist/* |
| 12 | + - uses: astral-sh/setup-uv@v7 |
| 13 | + - run: uvx --from build pyproject-build --sdist --wheel |
| 14 | + - run: uvx twine check dist/* |
41 | 15 | - uses: actions/upload-artifact@v6 |
42 | 16 | with: |
43 | 17 | path: dist/* |
44 | | - |
45 | 18 | pytest-python: |
46 | 19 | name: PyTest |
47 | | - needs: |
48 | | - - lint |
49 | 20 | strategy: |
50 | 21 | matrix: |
51 | 22 | python-version: |
52 | | - - "3.9" |
53 | 23 | - "3.10" |
54 | 24 | - "3.11" |
55 | 25 | - "3.12" |
| 26 | + - "3.13" |
| 27 | + - "3.14" |
56 | 28 | django-version: |
57 | | - - "4.2" # LTS |
| 29 | + - "5.2" # LTS |
58 | 30 | runs-on: ubuntu-latest |
59 | 31 | steps: |
60 | 32 | - uses: actions/checkout@v6 |
61 | | - - name: Set up Python ${{ matrix.python-version }} |
62 | | - uses: actions/setup-python@v6 |
| 33 | + - uses: astral-sh/setup-uv@v7 |
63 | 34 | with: |
64 | 35 | python-version: ${{ matrix.python-version }} |
65 | | - - run: python -m pip install .[test] |
66 | | - - run: python -m pip install django~=${{ matrix.django-version }}.0 |
67 | | - - run: python -m pytest |
| 36 | + - uses: actions/setup-node@v6 |
| 37 | + with: |
| 38 | + node-version: "lts/*" |
| 39 | + - run: | |
| 40 | + cd tests |
| 41 | + npm install |
| 42 | + - run: uv run tests/manage.py collectstatic --noinput |
| 43 | + - run: uv run ${{ matrix.extras }} --with django~=${{ matrix.django-version }}.0 pytest |
68 | 44 | - uses: codecov/codecov-action@v5 |
69 | 45 | with: |
70 | 46 | flags: py${{ matrix.python-version }} |
71 | 47 | token: ${{ secrets.CODECOV_TOKEN }} |
72 | | - |
73 | 48 | pytest-django: |
74 | 49 | name: PyTest |
75 | | - needs: |
76 | | - - lint |
77 | 50 | strategy: |
78 | 51 | matrix: |
79 | 52 | python-version: |
80 | | - - "3.11" |
| 53 | + - "3.12" |
81 | 54 | django-version: |
82 | 55 | # oldest LTS gets tested on all Python versions |
83 | 56 | - "5.1" |
84 | 57 | - "5.2" |
| 58 | + - "6.0" |
85 | 59 | runs-on: ubuntu-latest |
86 | 60 | steps: |
87 | 61 | - uses: actions/checkout@v6 |
88 | | - - name: Set up Python ${{ matrix.python-version }} |
89 | | - uses: actions/setup-python@v6 |
| 62 | + - uses: astral-sh/setup-uv@v7 |
90 | 63 | with: |
91 | 64 | python-version: ${{ matrix.python-version }} |
92 | | - - run: python -m pip install .[test] |
93 | | - - run: python -m pip install django~=${{ matrix.django-version }}.0 |
94 | | - - run: python -m pytest |
| 65 | + - uses: actions/setup-node@v6 |
| 66 | + with: |
| 67 | + node-version: "lts/*" |
| 68 | + - run: | |
| 69 | + cd tests |
| 70 | + npm install |
| 71 | + - run: uv run tests/manage.py collectstatic --noinput |
| 72 | + - run: uv run ${{ matrix.extras }} --with django~=${{ matrix.django-version }}.0 pytest |
95 | 73 | - uses: codecov/codecov-action@v5 |
96 | 74 | with: |
97 | 75 | flags: dj${{ matrix.django-version }} |
98 | 76 | token: ${{ secrets.CODECOV_TOKEN }} |
99 | | - |
100 | 77 | pytest-extras: |
101 | 78 | name: PyTest |
102 | | - needs: |
103 | | - - lint |
104 | 79 | strategy: |
105 | 80 | matrix: |
106 | 81 | extras: |
107 | | - - "whitenoise" |
| 82 | + - "--extra whitenoise" |
108 | 83 | runs-on: ubuntu-latest |
109 | 84 | steps: |
110 | 85 | - uses: actions/checkout@v6 |
111 | | - - name: Set up Python ${{ matrix.python-version }} |
112 | | - uses: actions/setup-python@v6 |
| 86 | + - uses: astral-sh/setup-uv@v7 |
| 87 | + - uses: actions/setup-node@v6 |
113 | 88 | with: |
114 | | - python-version: 3.x |
115 | | - - run: python -m pip install .[test,${{ matrix.extras }}] |
116 | | - - run: python -m pytest |
| 89 | + node-version: "lts/*" |
| 90 | + - run: | |
| 91 | + cd tests |
| 92 | + npm install |
| 93 | + - run: uv run tests/manage.py collectstatic --noinput |
| 94 | + - run: uv run ${{ matrix.extras }} pytest |
117 | 95 | - uses: codecov/codecov-action@v5 |
118 | 96 | with: |
119 | 97 | flags: dj${{ matrix.extras }} |
120 | 98 | token: ${{ secrets.CODECOV_TOKEN }} |
121 | | - |
122 | | - codeql: |
123 | | - name: CodeQL |
124 | | - needs: [ dist, pytest-python, pytest-django ] |
125 | | - runs-on: ubuntu-latest |
126 | | - permissions: |
127 | | - actions: read |
128 | | - contents: read |
129 | | - security-events: write |
130 | | - strategy: |
131 | | - fail-fast: false |
132 | | - matrix: |
133 | | - language: [ python ] |
134 | | - steps: |
135 | | - - name: Checkout |
136 | | - uses: actions/checkout@v6 |
137 | | - - name: Initialize CodeQL |
138 | | - uses: github/codeql-action/init@v4 |
139 | | - with: |
140 | | - languages: ${{ matrix.language }} |
141 | | - queries: +security-and-quality |
142 | | - - name: Autobuild |
143 | | - uses: github/codeql-action/autobuild@v4 |
144 | | - - name: Perform CodeQL Analysis |
145 | | - uses: github/codeql-action/analyze@v4 |
146 | | - with: |
147 | | - category: "/language:${{ matrix.language }}" |
0 commit comments