-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (61 loc) · 2.28 KB
/
django.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
72
73
---
name: Django CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
ATLASSERVER_DJANGO_MYSQL_DBNAME: atlasserver
ATLASSERVER_DJANGO_MYSQL_USER: root
ATLASSERVER_DJANGO_MYSQL_PASSWORD: root
ATLASSERVER_EMAIL_HOST_USER: [email protected]
ATLASSERVER_DJANGO_SECRET_KEY: ${{secrets.ATLASSERVER_DJANGO_SECRET_KEY}}
jobs:
build:
environment: test
runs-on: ubuntu-latest
# services:
# mysql:
# image: mysql:5.7
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
# MYSQL_DATABASE: atlasserver
# MYSQL_USER: root
# MYSQL_PASSWORD: password
# MYSQL_ROOT_PASSWORD: password
# ports:
# - 3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip uv wheel mod-wsgi-standalone mysqlclient
- name: Install package
run: |
cat atlasserver/settings_test.txt >> atlasserver/settings.py
uv pip install --system -e .
- name: Install geoip databases
run: ./update_geoipdatabase.sh
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
echo "mysql started"
mysql -e "CREATE DATABASE ${{env.ATLASSERVER_DJANGO_MYSQL_DBNAME}};" -u${{env.ATLASSERVER_DJANGO_MYSQL_USER}} -p${{env.ATLASSERVER_DJANGO_MYSQL_PASSWORD}}
./manage.py makemigrations
./manage.py migrate
- name: Run Django Tests
run: |
./manage.py test
- name: Start and stop server
run: |
atlaswebserver start
atlastaskrunner start
atlastaskrunner stop
atlaswebserver stop