-
Notifications
You must be signed in to change notification settings - Fork 962
102 lines (99 loc) · 3.4 KB
/
app-tests.yaml
File metadata and controls
102 lines (99 loc) · 3.4 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: App Tests
on:
push:
branches: [ main ]
paths-ignore:
- "**.md"
- ".azdo/**"
- ".devcontainer/**"
- ".github/**"
pull_request:
branches: [ main ]
paths-ignore:
- "**.md"
- ".azdo/**"
- ".devcontainer/**"
- ".github/**"
workflow_dispatch:
permissions:
contents: read
jobs:
test-package:
name: Test ${{ matrix.os }} Python ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest-xlarge", "macos-13"]
python_version: ["3.10", "3.11", "3.12"]
exclude:
- os: macos-latest-xlarge
python_version: "3.10"
steps:
- uses: actions/checkout@v4
- name: Check for MacOS Runner
if: matrix.os == 'macos-latest-xlarge'
run: brew install postgresql@14
- name: Install pgvector on Windows using install-pgvector.bat
if: matrix.os == 'windows-latest'
shell: cmd
run: .github\workflows\install-pgvector.bat
- name: Install PostgreSQL development libraries
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install postgresql-server-dev-14
- name: Setup postgres
uses: ikalnytskyi/action-setup-postgres@v6
with:
username: admin
password: postgres
database: postgres
- name: Install pgvector on MacOS/Linux using install-pgvector.sh
if: matrix.os != 'windows-latest'
run: .github/workflows/install-pgvector.sh
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Install dependencies
run: |
python -m pip install -r requirements-dev.txt
- name: Install app as editable app
run: |
python -m pip install -e src/backend
- name: Setup local database with seed data
run: |
cp .env.sample .env
python ./src/backend/fastapi_app/setup_postgres_database.py
python ./src/backend/fastapi_app/setup_postgres_seeddata.py
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Build frontend
run: |
cd ./src/frontend
npm install
npm run build
- name: cache mypy
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: ./.mypy_cache
key: mypy${{ matrix.os }}-${{ matrix.python_version }}-${{ hashFiles('requirements-dev.txt', 'src/backend/requirements.txt', 'src/backend/pyproject.toml') }}
- name: Run MyPy
run: python3 -m mypy .
- name: Run Pytest
run: python3 -m pytest -s -vv --cov --cov-fail-under=85
- name: Run E2E tests with Playwright
id: e2e
run: |
playwright install chromium --with-deps
python3 -m pytest tests/e2e.py --tracing=retain-on-failure
- name: Upload test artifacts
if: ${{ failure() && steps.e2e.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: playwright-traces${{ matrix.python_version }}
path: test-results