forked from Nitrate/Nitrate
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (76 loc) · 2.33 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
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-latest
strategy:
max-parallel: 7
matrix:
python-version: [3.9, '3.10', '3.11']
django-version: [django320, django420]
db: [sqlite]
include:
- python-version: '3.11'
django-version: django320
db: mysql
- python-version: '3.11'
django-version: django320
db: mariadb
- python-version: '3.11'
django-version: django320
db: postgres
- python-version: '3.11'
django-version: django420
db: mysql
- python-version: '3.11'
django-version: django420
db: mariadb
- python-version: '3.11'
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@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox "tox-docker>=2.0.0" 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@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@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true