-
Notifications
You must be signed in to change notification settings - Fork 8
74 lines (62 loc) · 1.98 KB
/
pytest.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
74
name: pytest
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
db-backend: [mysql, postgres]
python-version: ['3.9', '3.12']
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres_password
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: |
sudo apt update
sudo apt install -y libpq-dev postgresql postgresql-client
python -m pip install --upgrade pip
- name: Install Daiquiri
run: |
pip install -e .[ci]
- name: Prepare testing app
run: |
cp testing/config/settings/${{ matrix.db-backend }}.py testing/config/settings/local.py
mkdir testing/log testing/download
- name: Prepare MySQL database
run: |
sudo systemctl start mysql.service
mysql --user=root --password=root < testing/sql/mysql/setup.sql
- name: Prepare PostgreSQL database
run: |
psql postgresql://postgres:postgres_password@localhost:5432 -f testing/sql/postgres/setup.sql
psql postgresql://postgres:postgres_password@localhost:5432/test_daiquiri_data -c 'VACUUM ANALYSE;'
- name: Run tests
run: |
pytest --reuse-db --cov=daiquiri
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: '${{ matrix.db-backend }}: ${{ matrix.python-version }}'
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Run Coveralls finish
run: |
pip install coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}