gitbutler/.github/workflows/test-e2e.yml

43 lines
1.3 KiB
YAML
Raw Normal View History

2024-05-02 15:55:41 +03:00
name: Playwright Tests
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
2024-05-02 15:55:41 +03:00
push:
branches: [master]
pull_request:
branches: [master]
jobs:
playwright:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-07-29 11:49:22 +03:00
- uses: ./.github/actions/init-env-node
2024-05-05 21:10:18 +03:00
- 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
2024-05-05 21:10:18 +03:00
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
2024-05-02 15:55:41 +03:00
- name: Install Playwright Browsers
2024-05-05 21:10:18 +03:00
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm dlx "playwright@$PLAYWRIGHT_VERSION" install --with-deps chromium
2024-05-05 20:41:28 +03:00
- name: Run Tests
run: cd apps/desktop && pnpm test:e2e
2024-05-02 15:55:41 +03:00
env:
CI: true
2024-05-05 20:41:28 +03:00
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
2024-05-02 15:55:41 +03:00
with:
name: playwright-report
path: apps/desktop/test-results/**/trace.zip
if-no-files-found: ignore
2024-05-02 15:55:41 +03:00
retention-days: 30