-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.65 KB
/
test.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
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10", "3.12" ]
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Tweak Postgres
run: |
docker exec ${{ job.services.postgres.id }} sh -c 'echo "max_connections=200" >> /var/lib/postgresql/data/postgresql.conf'
docker kill --signal=SIGHUP ${{ job.services.postgres.id }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Set up Python
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Setup authz plugin
run: |
mkdir lib
cp authz_plugins/api_key/authz.module.py lib/
cp authz_plugins/api_key/example.env lib/.env
- name: Test
run: |
export DATABASE_URI="postgres://postgres:postgres@localhost:5432/postgres"
poetry run pytest -svv --cov=transcriptomics_data_service --cov-branch --cov-report xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true