Spaces:
Runtime error
Runtime error
Commit ·
640ec2c
1
Parent(s): e9c33ac
ci: set up GitHub Actions CI workflow and Vercel configuration
Browse files- .github/workflows/test.yml +75 -0
- vercel.json +21 -0
.github/workflows/test.yml
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [main, master, development]
|
| 6 |
+
pull_request:
|
| 7 |
+
branches: [main, master, development]
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
test:
|
| 11 |
+
name: Lint, Format, and Test
|
| 12 |
+
runs-on: ubuntu-latest
|
| 13 |
+
|
| 14 |
+
steps:
|
| 15 |
+
- name: Checkout Repository
|
| 16 |
+
uses: actions/checkout@v4
|
| 17 |
+
|
| 18 |
+
- name: Setup Node.js
|
| 19 |
+
uses: actions/setup-node@v4
|
| 20 |
+
with:
|
| 21 |
+
node-version: '20'
|
| 22 |
+
cache: 'npm'
|
| 23 |
+
|
| 24 |
+
- name: Install Dependencies
|
| 25 |
+
run: |
|
| 26 |
+
npm install
|
| 27 |
+
npm install --prefix backend
|
| 28 |
+
npm install --prefix frontend
|
| 29 |
+
|
| 30 |
+
- name: Generate Prisma Client
|
| 31 |
+
run: npm run build
|
| 32 |
+
|
| 33 |
+
- name: Prettier Format Check
|
| 34 |
+
run: npm run format:check
|
| 35 |
+
|
| 36 |
+
- name: Run Monorepo Lint Checks
|
| 37 |
+
run: npm run lint
|
| 38 |
+
|
| 39 |
+
- name: Run Monorepo Test Suites
|
| 40 |
+
run: npm run test
|
| 41 |
+
|
| 42 |
+
lighthouse:
|
| 43 |
+
name: Lighthouse Accessibility Audit
|
| 44 |
+
runs-on: ubuntu-latest
|
| 45 |
+
needs: test
|
| 46 |
+
|
| 47 |
+
steps:
|
| 48 |
+
- name: Checkout Repository
|
| 49 |
+
uses: actions/checkout@v4
|
| 50 |
+
|
| 51 |
+
- name: Setup Node.js
|
| 52 |
+
uses: actions/setup-node@v4
|
| 53 |
+
with:
|
| 54 |
+
node-version: '20'
|
| 55 |
+
cache: 'npm'
|
| 56 |
+
|
| 57 |
+
- name: Install Frontend Dependencies
|
| 58 |
+
run: npm install --prefix frontend
|
| 59 |
+
|
| 60 |
+
- name: Build Frontend
|
| 61 |
+
run: npm run build --prefix frontend
|
| 62 |
+
|
| 63 |
+
- name: Install Lighthouse CI
|
| 64 |
+
run: npm install -g @lhci/cli@0.14.x
|
| 65 |
+
|
| 66 |
+
- name: Run Lighthouse CI
|
| 67 |
+
run: |
|
| 68 |
+
lhci autorun \
|
| 69 |
+
--collect.staticDistDir=frontend/dist \
|
| 70 |
+
--assert.preset=lighthouse:no-pwa \
|
| 71 |
+
--assert.assertions.accessibility=error \
|
| 72 |
+
--assert.assertions."categories:accessibility"="['error', {'minScore': 1}]" \
|
| 73 |
+
--upload.target=temporary-public-storage
|
| 74 |
+
env:
|
| 75 |
+
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
vercel.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 2,
|
| 3 |
+
"builds": [
|
| 4 |
+
{
|
| 5 |
+
"src": "frontend/package.json",
|
| 6 |
+
"use": "@vercel/static-build",
|
| 7 |
+
"config": {
|
| 8 |
+
"distDir": "dist"
|
| 9 |
+
}
|
| 10 |
+
}
|
| 11 |
+
],
|
| 12 |
+
"routes": [
|
| 13 |
+
{
|
| 14 |
+
"handle": "filesystem"
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"src": "/(.*)",
|
| 18 |
+
"dest": "/index.html"
|
| 19 |
+
}
|
| 20 |
+
]
|
| 21 |
+
}
|