Skip to content

refactor: apply TypeScript best practices and Svelte 5 patterns #27

refactor: apply TypeScript best practices and Svelte 5 patterns

refactor: apply TypeScript best practices and Svelte 5 patterns #27

Workflow file for this run

name: Webapp CI/CD
on:
push:
branches: [main, mvp-webapp]
paths:
- 'webapp/**'
- '.github/workflows/ci.yml'
pull_request:
branches: [main, mvp-webapp]
paths:
- 'webapp/**'
- '.github/workflows/ci.yml'
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './webapp/package-lock.json'
- name: Install dependencies
working-directory: ./webapp
run: npm ci
- name: Run tests
working-directory: ./webapp
run: npm test
- name: Run tests with coverage
working-directory: ./webapp
run: npm run test:coverage
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: success()
with:
files: ./webapp/coverage/coverage-final.json
flags: webapp
fail_ci_if_error: false
build:
name: Build
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: './webapp/package-lock.json'
- name: Install dependencies
working-directory: ./webapp
run: npm ci
- name: Build application
working-directory: ./webapp
run: npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: webapp-build
path: ./webapp/build
retention-days: 7
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: './webapp/package-lock.json'
- name: Install dependencies
working-directory: ./webapp
run: npm ci
- name: Sync SvelteKit types
working-directory: ./webapp
run: npx svelte-kit sync
- name: Check Svelte & TypeScript
working-directory: ./webapp
run: npx svelte-check --threshold warning