-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.58 KB
/
main.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
name: testing app
run-name: Test the app
on:
pull_request:
types: [opened, reopened]
push:
branches:
- main
env:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432
TEST_DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432
API_VERSION: 'v1'
SECRET_KEY: 'd76db401004b334d0d79bc041f6c6f54c5f495ef4dc228f500eab4df532248ac'
ALGORITHM: 'HS256'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: all ltree to postgres
run: |
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d postgres -tc "create extension if not exists ltree;"
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-ansi --no-interaction --with dev
- name: Test
run: poetry run pytest --cov=src -v