fix action #15
Workflow file for this run
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 | |
on: | |
push: | |
branches: [master] | |
paths: | |
- "playwright/**" | |
pull_request: | |
paths: | |
- "playwright/**" | |
env: | |
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_PLAYWRIGHT }} | |
LAUNCHABLE_DEBUG: 1 | |
LAUNCHABLE_REPORT_ERROR: 1 | |
jobs: | |
tests: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
working-directory: playwright | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
browser: [chromium, firefox, webkit] | |
steps: | |
- uses: actions/checkout@v4 | |
# for setup launchable command | |
- uses: actions/setup-python@v5 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 8 | |
distribution: 'temurin' | |
- name: Install launchable CLI | |
run: | | |
pip install launchable | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Set up playwright | |
run: | | |
npm ci | |
npx playwright install --with-deps | |
- name: Record commits and build | |
run: 'launchable record build --name "$GITHUB_RUN_ID" --source ..' # care for working-directory path | |
- name: Subset | |
run: find tests/*.ts | launchable subset --confidence 80% --flavor browser=${{ matrix.browser }} playwright > launchable-subset.txt | |
- name: Run Playwright tests | |
run: npx playwright test --project=${{ matrix.browser }} $(cat launchable-subset.txt) | |
- name: Record | |
run: launchable record tests playwright report.xml | |
if: always() |