-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (61 loc) · 1.81 KB
/
test-develop.yml
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
# Runs a build test every time a commit is pushed to branch 'develop'.
# Runs a build test and merges develop into main every time a tag with pattern 'v*' is pushed.
name: Test Develop
on:
push:
branches: [ develop ]
jobs:
build-test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
db: [sqlite, mysql] # postgres
python-version: [3.8, 3.11]
include:
- db: sqlite
db_engine: django.db.backends.sqlite3
- db: mysql
db_port: 3306
db_engine: django.db.backends.mysql
db_user: root
services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: ddmtestdb
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install psycopg2 mysqlclient
pip install -r test_project/dev_requirements.txt
- name: Run Tests With ${{ matrix.db }}
env:
DB: ${{ matrix.db }}
DB_ENGINE: ${{ matrix.db_engine }}
DB_NAME: ddmtestdb
DB_USER: ${{ matrix.db_user }}
DB_PASSWORD: password
DB_PORT: ${{ matrix.db_port }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
python test_project/manage.py test ddm
trigger-publish-docs:
needs: build-test
if: success()
uses: ./.github/workflows/publish-docs.yml