16
16
- ' **'
17
17
18
18
jobs :
19
- # pre-commit Checks
19
+ # Run pre-commit Checks
20
20
pre-commit :
21
21
name : Pre Commit Checks
22
22
runs-on : ubuntu-latest
23
23
24
24
steps :
25
+ # Checkout the repository
25
26
- name : Checkout
26
27
uses : actions/checkout@v4
27
28
29
+ # Set up Python
28
30
- name : Set up Python
29
31
uses : actions/setup-python@v5
30
32
with :
31
33
python-version-file : ' pyproject.toml' # Read the Python version from the pyproject.toml file
32
34
35
+ # Set up Node.js
36
+ - name : Setup Node.js
37
+ uses : actions/setup-node@v4
38
+ with :
39
+ node-version : ' 20'
40
+ - run : npm install
41
+
33
42
- name : Run Pre Commit Checks
34
43
uses :
pre-commit/[email protected]
35
44
36
45
# Run Test Coverage
37
- test-coverage-aa-stable :
46
+ test-coverage :
38
47
needs : [pre-commit]
39
- name : AA Latest (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} with ${{ matrix.database }})
48
+ name : AA Latest (Python ${{ matrix.python-version }} with ${{ matrix.database }})
40
49
runs-on : ubuntu-latest
41
50
42
51
strategy :
43
- # Set Python and Django version to test for the stable release of AllianceAuth
52
+ # Set Python versions to test against
44
53
matrix :
45
54
python-version :
46
55
- ' 3.8'
47
56
- ' 3.9'
48
57
- ' 3.10'
49
58
- ' 3.11'
50
- django-version :
51
- - ' 4.0'
59
+ - ' 3.12'
52
60
# MySQL versions to test against
53
61
database :
54
62
# https://endoflife.date/mysql
@@ -58,13 +66,13 @@ jobs:
58
66
- mariadb:10.4 # Maintained until: 18 June 2024
59
67
- mariadb:10.5 # Maintained until: 24 June 2025
60
68
- mariadb:10.6 # [LTS] Maintained until: July 2026
61
- - mariadb:10.10 # Maintained until: November 2023
62
69
- mariadb:10.11 # [LTS] Maintained until: February 2028
63
70
- mariadb:11.0 # Maintained until: June 2024
64
71
- mariadb:11.1 # Maintained until: August 2024
65
72
66
- # continue-on-error: ${{ matrix.python-version == '3.11-dev ' }}
73
+ # continue-on-error: ${{ matrix.python-version == '3.12 ' }}
67
74
75
+ # Set up services
68
76
services :
69
77
database :
70
78
image : ${{ matrix.database }}
@@ -76,157 +84,95 @@ jobs:
76
84
options : --tmpfs /var/lib/mysql
77
85
78
86
steps :
87
+ # Checkout the repository
79
88
- name : Checkout
80
89
uses : actions/checkout@v4
81
90
91
+ # Install redis
82
92
- name : Install redis
83
93
run : sudo apt-get install -y redis-tools redis-server
84
94
95
+ # Verify that redis is up
85
96
- name : Verify that redis is up
86
97
run : redis-cli ping
87
98
99
+ # Set up Python
88
100
- name : Setup Python ${{ matrix.python-version }}
89
101
uses : actions/setup-python@v5
90
102
with :
91
103
python-version : ${{ matrix.python-version }}
92
104
105
+ # Install Tox and any other packages
93
106
- name : Install Tox and any other packages
94
107
run : |
95
108
python -m pip install --upgrade pip
96
109
python -m pip install --upgrade tox tox-gh-actions
97
110
111
+ # Run Tox with the specified environment
98
112
- name : Run Tox
99
113
env :
100
- TOX_ENV : allianceauth-stable
114
+ TOX_ENV : allianceauth-latest
101
115
DB_HOST : 127.0.0.1
102
116
DB_USER : root
103
117
DB_PASSWORD : temp_password_aa_tox_tests
104
- # Run tox using the version of Python in `PATH`
105
118
run : tox -v -e ${{ env.TOX_ENV }}
106
119
120
+ # Upload coverage to Codecov
107
121
- name : Upload Coverage
108
122
if : ${{
109
123
(
110
- github.event_name == 'pull_request' ||
111
- (
112
- github.event_name == 'push' &&
113
- github.ref == 'refs/heads/master'
124
+ github.event_name == 'pull_request'
125
+ || (
126
+ github.event_name == 'push'
127
+ && github.ref == 'refs/heads/master'
114
128
)
115
- ) &&
116
- (
117
- matrix.python-version == '3.10' &&
118
- matrix.database == 'mariadb:10.11' &&
119
- matrix.django-version == '4.0'
129
+ )
130
+ && (
131
+ matrix.python-version == '3.10'
132
+ && matrix.database == 'mariadb:10.11'
120
133
)
121
134
}}
122
135
uses : codecov/codecov-action@v4
123
136
with :
124
- token : ${{ secrets.CODECOV_TOKEN }} # not required for public repos
137
+ token : ${{ secrets.CODECOV_TOKEN }}
125
138
files : coverage.xml # optional
126
139
# flags: unittests # optional
127
140
# name: codecov-umbrella # optional
128
141
# fail_ci_if_error: true # optional (default = false)
129
142
verbose : true # optional (default = false)
130
143
131
- # test-coverage-aa-dev:
132
- # needs: [ test-coverage-aa-stable ]
133
- # name: AA Dev (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} with ${{ matrix.database }})
134
- # runs-on: ubuntu-latest
135
- #
136
- # strategy:
137
- # # Set Python and Django version to test for the alpha/beta release of AllianceAuth
138
- # matrix:
139
- # # Python versions
140
- # python-version:
141
- # - '3.8'
142
- # - '3.9'
143
- # - '3.10'
144
- # - '3.11'
145
- # # Django versions
146
- # django-version:
147
- # - '4.0'
148
- # # MySQL versions to test against
149
- # database:
150
- # - mysql:5.7
151
- # - mysql:8.0
152
- # - mariadb:10.3
153
- # - mariadb:10.4
154
- # - mariadb:10.5
155
- # - mariadb:10.6
156
- # - mariadb:10.7
157
- # - mariadb:10.8
158
- # - mariadb:10.9
159
- #
160
- # continue-on-error: ${{ matrix.python-version == '3.11' }}
161
- #
162
- # services:
163
- # database:
164
- # image: ${{ matrix.database }}
165
- # env:
166
- # MYSQL_ROOT_PASSWORD: foobar
167
- # MYSQL_DATABASE: tox_allianceauth
168
- # ports:
169
- # - 3306:3306
170
- # options: --tmpfs /var/lib/mysql
171
- #
172
- # steps:
173
- # - name: Checkout
174
- # uses: actions/checkout@v4
175
- #
176
- # - name: Install redis
177
- # run: sudo apt-get install -y redis-tools redis-server
178
- #
179
- # - name: Verify that redis is up
180
- # run: redis-cli ping
181
- #
182
- # - name: Setup Python ${{ matrix.python-version }}
183
- # uses: actions/setup-python@v5
184
- # with:
185
- # python-version: ${{ matrix.python-version }}
186
- #
187
- # - name: Install Tox and any other packages
188
- # run: |
189
- # python -m pip install --upgrade pip
190
- # python -m pip install --upgrade tox tox-gh-actions
191
- #
192
- # - name: Run Tox
193
- # # Run tox using the version of Python in `PATH`
194
- # run: tox -v
195
- # env:
196
- # DJANGO: ${{ matrix.django-version }}
197
- # ALLIANCEAUTH: testing
198
- # DB_HOST: 127.0.0.1
199
- # DB_USER: root
200
- # DB_PASSWORD: temp_password_aa_tox_tests
201
-
202
- # Pypi Build Test
144
+ # Run PyPi Build Test
203
145
pypi-build-test :
204
- needs : [ test-coverage-aa-stable ]
205
- # needs: [ test-coverage-aa-stable, test-coverage-aa-dev ]
146
+ needs : [ test-coverage ]
206
147
name : PyPi Build Test
207
148
runs-on : ubuntu-latest
208
149
209
150
steps :
151
+ # Checkout the repository
210
152
- name : Checkout
211
153
uses : actions/checkout@v4
212
154
155
+ # Set up Python
213
156
- name : Set up Python
214
157
uses : actions/setup-python@v5
215
158
with :
216
159
python-version-file : ' pyproject.toml' # Read the Python version from the pyproject.toml file
217
160
161
+ # Install Tools
218
162
- name : Install Tools
219
163
run : |
220
164
python -m pip install --upgrade pip
221
165
python -m pip install --upgrade build
222
166
python -m pip install --upgrade setuptools wheel
223
167
168
+ # Build Package
224
169
- name : Package Build
225
170
env :
226
171
STACKMANAGER_VERSION : 9999
227
172
run : |
228
173
python -m build
229
174
175
+ # Upload Build Artifacts
230
176
- name : Upload Build Artifacts
231
177
uses : actions/upload-artifact@v4
232
178
with :
0 commit comments