servo/.github/workflows/linux-wpt.yml
Jerens Lensun 36f1a373e3
ci: Automatically cancel bootstrap step after 1 hour in wpt linux/mach (#38358)
Introduces a timeout for each WPT run chunk job, set to 1 hour, after
which it will be automatically canceled.

Testing: 
Fixes: #38348

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-31 07:24:23 +00:00

140 lines
5.2 KiB
YAML

name: Linux WPT Tests
on:
workflow_call:
inputs:
profile:
required: true
type: string
wpt-args:
default: ""
required: false
type: string
wpt-sync-from-upstream:
default: false
required: false
type: boolean
number-of-wpt-chunks:
default: 20
required: false
type: number
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
GST_PLUGIN_FEATURE_RANK: pulsesink:NONE,alsasink:NONE,jacksink:NONE,fakesink:MAX
INTERMITTENT_TRACKER_DASHBOARD_SECRET: ${{ !inputs.wpt-sync-from-upstream && secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET || '' }}
INTERMITTENT_TRACKER_DASHBOARD_SECRET_PROD: ${{ !inputs.wpt-sync-from-upstream && secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET_PROD || '' }}
INTERMITTENT_TRACKER_DASHBOARD_SECRET_STAGING: ${{ !inputs.wpt-sync-from-upstream && secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET_STAGING || '' }}
WPT_ALWAYS_SUCCEED_ARG: "${{ inputs.wpt-sync-from-upstream && '--always-succeed' || '' }}"
jobs:
chunks:
name: Generate chunks array
runs-on: ubuntu-22.04
outputs:
chunks-array: ${{ steps.generate-chunks-array.outputs.result }}
steps:
- uses: actions/github-script@v7
id: generate-chunks-array
with:
script: |
return Array.from({length: ${{ inputs.number-of-wpt-chunks }}}, (_, i) => i + 1)
linux-wpt:
name: WPT
runs-on: ubuntu-22.04
needs: chunks
strategy:
fail-fast: false
matrix:
chunk_id: ${{ fromJson(needs.chunks.outputs.chunks-array) }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: refs/pull/${{ github.event.number }}/head
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.profile }}-binary-linux
path: ${{ inputs.profile }}-binary-linux
- name: unPackage binary
run: tar -xzf ${{ inputs.profile }}-binary-linux/target.tar.gz
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Bootstrap dependencies
timeout-minutes: 60
run: |
sudo apt update
sudo apt install -qy --no-install-recommends mesa-vulkan-drivers fonts-noto-cjk
./mach bootstrap --skip-lints
- name: Sync from upstream WPT
if: ${{ inputs.wpt-sync-from-upstream }}
run: |
./mach update-wpt --sync --patch
- name: Run tests
run: |
mkdir -p wpt-filtered-logs/linux
mkdir -p wpt-full-logs/linux
./mach test-wpt \
$WPT_ALWAYS_SUCCEED_ARG \
--${{ inputs.profile }} --processes $(nproc) --timeout-multiplier 2 \
--total-chunks ${{ inputs.number-of-wpt-chunks }} --this-chunk ${{ matrix.chunk_id }} \
--log-raw wpt-full-logs/linux/raw/${{ matrix.chunk_id }}.log \
--log-wptreport wpt-full-logs/linux/wptreport/${{ matrix.chunk_id }}.json \
--log-raw-unexpected wpt-filtered-logs/linux/${{ matrix.chunk_id }}.log \
--filter-intermittents wpt-filtered-logs/linux/${{ matrix.chunk_id }}.json \
${{ inputs.wpt-args }}
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Archive results (filtered)
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: wpt-filtered-logs-linux-${{ matrix.chunk_id }}
path: wpt-filtered-logs/*/
- name: Archive results (full)
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: wpt-full-logs-linux-${{ matrix.chunk_id }}
path: wpt-full-logs/*/
report-test-results:
name: Process WPT Results
runs-on: ubuntu-latest
if: ${{ always() }}
needs: linux-wpt
steps:
- name: Merge logs (full)
uses: actions/upload-artifact/merge@v4
with:
name: wpt-full-logs-linux
pattern: wpt-full-logs-linux-*
delete-merged: true
# This job needs to be last. If no filtered results were uploaded, it will fail, but we want to merge other archives in that case.
- name: Merge logs (filtered)
uses: actions/upload-artifact/merge@v4
with:
name: wpt-filtered-logs-linux
pattern: wpt-filtered-logs-linux-*
delete-merged: true
- uses: actions/checkout@v4
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
- uses: actions/download-artifact@v4
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
with:
name: wpt-filtered-logs-linux
path: results
- name: Report results
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
run: |
etc/ci/report_aggregated_expected_results.py \
--tag="linux-wpt" \
results/linux/*.json
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RESULTS: ${{ toJson(needs.*.result) }}