chore(deps): Bump wpt from 9394d47
to 8d6df04
#2787
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
# This workflow will check out wpt and run the WebDriver BiDi tests against our | |
# implementation sharded without generating report or updating expectations. | |
name: WPT quick | |
# Declare default permissions as read only. | |
permissions: read-all | |
env: | |
DEBUG: 'bidi:server:*,bidi:mapper:*' | |
DEBUG_DEPTH: 10 | |
FORCE_COLOR: 3 | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
on: | |
merge_group: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
tests: | |
description: Tests to run (e.g. 'network/combined/') | |
required: false | |
type: string | |
verbose: | |
description: Verbose logging | |
default: false | |
required: false | |
type: boolean | |
auto-commit: | |
description: Auto-commit expectations | |
default: false | |
required: false | |
type: boolean | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
wpt-required: | |
name: '[Required] WPT sink' | |
needs: [wpt] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- if: ${{ needs.wpt.result != 'success' }} | |
run: 'exit 1' | |
- run: 'exit 0' | |
wpt: | |
name: ${{ matrix.this_chunk }}/${{ matrix.total_chunks }} ${{ matrix.kind }}-${{ matrix.head }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# Should be in sync with `update_expectations` job. | |
kind: [chromedriver, mapper] | |
head: [headless, headful] | |
total_chunks: [6] | |
this_chunk: [1, 2, 3, 4, 5, 6] | |
exclude: | |
# Don't run headful mapper, as it takes too long. | |
- kind: mapper | |
head: headful | |
steps: | |
- name: Checkout | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
submodules: true | |
- name: Set up Node.js | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- uses: google/wireit@4aad131006ea85c1e42af927534ebb13426dd730 # setup-github-actions-caching/v1.0.2 | |
- name: Install and build npm dependencies | |
run: npm ci | |
- name: Setup dirs | |
run: mkdir -p out | |
- name: Set up Python | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Set up virtualenv | |
run: pip install virtualenv | |
- name: Set up hosts | |
run: ./wpt make-hosts-file | sudo tee -a /etc/hosts | |
working-directory: wpt | |
- name: Setup cache for browser binaries | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.cache/chromium-bidi | |
key: ${{ runner.os }}-browsers-${{ hashFiles('.browser') }}) }} | |
- name: Install pinned browser | |
id: browser | |
run: node tools/install-browser.mjs --github | |
- name: Run WPT tests | |
timeout-minutes: 60 | |
run: > | |
xvfb-run --auto-servernum | |
npm run wpt -- "webdriver/tests/bidi/${{ github.event.inputs.tests }}" | |
env: | |
BROWSER_BIN: ${{ steps.browser.outputs.executablePath }} | |
CHROMEDRIVER: ${{ matrix.kind == 'chromedriver' }} | |
HEADLESS: ${{ matrix.head!='headful' }} | |
THIS_CHUNK: ${{ matrix.this_chunk }} | |
TOTAL_CHUNKS: ${{ matrix.total_chunks }} | |
UPDATE_EXPECTATIONS: false | |
VERBOSE: ${{ github.event.inputs.verbose }} | |
WPT_REPORT: out/wptreport.${{ matrix.kind }}-${{ matrix.head }}-${{ matrix.this_chunk }}.${{ matrix.total_chunks }}.json | |
- name: Run WPT interop tests | |
if: ${{matrix.kind == 'chromedriver'}} | |
run: > | |
xvfb-run --auto-servernum | |
npm run wpt -- "webdriver/tests/bidi/${{ github.event.inputs.tests }}" | |
env: | |
BROWSER_BIN: ${{ steps.browser.outputs.executablePath }} | |
CHROMEDRIVER: ${{ matrix.kind == 'chromedriver' }} | |
HEADLESS: ${{ matrix.head!='headful' }} | |
THIS_CHUNK: ${{ matrix.this_chunk }} | |
TOTAL_CHUNKS: ${{ matrix.total_chunks }} | |
UPDATE_EXPECTATIONS: false | |
VERBOSE: ${{ github.event.inputs.verbose }} | |
WPT_REPORT: out/wptreport-interop.${{ matrix.kind }}-${{ matrix.head }}-${{ matrix.this_chunk }}.${{ matrix.total_chunks }}.json | |
- name: Upload artifacts | |
if: always() | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: ${{ matrix.kind }}-${{ matrix.head }}-${{ matrix.this_chunk }}.${{ matrix.total_chunks }}-artifacts | |
path: | | |
logs | |
out | |
update_expectations: | |
# The job gets all the sharded reports for a given configuration and updates the | |
# expectations for the configuration. It uploads the results to the artifacts. | |
name: Update WPT expectations (if required) | |
strategy: | |
matrix: | |
# Should be in sync with `wpt` job. | |
kind: [chromedriver, mapper] | |
head: [headless, headful] | |
exclude: | |
# Don't run headful mapper, as it takes too long. | |
- kind: mapper | |
head: headful | |
runs-on: ubuntu-latest | |
needs: [wpt] | |
# Only update expectations if the tests were failed and either `auto-commit` | |
# checkbox is set or `update-expectations` label is present. | |
if: ${{ failure() && (github.event.inputs.auto-commit == 'true' || contains(github.event.pull_request.labels.*.name, 'update-expectations')) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
submodules: true | |
- name: Set up Node.js | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- uses: google/wireit@4aad131006ea85c1e42af927534ebb13426dd730 # setup-github-actions-caching/v1.0.2 | |
- name: Install and build npm dependencies | |
run: npm ci | |
- name: Setup dirs | |
run: mkdir -p out | |
- name: Set up Python | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Set up virtualenv | |
run: pip install virtualenv | |
- name: Download Artifact | |
# Get all the artifacts from the previous WPT run in order to get all the | |
# test reports. | |
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
with: | |
path: wpt_artifacts | |
# Merge the artifacts from all jobs in the same file. | |
merge-multiple: true | |
- name: Update expectations | |
timeout-minutes: 60 | |
env: | |
CHROMEDRIVER: ${{ matrix.kind == 'chromedriver' }} | |
HEADLESS: ${{ matrix.head!='headful' }} | |
# Do not run tests, only update expectations. | |
RUN_TESTS: false | |
UPDATE_EXPECTATIONS: true | |
VERBOSE: true | |
# Find all the reports for the given configuration and update the | |
# expectations with each report one-by-one. | |
run: > | |
find ./wpt_artifacts/ | |
-name "wptreport.${{ matrix.kind }}-${{ matrix.head }}*.json" | |
-exec npm run wpt -- --wpt-report {} \; | |
- name: Update interop expectations | |
if: ${{ matrix.kind == 'chromedriver' }} | |
env: | |
CHROMEDRIVER: ${{ matrix.kind == 'chromedriver' }} | |
HEADLESS: ${{ matrix.head!='headful' }} | |
# Do not run tests, only update expectations. | |
RUN_TESTS: false | |
UPDATE_EXPECTATIONS: true | |
VERBOSE: true | |
# Find all the reports for the given configuration and update the | |
# expectations with each report one-by-one. | |
run: > | |
find ./wpt_artifacts/ | |
-name "wptreport-interop.${{ matrix.kind }}-${{ matrix.head }}*.json" | |
-exec npm run wpt -- --wpt-report {} \; | |
- name: Move updated expectations | |
# Move the expectations from the current config to a separate directory to | |
# upload them to artifacts. | |
run: | | |
mkdir -p ./artifacts/updated-wpt-metadata/${{ matrix.kind }}/${{ matrix.head }} | |
mv ./wpt-metadata/${{ matrix.kind }}/${{ matrix.head }}/* ./artifacts/updated-wpt-metadata/${{ matrix.kind }}/${{ matrix.head }}/ | |
- name: Upload artifacts | |
if: success() | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: updated-wpt-metadata-${{ matrix.kind }}-${{ matrix.head }} | |
path: ./artifacts | |
commit_updated_expectations: | |
# Gets updated wpt expectations for all configurations and commits them in a | |
# single commit. | |
name: Commit updated expectations | |
runs-on: ubuntu-latest | |
needs: [update_expectations] | |
if: success() || failure() | |
permissions: | |
# Required to remove the label. | |
pull-requests: write | |
steps: | |
- name: Check if the expectations were updated. | |
# This check cannot be done on the job level. So if the `update_expectations` | |
# was not successful, just return. | |
if: ${{ needs.update_expectations.result != 'success' }} | |
run: 'exit 0' | |
# Just checkout the repo. No need in setting up Node.js or Python. | |
- name: Checkout | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
token: ${{ secrets.BROWSER_AUTOMATION_BOT_TOKEN }} | |
- name: Download Artifact | |
# There is no way to download artifacts by wildcard, so we need to download | |
# all of them. The `updated-wpt-metadata` directory should contain all the | |
# updated expectations from the `update_expectations` matrix. | |
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
with: | |
path: all-artifacts | |
merge-multiple: true | |
- name: Replace expectations with the updated ones. | |
# Remove the actual expectations and replace them with the updated ones. | |
run: | | |
rm -rf wpt-metadata/ | |
mkdir wpt-metadata | |
mv all-artifacts/updated-wpt-metadata/* ./wpt-metadata/ | |
- name: Remove update-expectations label | |
# Remove the `update-expectations`. This is needed to prevent a loop. | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'update-expectations') }} | |
run: gh pr edit "$NUMBER" --remove-label "update-expectations" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
NUMBER: ${{ github.event.pull_request.number }} | |
- name: Auto-commit WPT expectations | |
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 | |
with: | |
commit_message: Update WPT expectations | |
commit_options: -n --signoff | |
commit_user_name: Browser Automation Bot | |
commit_user_email: [email protected] | |
commit_author: Browser Automation Bot <[email protected]> | |
file_pattern: 'wpt-metadata/**/*.ini' |