Skip to content

Commit ffd1abe

Browse files
authored
Merge pull request #19 from europanite/feature/tests
Feature/tests
2 parents 210a950 + c560771 commit ffd1abe

4 files changed

Lines changed: 8 additions & 20 deletions

File tree

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,53 @@
1-
name: Frontend CI
2-
1+
name: CI
32
on:
43
push:
54
pull_request:
6-
75
concurrency:
86
group: frontend-ci-${{ github.ref }}
97
cancel-in-progress: true
10-
118
permissions:
129
contents: read
13-
1410
jobs:
1511
test:
1612
name: Jest on Node ${{ matrix.node }}
1713
runs-on: ubuntu-latest
1814
strategy:
1915
fail-fast: false
2016
matrix:
21-
node: [18, 20] # LTS + current used in repo
22-
17+
node: [18, 20, 22]
2318
env:
2419
CI: "1"
2520
EXPO_TUNNEL: "false"
2621
EXPO_DEVTOOLS_LISTEN_ADDRESS: 0.0.0.0
2722
EXPO_PUBLIC_API_BASE: http://localhost:8000
28-
2923
steps:
3024
- name: Checkout
3125
uses: actions/checkout@v4
32-
3326
- name: Use Node ${{ matrix.node }}
3427
uses: actions/setup-node@v4
3528
with:
3629
node-version: ${{ matrix.node }}
3730
cache: npm
3831
cache-dependency-path: frontend/app/package-lock.json
39-
4032
- name: Install deps
4133
working-directory: frontend/app
4234
run: npm ci
43-
4435
- name: Type check (skip if no TS)
4536
if: hashFiles('frontend/app/tsconfig.json') != ''
4637
working-directory: frontend/app
4738
run: |
4839
npx --yes typescript@latest -v >/dev/null 2>&1 || true
4940
npx tsc --noEmit || (echo "::warning::Type check failed"; exit 1)
50-
5141
- name: Run Jest with coverage (CI mode)
5242
working-directory: frontend/app
5343
run: npm test -- --ci --runInBand --coverage --verbose
54-
5544
- name: Upload coverage
5645
if: always()
5746
uses: actions/upload-artifact@v4
5847
with:
5948
name: coverage-node${{ matrix.node }}
6049
path: frontend/app/coverage
6150
if-no-files-found: warn
62-
6351
web-export-smoke:
6452
name: Expo web export (smoke)
6553
needs: test
@@ -69,22 +57,18 @@ jobs:
6957
steps:
7058
- name: Checkout
7159
uses: actions/checkout@v4
72-
7360
- name: Use Node 20
7461
uses: actions/setup-node@v4
7562
with:
7663
node-version: 20
7764
cache: npm
7865
cache-dependency-path: frontend/app/package-lock.json
79-
8066
- name: Install deps
8167
working-directory: frontend/app
8268
run: npm ci
83-
8469
- name: Build (expo export -p web)
8570
working-directory: frontend/app
8671
run: npx expo export -p web
87-
8872
- name: Upload dist (preview artifact)
8973
if: always()
9074
uses: actions/upload-artifact@v4

.github/workflows/deploy-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Expo Web to GitHub Pages
1+
name: GitHub Pages
22
on:
33
push:
44
branches: [ "main" ]

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Frontend Tests via Docker
1+
name: docker
22
on:
33
workflow_dispatch:
44
pull_request:

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# [Python Front](https://github.com/europanite/python_front "Python Front")
22

3+
[![CI](https://github.com/europanite/python_front/actions/workflows/ci.yml/badge.svg)](https://github.com/europanite/python_front/actions/workflows/ci.yml)
4+
[![Frontend Tests via Docker](https://github.com/europanite/python_front/actions/workflows/docker.yml/badge.svg)](https://github.com/europanite/python_front/actions/workflows/docker.yml)
5+
[![Deploy Expo Web to GitHub Pages](https://github.com/europanite/python_front/actions/workflows/deploy-pages.yml/badge.svg)](https://github.com/europanite/python_front/actions/workflows/deploy-pages.yml)
6+
37
A browser based Python playground.
48

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

0 commit comments

Comments
 (0)