Skip to content

wip

wip #7

Workflow file for this run

name: E2E Testing
on:
pull_request:
branches:
- main
workflow_dispatch:
push:
branches:
- main
- dev
jobs:
# testing:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: "npm"
# - name: Install dependencies
# run: npm ci
# - name: Store Playwright's Version
# run: |
# PLAYWRIGHT_VERSION=$(npm ls @playwright/test --depth=0 | grep @playwright | sed 's/.*@//')
# echo "Playwright's Version: $PLAYWRIGHT_VERSION"
# echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
# - name: Cache Playwright Browsers for Playwright's Version
# id: cache-playwright-browsers
# uses: actions/cache@v4
# with:
# path: ~/.cache/ms-playwright
# key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
# - name: Install Playwright Browsers
# if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
# run: npx playwright install --with-deps chromium
# - name: Run Playwright tests
# run: npx playwright test
# continue-on-error: true
testing-matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2]
shardTotal: [2]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(npm ls @playwright/test --depth=0 | grep @playwright | sed 's/.*@//')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright Browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
continue-on-error: true
- name: Upload summary artifact
uses: actions/upload-artifact@v2
with:
name: playwright-summary-${{ matrix.shardIndex }}
path: playwright-summary-${{ matrix.shardIndex }}.md
e2e-report:
runs-on: ubuntu-latest
needs: [testing-matrix]
steps:
- name: Download all summaries
uses: actions/download-artifact@v4
with:
name: playwright-summary-*
path: combined-summaries
- name: Combine summaries
run: |
cat combined-summaries/playwright-summary-shard-*.md > combined-summaries/combined-summary.md
- name: Post combined summary to GitHub
run: |
cat combined-summaries/combined-summary.md >> $GITHUB_STEP_SUMMARY