forked from Nitrate/Nitrate
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (106 loc) · 3.46 KB
/
unittests.yaml
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
name: Unit Tests
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
jobs:
unittests:
name: "py${{ matrix.python-version }}-${{ matrix.django-version }}-${{ matrix.db }}"
runs-on: ubuntu-24.04
services:
mariadb:
image: mariadb:10.11.8@sha256:75f6e61397758489d1dccf95db33b6b49ebfc7ec1253d40060fdf8ceb7f938a3
ports:
- 33061:3306
env:
MYSQL_DATABASE: nitrate
MYSQL_ROOT_PASSWORD: pass
options: >-
--name=testdb-mariadb
--health-cmd="mysqladmin ping -uroot -ppass"
--health-interval=5s
--health-timeout=2s
--health-retries=3
postgres:
image: postgres:16.3@sha256:0aafd2ae7e6c391f39fb6b7621632d79f54068faebc726caf469e87bd1d301c0
ports:
- 54321:5432
env:
POSTGRES_PASSWORD: pass
options: >-
--name=testdb-pgsql
--health-cmd="echo pass | psql -U postgres -W --command 'SELECT 1'"
--health-interval=5s
--health-timeout=2s
--health-retries=3
mysql:
image: mysql:8.0.22@sha256:0fd2898dc1c946b34dceaccc3b80d38b1049285c1dab70df7480de62265d6213
ports:
- 33062:3306
env:
MYSQL_DATABASE: nitrate
MYSQL_ROOT_PASSWORD: pass
options: >-
--name=testdb-mysql
--health-cmd="mysqladmin ping -uroot -ppass"
--health-interval=5s
--health-timeout=2s
--health-retries=3
strategy:
max-parallel: 7
matrix:
python-version: [3.9, '3.10', '3.11', '3.12']
django-version: [django420]
db: [sqlite]
include:
- python-version: '3.12'
django-version: django420
db: mysql
- python-version: '3.12'
django-version: django420
db: mariadb
- python-version: '3.12'
django-version: django420
db: postgres
steps:
- name: Install packages used to setup testenv
run: |
sudo apt update
sudo apt-get install gcc python3-dev libkrb5-dev libmariadb-dev libcrypt-dev
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox coveralls
- run: |
echo "tox_pyver=${pyver}" | sed "s/\.//" >> $GITHUB_ENV
env:
pyver: ${{ matrix.python-version }}
- name: Tox
run: |
tox -e py$tox_pyver-${{ matrix.django-version }}-${{ matrix.db }}
- name: Parallel coverage report
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: testenv-py${{ matrix.python-version }}-${{ matrix.django-version }}-${{ matrix.db }}
parallel: true
coveralls:
name: Finish Coveralls
needs: unittests
runs-on: ubuntu-latest
steps:
- name: Finish coverage report
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true