-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (50 loc) · 1.85 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
name: Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
name: Python ${{ matrix.python-version }} sample
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', 'pypy-3.9']
continue-on-error: true
services:
database:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DJANGO_DATABASE_HOST: localhost
DJANGO_DATABASE_USER: postgres
DJANGO_DATABASE_PASSWORD: postgres
DJANGO_DATABASE_NAME: postgres
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install python dependencies
run: |
poetry install --sync --no-interaction --no-root --with test
poetry run pip install -e .
- name: Run tests
run: |
poetry run pytest -v -x tests/
# - name: Upload pytest test results
# uses: actions/upload-artifact@v2
# with:
# name: pytest-results-${{ matrix.python-version }}
# path: junit/test-results-${{ matrix.python-version }}.xml
# if: ${{ always() }}