Skip to content

Commit 5fbb60b

Browse files
committed
OSes
1 parent 5f09487 commit 5fbb60b

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

.github/workflows/app-tests.yaml

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,37 @@ jobs:
4040
python_version: "3.10"
4141
steps:
4242
- 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
5154
if: matrix.os == 'macos-latest-xlarge'
5255
uses: ikalnytskyi/action-setup-postgres@v6
5356
with:
5457
username: admin
5558
password: postgres
5659
database: postgres
5760

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'
6068
run: |
6169
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
6270
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'
7274
7375
- name: Setup python
7476
uses: actions/setup-python@v5
@@ -79,36 +81,45 @@ jobs:
7981
- name: Install dependencies
8082
run: |
8183
python -m pip install -r requirements-dev.txt
84+
8285
- name: Install app as editable app
8386
run: |
8487
python -m pip install -e src/backend
88+
8589
- name: Setup local database with seed data
8690
run: |
8791
python ./src/backend/fastapi_app/setup_postgres_database.py
8892
python ./src/backend/fastapi_app/setup_postgres_seeddata.py
93+
8994
- name: Setup node
9095
uses: actions/setup-node@v4
9196
with:
9297
node-version: 18
98+
9399
- name: Build frontend
94100
run: |
95101
cd ./src/frontend
96102
npm install
97103
npm run build
98-
- name: cache mypy
104+
105+
- name: Setup mypy cache
99106
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
100107
with:
101108
path: ./.mypy_cache
102109
key: mypy${{ matrix.os }}-${{ matrix.python_version }}-${{ hashFiles('requirements-dev.txt', 'src/backend/requirements.txt', 'src/backend/pyproject.toml') }}
110+
103111
- name: Run MyPy
104112
run: python3 -m mypy .
113+
105114
- name: Run Pytest
106115
run: python3 -m pytest -s -vv --cov --cov-fail-under=85
116+
107117
- name: Run E2E tests with Playwright
108118
id: e2e
109119
run: |
110120
playwright install chromium --with-deps
111121
python3 -m pytest tests/e2e.py --tracing=retain-on-failure
122+
112123
- name: Upload test artifacts
113124
if: ${{ failure() && steps.e2e.conclusion == 'failure' }}
114125
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)