-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (62 loc) · 1.93 KB
/
ci.yml
File metadata and controls
72 lines (62 loc) · 1.93 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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
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: editgroups
MARIADB_ROOT_PASSWORD: editgroups
ports:
- 3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
redis:
image: redis
ports:
- 6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
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 setuptools
pip install -r requirements.txt
pip install mysqlclient==2.2.7 coveralls
pip freeze
echo "from .dev import *" > editgroups/settings/__init__.py
cat editgroups/settings/secret_gh_action.py | sed -e "s/MARIADB_PORT/${{ job.services.mariadb.ports[3306] }}/g" | sed -e "s/REDIS_REAL_PORT/${{ job.services.redis.ports[6379] }}/g" > editgroups/settings/secret.py
- 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
run: |
coverage run --source=editgroups,store,revert,tagging --omit=*/migrations/*,edtigroups/settings/* manage.py test -v 2
env:
DJANGO_SETTINGS_MODULE: editgroups.settings