Akash-Dragon's picture
ci: set up GitHub Actions CI workflow and Vercel configuration
640ec2c
Raw
History Blame Contribute Delete
1.84 kB
name: CI
on:
push:
branches: [main, master, development]
pull_request:
branches: [main, master, development]
jobs:
test:
name: Lint, Format, and Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install Dependencies
run: |
npm install
npm install --prefix backend
npm install --prefix frontend
- name: Generate Prisma Client
run: npm run build
- name: Prettier Format Check
run: npm run format:check
- name: Run Monorepo Lint Checks
run: npm run lint
- name: Run Monorepo Test Suites
run: npm run test
lighthouse:
name: Lighthouse Accessibility Audit
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install Frontend Dependencies
run: npm install --prefix frontend
- name: Build Frontend
run: npm run build --prefix frontend
- name: Install Lighthouse CI
run: npm install -g @lhci/cli@0.14.x
- name: Run Lighthouse CI
run: |
lhci autorun \
--collect.staticDistDir=frontend/dist \
--assert.preset=lighthouse:no-pwa \
--assert.assertions.accessibility=error \
--assert.assertions."categories:accessibility"="['error', {'minScore': 1}]" \
--upload.target=temporary-public-storage
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}