mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-05 05:47:10 -04:00
48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
name: E2E tests
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
test:
|
|
timeout-minutes: 10
|
|
runs-on: ubuntu-latest
|
|
# runs-on: self-hosted
|
|
strategy:
|
|
matrix:
|
|
shard: [1/3, 2/3, 3/3]
|
|
steps:
|
|
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
|
|
|
- run: corepack enable
|
|
|
|
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
|
|
with:
|
|
node-version: 20
|
|
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 --no-frozen-lockfile
|
|
|
|
- name: Build app
|
|
run: pnpm build
|
|
|
|
- name: Restore Playwright browsers from cache
|
|
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
|
|
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 }}
|