Skip to content
Open
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
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Pull Request CI

on:
pull_request:
branches:
- main
workflow_dispatch:

permissions:
contents: read

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

jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Bun from packageManager
uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json

- name: Install locked dependencies
run: bun install --frozen-lockfile

- name: Check Svelte
run: bun run check

- name: Check TypeScript with tsgo
run: bun run typecheck:go

- name: Lint
run: bun run lint

- name: Check formatting
run: bun run format:check

- name: Unit tests
run: bun run test --run

- name: Build for GitHub Pages
env:
BASE_PATH: /dc-code-paste
run: bun run build

browser:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Bun from packageManager
uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json

- name: Install locked dependencies
run: bun install --frozen-lockfile

- name: Install Chromium and system dependencies
run: bunx --no-install playwright install --with-deps chromium

- name: Browser tests
run: bun run test:e2e

- name: Upload failure diagnostics
if: failure()
uses: actions/upload-artifact@v7
with:
name: playwright-failure-diagnostics
path: test-results/
if-no-files-found: ignore
retention-days: 7
14 changes: 9 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:

permissions:
contents: read
pages: write
id-token: write

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
Expand All @@ -21,17 +19,20 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version-file: package.json

- name: Install dependencies
run: bun install
run: bun install --frozen-lockfile

- name: Check Svelte
run: bun run check
Expand All @@ -46,7 +47,7 @@ jobs:
run: bun run format:check

- name: Test
run: bun run test
run: bun run test --run

- name: Build
env:
Expand All @@ -61,6 +62,9 @@ jobs:

deploy:
if: vars.ENABLE_PAGES_DEPLOY == 'true'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
3 changes: 3 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests/e2e",
fullyParallel: true,
forbidOnly: Boolean(process.env.CI),
retries: process.env.CI ? 1 : 0,
workers: process.env.CI ? 2 : undefined,
reporter: [["list"]],
use: {
baseURL: "http://127.0.0.1:4173",
Expand Down
Loading