mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-01-08 00:20:43 +08:00
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
name: E2E tests
|
|
on: [deployment_status]
|
|
|
|
jobs:
|
|
test:
|
|
if: github.event.deployment_status.state == 'success'
|
|
timeout-minutes: 60
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BASE_URL: ${{ github.event.deployment_status.target_url }}
|
|
strategy:
|
|
matrix:
|
|
shard: [1/3, 2/3, 3/3]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- run: corepack enable
|
|
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
cache: 'pnpm'
|
|
|
|
- name: Get Playwright version
|
|
id: playwright-version
|
|
run: echo "PLAYWRIGHT_VERSION=$(jq -r .dependencies.playwright package.json)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- 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-
|
|
|
|
- name: Install Playwright Browsers
|
|
run: pnpm exec playwright install --with-deps
|
|
|
|
- name: Run Playwright tests
|
|
run: pnpm run test:e2e --shard=${{ matrix.shard }}
|