-
Notifications
You must be signed in to change notification settings - Fork 18
60 lines (60 loc) · 1.97 KB
/
code.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
name: code
on:
pull_request:
push:
branches:
- master
paths:
- pyproject.toml
- poetry.lock
- "**.py"
jobs:
django-tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.10", "3.11", "3.12"]
django-version: ["~=4.2", "==5.0b1"]
psycopg-version: ["psycopg", "psycopg2"]
services:
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --name postgres --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: poetry install
- name: Install Django specific version ${{ matrix.django-version }}
run: poetry run pip install "Django${{ matrix.django-version }}"
- name: Install psycopg specific version ${{ matrix.psycopg-version }}
run: poetry run pip install ${{ matrix.psycopg-version }}
- name: Run Tests
run: |
poetry run pytest --cov="django_pgschemas" sandbox/tests
poetry run coverage lcov -o ./coverage/lcov.info
- name: Upload coverage to Coveralls in parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-py${{ matrix.python-version }}-Django${{ matrix.django-version }}-${{ matrix.psycopg-version }}
parallel: true
finish:
needs: django-tests
runs-on: ubuntu-latest
steps:
- name: Finish report to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true