-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (47 loc) · 1.41 KB
/
test_run.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
name: Run tests
on: push
jobs:
tests-job:
runs-on: ubuntu-latest
# Postgres service
services:
postgres:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: ""
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install -U coverage flake8 isort pytest pytest-cov
pip install -r requirements.txt
- name: Install PostgreSQL client
run: |
sudo apt-get update && sudo apt-get install -y postgresql-client
- name: Apply database schema
run: |
psql -U postgres -p 5432 -h localhost < schema.sql
- name: Run tests
run: |
cp .github/queuebot_test_config.yaml config.yaml
export PYTHONPATH=$PYTHONPATH:$(pwd)
pytest -vs --cov=queuebot --cov-report term-missing:skip-covered
flake8 .
isort . --check-only --recursive
- name: Store test reports
uses: actions/upload-artifact@v2
with:
name: test-reports
path: test-reports/*