-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.28 KB
/
run-tests.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
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
run-tests:
name: Run the PyTest tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: ${{secrets.POPROX_CI_DB_USER}}
POSTGRES_PASSWORD: ${{secrets.POPROX_CI_DB_PASSWORD}}
POSTGRES_DB: poprox
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5433:5432
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install this package
run: |
pip install -e .[dev]
- name: Apply database migrations
working-directory: ./poprox-db
run: |
alembic upgrade heads
env:
POPROX_DB_USER: ${{secrets.POPROX_CI_DB_USER}}
POPROX_DB_PASSWORD: ${{secrets.POPROX_CI_DB_PASSWORD}}
POPROX_DB_PORT: 5433
- name: Run tests
run: |
python -m pytest -v tests/
env:
POPROX_DB_USER: ${{secrets.POPROX_CI_DB_USER}}
POPROX_DB_PASSWORD: ${{secrets.POPROX_CI_DB_PASSWORD}}
POPROX_DB_PORT: 5433