Skip to content
71 changes: 71 additions & 0 deletions .github/workflows/test_frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test Frontend

on:
push:
branches:
- main
paths:
- 'frontend/src/**'
- '.github/workflows/test_frontend.yaml'
pull_request:
branches:
- main
paths:
- 'frontend/src/**'
- '.github/workflows/test_frontend.yaml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
frontend_tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install dependencies
run: npm ci

# TODO: Disabled until `test:integration` is ran
# - name: Install playwright browsers
# run: npx playwright install --with-deps

- name: Run svelte-check (svelte errors, type errors)
run: npm run check

- name: Lint project (prettier format and eslint)
run: npm run lint

# TODO: Disabled until API is setup
# - name: Run unit tests (vitest)
# run: npm run test:unit
# env:
# CI: true

# TODO: Disabled until API is setup
# - name: Run integration tests (playwright)
# run: npm run test:integration
# env:
# CI: true

# TODO: Disabled until `test:integration` is ran
# - name: Upload playwright report
# uses: actions/upload-artifact@v4
# if: ${{ !cancelled() }}
# with:
# name: playwright-report
# path: playwright-report/
# retention-days: 30

- name: Build project
run: npm run build
10 changes: 10 additions & 0 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
package-lock.json
pnpm-lock.yaml
yarn.lock

# SvelteKit build
.svelte-kit
build

# Playwright test results
test-results

# Thift types
src/lib/types/codegen
Loading