Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add basic ci config #1

Merged
merged 6 commits into from
May 21, 2024
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

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

- name: Install playwright browsers
run: npx playwright install chromium

- name: Run E2E test
run: pnpm test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
1 change: 0 additions & 1 deletion tests/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test.describe('basic test', () => {

test('local server works', async ({ page }) => {
await page.goto('http://localhost:5173');

const title = await page.title();
expect(title).toBe('Note App');
});
Expand Down
2 changes: 2 additions & 0 deletions tests/runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export class AppRunner {
}

async stop() {
if (process.env.CI) return;

await Promise.all([
this._terminateProcess(this.serverProcess, 'server'),
this._terminateProcess(this.webProcess, 'web'),
Expand Down
Loading