@@ -40,35 +40,37 @@ jobs:
40
40
python_version : " 3.10"
41
41
steps :
42
42
- uses : actions/checkout@v4
43
- - name : Check for MacOS Runner
44
- if : matrix.os == 'macos-latest-xlarge'
45
- run : brew install postgresql@14
46
- - name : Install pgvector on Windows using install-pgvector.bat
47
- if : matrix.os == 'windows-latest'
48
- shell : cmd
49
- run : .github\workflows\install-pgvector.bat
50
- - name : Setup postgres
43
+
44
+ - name : (MacOS) Install postgreSQL and pgvector using brew
45
+ if : matrix.os == 'macos-13'
46
+ run : |
47
+ brew install postgresql@14
48
+ brew link --overwrite postgresql@14
49
+ brew install pgvector
50
+ brew services start postgresql@17 && sleep 1
51
+ psql -d postgres -c 'CREATE EXTENSION vector'
52
+
53
+ - name : (MacOSLarge) Install postgreSQL using action-setup-postgres
51
54
if : matrix.os == 'macos-latest-xlarge'
52
55
uses : ikalnytskyi/action-setup-postgres@v6
53
56
with :
54
57
username : admin
55
58
password : postgres
56
59
database : postgres
57
60
58
- - name : Install pgvector
59
- if : matrix.os != 'windows-latest'
61
+ - name : (Windows) Install pgvector using install-pgvector.bat
62
+ if : matrix.os == 'windows-latest'
63
+ shell : cmd
64
+ run : .github\workflows\install-pgvector.bat
65
+
66
+ - name : (Linux) Install pgvector and set password
67
+ if : matrix.os == 'ubuntu-latest'
60
68
run : |
61
69
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
62
70
sudo apt-get install postgresql-14-pgvector
63
-
64
- - name : Start postgres
65
- run : sudo systemctl start postgresql
66
-
67
- - name : Set password for postgres user
68
- run : sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'root'"
69
-
70
- - name : Create vector extension
71
- run : sudo -u postgres psql -c 'CREATE EXTENSION vector'
71
+ sudo systemctl start postgresql
72
+ sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'root'"
73
+ sudo -u postgres psql -c 'CREATE EXTENSION vector'
72
74
73
75
- name : Setup python
74
76
uses : actions/setup-python@v5
@@ -79,36 +81,45 @@ jobs:
79
81
- name : Install dependencies
80
82
run : |
81
83
python -m pip install -r requirements-dev.txt
84
+
82
85
- name : Install app as editable app
83
86
run : |
84
87
python -m pip install -e src/backend
88
+
85
89
- name : Setup local database with seed data
86
90
run : |
87
91
python ./src/backend/fastapi_app/setup_postgres_database.py
88
92
python ./src/backend/fastapi_app/setup_postgres_seeddata.py
93
+
89
94
- name : Setup node
90
95
uses : actions/setup-node@v4
91
96
with :
92
97
node-version : 18
98
+
93
99
- name : Build frontend
94
100
run : |
95
101
cd ./src/frontend
96
102
npm install
97
103
npm run build
98
- - name : cache mypy
104
+
105
+ - name : Setup mypy cache
99
106
uses : actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
100
107
with :
101
108
path : ./.mypy_cache
102
109
key : mypy${{ matrix.os }}-${{ matrix.python_version }}-${{ hashFiles('requirements-dev.txt', 'src/backend/requirements.txt', 'src/backend/pyproject.toml') }}
110
+
103
111
- name : Run MyPy
104
112
run : python3 -m mypy .
113
+
105
114
- name : Run Pytest
106
115
run : python3 -m pytest -s -vv --cov --cov-fail-under=85
116
+
107
117
- name : Run E2E tests with Playwright
108
118
id : e2e
109
119
run : |
110
120
playwright install chromium --with-deps
111
121
python3 -m pytest tests/e2e.py --tracing=retain-on-failure
122
+
112
123
- name : Upload test artifacts
113
124
if : ${{ failure() && steps.e2e.conclusion == 'failure' }}
114
125
uses : actions/upload-artifact@v4
0 commit comments