-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (65 loc) · 2.08 KB
/
tests.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
64
65
66
67
68
69
name: Run Python E2E tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test_package:
name: Test ${{ matrix.os }} Python ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-13", "macos-latest-xlarge", "windows-latest"]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-latest-xlarge
python_version: 3.8
- os: macos-latest-xlarge
python_version: 3.9
- os: macos-latest-xlarge
python_version: "3.10"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for MacOS Runner
if: matrix.os == 'macos-latest-xlarge'
run: brew install postgresql@14
- name: Setup postgres
uses: ikalnytskyi/action-setup-postgres@v6
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
playwright install chromium --with-deps
python3 -m pip install -e src
- name: Seed data
run: |
python3 src/fastapi_app/seed_data.py
env:
POSTGRES_HOST: localhost
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres
- name: Run tests Windows
if: runner.os == 'windows'
run: python3 -m pytest --ignore=src/tests/local/test_gunicorn.py
env:
POSTGRES_HOST: localhost
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres
- name: Run tests
if: runner.os != 'windows'
run: python3 -m pytest
env:
POSTGRES_HOST: localhost
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres