-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (62 loc) · 1.66 KB
/
dev.yml
File metadata and controls
63 lines (62 loc) · 1.66 KB
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: CI
on:
push:
branches:
- main
jobs:
pri-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.1
- uses: pre-commit-ci/lite-action@v1.0.2
if: always()
ci:
strategy:
fail-fast: false
matrix:
python-version: [ "3.11" ]
poetry-version: [ "1.7.1" ]
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
services:
# Label used to access the service container
pdb:
# Docker Hub image
image: postgres:15.4
ports:
- 5432:5432
env:
POSTGRES_USER: payam
POSTGRES_PASSWORD: payam
POSTGRES_DB: foo
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: poetry install
- name: Run Database Migrations
run: |
poetry run alembic upgrade head
env:
DATABASE_URL: postgresql+asyncpg://payam:payam@localhost:5432/foo
- name: Run the automated tests
env:
DATABASE_URL: postgresql+asyncpg://payam:payam@localhost:5432/foo
run: |
poetry run pytest