gitbutler/.github/workflows/test-e2e.yml
2024-07-29 08:49:22 +00:00

43 lines
1.3 KiB
YAML

name: Playwright Tests
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
playwright:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/init-env-node
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./apps/desktop/package.json').devDependencies['@playwright/test'].substring(1))")" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm dlx "playwright@$PLAYWRIGHT_VERSION" install --with-deps chromium
- name: Run Tests
run: cd apps/desktop && pnpm test:e2e
env:
CI: true
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: apps/desktop/test-results/**/trace.zip
if-no-files-found: ignore
retention-days: 30