First commit - base framework #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Playwright Tests | |
on: | |
push: | |
branches: [main, master] | |
pull_request: | |
branches: [main, master] | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
shard: [1/4, 2/4, 3/4, 4/4] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Run Headless Playwright tests | |
uses: coactions/setup-xvfb@v1 | |
with: | |
run: npx playwright test --shard ${{matrix.shard}} | |
continue-on-error: true | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: blob-report | |
path: blob-report/ | |
retention-days: 1 | |
merge-reports: | |
if: always() | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: npm ci | |
- name: Download blob reports from GitHub Actions Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: blob-report | |
path: blob-report | |
- name: Merge into HTML REports | |
run: npx playwright merge-reports --reporter html ./blob-report | |
- name: Upload HTML Report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html-report-attempt-${{github.run_attempt}} | |
path: playwright-report | |
retention-days: 14 |