-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (54 loc) · 1.83 KB
/
test_backends.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
name: test-backends
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get install libpcsclite-dev
pip install --user pdm
pdm sync --prod
- name: Test backend sqlite
run: |
sed -i 's/^CARD.*/CARD = ""/' config.py
sed -i 's/^FACERECOGNITION.*/FACERECOGNITION = False/' config.py
sed -i 's/^PIR.*/PIR = False/' config.py
sed -i 's/^ILLUMINATION.*/ILLUMINATION = False/' config.py
sed -i 's/^DB_BACKEND.*/DB_BACKEND = "sqlite"/' config.py
pdm run ./bin/run.py &
pid=$!
sleep 1
ps | grep -c $pid || wait $pid
kill -SIGTERM $pid
- name: Test backend postgresql
run: |
sed -i 's/^CARD.*/CARD = ""/' config.py
sed -i 's/^FACERECOGNITION.*/FACERECOGNITION = False/' config.py
sed -i 's/^PIR.*/PIR = False/' config.py
sed -i 's/^ILLUMINATION.*/ILLUMINATION = False/' config.py
sed -i 's/^DB_BACKEND.*/DB_BACKEND = "postgres"/' config.py
pdm run ./bin/run.py &
pid=$!
sleep 1
ps | grep -c $pid || wait $pid
kill -SIGTERM $pid
- name: Test backend testing
run: |
sed -i 's/^CARD.*/CARD = ""/' config.py
sed -i 's/^FACERECOGNITION.*/FACERECOGNITION = False/' config.py
sed -i 's/^PIR.*/PIR = False/' config.py
sed -i 's/^ILLUMINATION.*/ILLUMINATION = False/' config.py
sed -i 's/^DB_BACKEND.*/DB_BACKEND = "sqlite"/' config.py
export FLASK_ENV=prefilled
export FLASK_DEBUG=true
pdm run ./bin/run.py &
pid=$!
sleep 1
ps | grep -c $pid || wait $pid
kill -SIGTERM $pid