Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Deploy SvelteKit to GitHub Pages

on:
workflow_dispatch: # allows manual trigger
push:
branches: [main]

permissions:
contents: read
Expand All @@ -21,9 +22,19 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm # cache node_modules for faster builds

- name: Install dependencies
run: npm i
run: npm ci # install dependencies using lock file

- name: Security audit
run: npm audit --audit-level=high # low and moderate vulnerabilities wont fail CI

- name: Install Playwright browsers for e2e tests
run: npx playwright install --with-deps

- name: Run tests
run: npm test

# Build the SvelteKit project
- name: Build project
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ There is a variety of reusable components in `./src/lib/components/*.svelte`

There are automated tests using Playwright.

- run this the first time, to install Playwright dependencies: `npx playwright install`
- `npm run test` to run tests
Don't run local stack (`npm run dev`), the test runner will start a dev server.

- **first time only** install Playwright dependencies: `npx playwright install`
- `npm run test`


## Production build
Expand Down
33 changes: 26 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { defineConfig } from '@playwright/test';

export default defineConfig({
// webServer: {
// command: 'npm run build && npm run preview',
// port: 4173
// },
webServer: {
command: 'npm run build && npm run preview',
port: 4173,
reuseExistingServer: false
},
use: {
baseURL: "http://localhost:5173"
baseURL: 'http://localhost:4173'
},
testDir: 'e2e'
});