-
Notifications
You must be signed in to change notification settings - Fork 17
69 lines (60 loc) · 1.67 KB
/
ci.yml
File metadata and controls
69 lines (60 loc) · 1.67 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
name: Django CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.11, 3.12]
services:
mariadb:
image: mariadb:11.7.2
env:
MARIADB_DATABASE: quickstatements
MARIADB_ROOT_PASSWORD: quickstatements_pass
ports:
- 3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/requirements.txt
pip install -r requirements-dev.txt
- name: Verify MariaDB connection
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
sleep 1
done
- name: Run Tests
env:
DB_NAME: quickstatements
DB_USER: root
DB_PASSWORD: quickstatements_pass
DB_HOST: 127.0.0.1
QSTS_DEBUG: "True"
DJANGO_SECRET_KEY: dummysecretkey123
OAUTH_CLIENT_ID: dummyoauthclientid
OAUTH_CLIENT_SECRET: dummyoauthclientsecret
DB_ENGINE: django.db.backends.mysql
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
cd src
pytest