Adjusted the parallel test limit on CI from 1 to 2 in playwright configuration and updated the test script to stop after the first failure. These changes will allow CI to run tests more efficiently and stop running further tests when a failure is encountered.
99 lines
2.5 KiB
YAML
99 lines
2.5 KiB
YAML
name: Workflow
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
jobs:
|
|
typescript:
|
|
timeout-minutes: 8
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 8
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'pnpm'
|
|
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: .turbo
|
|
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-turbo-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
- name: Typecheck
|
|
run: pnpm run typecheck
|
|
- name: Lint
|
|
run: pnpm run lint
|
|
|
|
test:
|
|
timeout-minutes: 8
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 8
|
|
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: .turbo
|
|
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-turbo-
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Store Playwright's Version
|
|
run: |
|
|
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --filter web-e2e | grep @playwright | sed 's/.*@//')
|
|
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
|
|
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
|
|
|
|
- name: Cache Playwright Browsers for Playwright's Version
|
|
id: cache-playwright-browsers
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/ms-playwright
|
|
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
|
|
|
|
- name: Install Playwright Browsers
|
|
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
|
run: pnpm exec ./apps/e2e/node_modules/.bin/playwright install --with-deps
|
|
|
|
- name: Supabase CLI
|
|
uses: supabase/setup-cli@v1
|
|
|
|
- name: Supabase Server
|
|
run: pnpm run supabase:web:start -- -x studio,migra,deno-relay,pgadmin-schema-diff,imgproxy,logflare
|
|
|
|
- name: Run App
|
|
run: pnpm run dev &
|
|
|
|
- name: Run Playwright tests
|
|
run: pnpm run test
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 7 |