Skip to content

Commit b5ed6b5

Browse files
test: add backend and frontend tests with CI/CD pipeline
1 parent 62cc317 commit b5ed6b5

17 files changed

Lines changed: 2056 additions & 34 deletions

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Frontend CI/CD
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test-backend:
11+
name: test backend
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.12"]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v6
20+
with:
21+
version: "0.9.26"
22+
python-version: ${{ matrix.python-version }}
23+
enable-cache: true
24+
- name: Install the project
25+
run: uv sync --locked --dev
26+
- name: Run backend tests
27+
run: uv run pytest
28+
29+
test-and-deploy-frontend:
30+
runs-on: ubuntu-latest
31+
needs: test-backend
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Set up Node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: "20"
38+
cache: "npm"
39+
cache-dependency-path: frontend/package-lock.json
40+
- name: Install dependencies
41+
run: cd frontend && npm install
42+
- name: Run frontend tests
43+
run: cd frontend && npm test
44+
- name: Build frontend
45+
run: cd frontend && npm run build
46+
- name: Deploy to Cloudflare Pages
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
48+
uses: cloudflare/wrangler-action@v3
49+
with:
50+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
51+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
52+
command: pages deploy frontend/dist --project-name=temoa-web-gui

assets/logo.svg

Lines changed: 51 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)