Skip to content

Commit

Permalink
simplify setup
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundhung committed Jan 15, 2025
1 parent aef271c commit 2b21073
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 36 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ on:
- 'examples/**'
- 'guide/**'
jobs:
browser:
name: Browser Tests
e2e:
name: E2E Tests
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -46,8 +46,6 @@ jobs:
run: pnpm i
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps ${{ matrix.browser }}
- name: Run Vitest tests
run: pnpm exec vitest --project=${{ matrix.browser }}
- name: Run Playwright tests
run: pnpm exec playwright test --project=${{ matrix.browser }}
- name: Upload report to GitHub Actions Artifacts
Expand All @@ -57,14 +55,9 @@ jobs:
name: playwright-report-${{ matrix.os }}-node${{ matrix.node }}-${{ matrix.browser }}
path: test-results/
retention-days: 14
node:
name: Node tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
node: [18, 20, 22]
unit:
name: API Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -73,10 +66,12 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm i
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps chromium
- name: Run Vitest tests
run: pnpm exec vitest --project=node
- name: Run Typecheck
Expand Down
24 changes: 1 addition & 23 deletions vitest.workspace.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineWorkspace } from 'vitest/config';
export default defineWorkspace([
{
test: {
name: 'chromium',
name: 'browser',
browser: {
enabled: true,
provider: 'playwright',
Expand All @@ -12,28 +12,6 @@ export default defineWorkspace([
include: ['tests/*.spec.ts'],
},
},
{
test: {
name: 'firefox',
browser: {
enabled: true,
provider: 'playwright',
name: 'firefox',
},
include: ['tests/*.spec.ts'],
},
},
{
test: {
name: 'webkit',
browser: {
enabled: true,
provider: 'playwright',
name: 'webkit',
},
include: ['tests/*.spec.ts'],
},
},
{
test: {
name: 'node',
Expand Down

0 comments on commit 2b21073

Please # to comment.