-
-
Notifications
You must be signed in to change notification settings - Fork 7
72 lines (62 loc) · 1.58 KB
/
ci.yaml
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
64
65
66
67
68
69
70
71
72
name: build
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- CHANGELOG.md
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- CHANGELOG.md
jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
services:
postgres:
image: postgres:12.6
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
strategy:
max-parallel: 4
matrix:
python-version: ["3.10"]
database-url: ["postgresql://postgres:postgres@localhost:5432/postgres"]
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
git --version
python --version
python -m pip install --upgrade pip
pip --version
pip install poetry
poetry --version
poetry install
- name: Run Tests
run: |
poetry run pytest -vv --cov --cov-report=html --cov-report=xml
env:
DATABASE_URL: ${{ matrix.database-url }}
- name: Send Reports to Codecov
uses: codecov/codecov-action@v3
env:
PYTHON: ${{ matrix.python-version }}
DB_URL: ${{ matrix.database-url }}
with:
env_vars: PYTHON,DB_URL