-
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (118 loc) · 3.76 KB
/
Copy pathautotester.yml
File metadata and controls
137 lines (118 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Checks
on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
branches:
- '**'
jobs:
# Run pre-commit Checks
pre-commit:
name: Pre Commit Checks
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v6
# Set up Python
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: 'pyproject.toml' # Read the Python version from the pyproject.toml file
# Set up Node.js
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- run: npm install
- name: Run Pre Commit Checks
uses: pre-commit/action@v3.0.1
# Run Test Coverage
test-coverage:
needs: [pre-commit]
name: AA Latest (Python ${{ matrix.python-version }} with ${{ matrix.database }})
runs-on: ubuntu-latest
strategy:
# Set Python versions to test against
matrix:
python-version:
- '3.10' # [LTS] Maintained until: October 2026
- '3.11' # [LTS] Maintained until: October 2027
- '3.12' # [LTS] Maintained until: October 2028
- '3.13' # [LTS] Maintained until: October 2029
# MySQL versions to test against
database:
# https://endoflife.date/mysql
- mysql:8.4 # [LTS] Maintained until: April 2032
# https://endoflife.date/mariadb and https://mariadb.com/kb/en/mariadb-server-release-dates/
- mariadb:10.11 # [LTS] Maintained until: February 2028
- mariadb:11.4 # [LTS] Maintained until: May 2029
# continue-on-error: ${{ matrix.python-version == '3.13' }}
# Set up services
services:
database:
image: ${{ matrix.database }}
env:
MYSQL_ROOT_PASSWORD: temp_password_aa_tox_tests
MYSQL_DATABASE: temp_allianceauth
ports:
- 3306:3306
options: --tmpfs /var/lib/mysql
steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v6
- name: Install Redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: 'latest'
- name: Verify Redis is running
run: |
redis-cli ping
redis-cli info
# Set up Python
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
# AAv5 development branch requires libbz2-dev for some reason, so we need to install it before running Tox
- name: Install libbz2-dev
run: |
sudo apt-get update
sudo apt-get install -y libbz2-dev
# Install Tox and any other packages
- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
# Run Tox with the specified environment
- name: Run Tox
env:
TOX_ENV: allianceauth-latest
run: tox -v -e ${{ env.TOX_ENV }}
# Upload coverage to Codecov
- name: Upload Coverage
if: ${{
(
github.event_name == 'pull_request'
|| (
github.event_name == 'push'
&& github.ref == 'refs/heads/master'
)
)
&& (
matrix.python-version == '3.12'
&& matrix.database == 'mariadb:10.11'
)
}}
uses: codecov/codecov-action@v6
with:
files: coverage.xml
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}