Skip to content

Fix CI

Fix CI #252

Workflow file for this run

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