Skip to content

Commit da8c216

Browse files
committed
fix/tests
1 parent e84dcc5 commit da8c216

4 files changed

Lines changed: 77 additions & 29 deletions

File tree

.env

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
# Postgres
2-
POSTGRES_USER=postgres
3-
POSTGRES_PASSWORD=postgres
4-
POSTGRES_DB=postgres
5-
6-
# Backend
7-
BACKEND_PORT=8000
8-
9-
# Auth
10-
AUTH_SECRET=change-this-to-a-long-random-string
11-
AUTH_EXPIRE_MINUTES=60
12-
13-
# DB
14-
DB_HOST=db
15-
DB_PORT=5432
16-
DB_NAME=app_db
17-
DB_USER=app_user
18-
DB_PASS=app_pass
19-
DATABASE_URL=postgresql+psycopg[binary]://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}
20-
211
# Frontend (Expo)
222
EXPO_TUNNEL=false
233
EXPO_DEVTOOLS_LISTEN_ADDRESS=0.0.0.0

.github/workflows/deploy-pages.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
- name: Build (expo export -p web)
3131
working-directory: frontend/app
3232
run: npx expo export -p web
33-
# dist/
3433
- name: Upload Pages artifact
3534
uses: actions/upload-pages-artifact@v3
3635
with:

.github/workflows/frontend.yml

Lines changed: 74 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,94 @@
1-
name: Frontend Unit Tests
1+
name: Frontend CI
2+
23
on:
34
push:
45
pull_request:
6+
7+
concurrency:
8+
group: frontend-ci-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
514
jobs:
615
test:
7-
name: Run Jest (React Native / Expo)
16+
name: Jest on Node ${{ matrix.node }}
817
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node: [18, 20] # LTS + current used in repo
22+
923
env:
1024
CI: "1"
11-
EXPO_PUBLIC_API_BASE: http://localhost:8000
1225
EXPO_TUNNEL: "false"
1326
EXPO_DEVTOOLS_LISTEN_ADDRESS: 0.0.0.0
27+
EXPO_PUBLIC_API_BASE: http://localhost:8000
28+
1429
steps:
1530
- name: Checkout
1631
uses: actions/checkout@v4
17-
- name: Use Node.js 20
32+
33+
- name: Use Node ${{ matrix.node }}
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: ${{ matrix.node }}
37+
cache: npm
38+
cache-dependency-path: frontend/app/package-lock.json
39+
40+
- name: Install deps
41+
working-directory: frontend/app
42+
run: npm ci
43+
44+
- name: Type check (skip if no TS)
45+
if: hashFiles('frontend/app/tsconfig.json') != ''
46+
working-directory: frontend/app
47+
run: |
48+
npx --yes typescript@latest -v >/dev/null 2>&1 || true
49+
npx tsc --noEmit || (echo "::warning::Type check failed"; exit 1)
50+
51+
- name: Run Jest with coverage (CI mode)
52+
working-directory: frontend/app
53+
run: npm test -- --ci --runInBand --coverage --verbose
54+
55+
- name: Upload coverage
56+
if: always()
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: coverage-node${{ matrix.node }}
60+
path: frontend/app/coverage
61+
if-no-files-found: warn
62+
63+
web-export-smoke:
64+
name: Expo web export (smoke)
65+
needs: test
66+
runs-on: ubuntu-latest
67+
env:
68+
CI: "1"
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
73+
- name: Use Node 20
1874
uses: actions/setup-node@v4
1975
with:
2076
node-version: 20
2177
cache: npm
22-
cache-dependency-path: |
23-
frontend/app/package-lock.json
24-
- name: Install dependencies
78+
cache-dependency-path: frontend/app/package-lock.json
79+
80+
- name: Install deps
2581
working-directory: frontend/app
2682
run: npm ci
2783

84+
- name: Build (expo export -p web)
85+
working-directory: frontend/app
86+
run: npx expo export -p web
87+
88+
- name: Upload dist (preview artifact)
89+
if: always()
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: expo-web-dist
93+
path: frontend/app/dist
94+
if-no-files-found: error

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
!["web_ui"](./assets/images/web_ui.png)
44

5-
**Demo**
5+
## Demo
66
[Python Front](https://europanite.github.io/python_front/))
77

8+
A browser based Python playground.
9+
810
---
911

1012
## 🚀 Getting Started

0 commit comments

Comments
 (0)