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
46 changes: 46 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PR Checks

on:
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
env:
PUBLIC_API_URL: https://stg.api.sunnypilot.ai/
PUBLIC_LOGTO_ENDPOINT: https://logto.sunnypilot.ai/
PUBLIC_LOGTO_APP_ID: 6mjzxmevkp3ly5c6asvu8
PUBLIC_CALLBACK: https://new.sunnypilot.ai/auth/callback
PUBLIC_REDIRECT: https://new.sunnypilot.ai/
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.0
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

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

- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps

- name: Run Playwright tests
run: pnpm test

- name: Comment PR with images
if: always()
uses: opengisch/comment-pr-with-images@upload_only
with:
images: "test-results/**/*.png, test-results/**/*.jpeg, test-results/**/*.gif"
github_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { sveltekit } from '@sveltejs/kit/vite';
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
test: {
setupFiles: ['./vitest.setup.ts'],
expect: { requireAssertions: true },
projects: [
{
Expand Down
6 changes: 6 additions & 0 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { vi } from 'vitest';

vi.mock('$env/static/public', () => ({
PUBLIC_LOGTO_ENDPOINT: 'https://logto.sunnypilot.ai/',
PUBLIC_LOGTO_APP_ID: '6mjzxmevkp3ly5c6asvu8',
}));