2023-04-09 23:59:57 +08:00
|
|
|
name: E2E tests
|
2023-06-30 02:27:35 +08:00
|
|
|
on: [deployment_status]
|
|
|
|
|
2023-04-09 23:59:57 +08:00
|
|
|
jobs:
|
|
|
|
test:
|
2023-06-30 02:27:35 +08:00
|
|
|
if: github.event.deployment_status.state == 'success'
|
2023-04-09 23:59:57 +08:00
|
|
|
timeout-minutes: 60
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-30 02:27:35 +08:00
|
|
|
env:
|
|
|
|
BASE_URL: ${{ github.event.deployment_status.target_url }}
|
2023-06-10 22:46:52 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
shard: [1/3, 2/3, 3/3]
|
2023-04-09 23:59:57 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-06-30 00:48:51 +08:00
|
|
|
|
2023-04-09 23:59:57 +08:00
|
|
|
- run: corepack enable
|
2023-06-30 00:48:51 +08:00
|
|
|
|
2023-04-09 23:59:57 +08:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
cache: 'pnpm'
|
2023-06-30 00:48:51 +08:00
|
|
|
|
|
|
|
- name: Get Playwright version
|
|
|
|
id: playwright-version
|
|
|
|
run: echo "PLAYWRIGHT_VERSION=$(jq -r .dependencies.playwright package.json)" >> "$GITHUB_OUTPUT"
|
|
|
|
|
2023-04-09 23:59:57 +08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
2023-06-30 00:48:51 +08:00
|
|
|
|
|
|
|
- name: Restore Playwright browsers from cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.cache/ms-playwright
|
|
|
|
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-
|
|
|
|
${{ runner.os }}-playwright-
|
|
|
|
|
2023-04-09 23:59:57 +08:00
|
|
|
- name: Install Playwright Browsers
|
|
|
|
run: pnpm exec playwright install --with-deps
|
2023-06-30 00:48:51 +08:00
|
|
|
|
2023-04-09 23:59:57 +08:00
|
|
|
- name: Run Playwright tests
|
2023-06-10 22:46:52 +08:00
|
|
|
run: pnpm run test:e2e --shard=${{ matrix.shard }}
|