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

53 lines
1.6 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-05-05 19:51:14 +03:00
- uses: pnpm/action-setup@v3
with:
version: 8
2024-05-02 15:55:41 +03:00
- uses: actions/setup-node@v4
with:
2024-05-05 19:51:14 +03:00
node-version: lts/*
2024-05-02 15:55:41 +03:00
cache: "pnpm"
2024-05-05 19:51:14 +03:00
cache-dependency-path: |
pnpm-lock.yaml
2024-05-02 15:55:41 +03:00
- name: Install dependencies
run: pnpm install
2024-05-05 21:10:18 +03:00
- name: Get installed Playwright version
id: playwright-version
2024-05-05 21:14:55 +03:00
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./app/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
2024-05-05 19:51:14 +03:00
run: cd app && 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
2024-05-05 21:10:18 +03:00
path: app/test-results/**/trace.zip
if-no-files-found: ignore
2024-05-02 15:55:41 +03:00
retention-days: 30