servo/.github/workflows/linux-wpt.yml
Martin Robinson 1cc546c4fc
ci: Switch to version 4 of GitHub artifact actions (#31357)
* ci: Switch to version 4 of GitHub artifact actions

This switches to version 4 of the GitHub artifact actions, which
requires producing a single artifact per job and adding merge steps. In
addition, the names of artifacts are standardized:

- Build: <profile>-binary-<platform>
- Full WPT results (only on failure): wpt-full-logs-<platform>-<layout>
- Filtered WPT results (only on failure): wpt-filtered-logs-<platform>-<layout>

* Delete merged build timings and combine with Result job

* Always archives logs even after test failures

* Correct the name of the log files for WPT import
2024-02-17 16:59:43 +00:00

130 lines
4.8 KiB
YAML

name: Linux WPT Tests
on:
workflow_call:
inputs:
profile:
required: true
type: string
wpt-tests-to-run:
default: ""
required: false
type: string
wpt-sync-from-upstream:
default: false
required: false
type: boolean
wpt-layout:
required: true
type: string
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 || '' }}
WPT_LAYOUT_ARG: "${{ inputs.wpt-layout == 'layout-2013' && '--legacy-layout' || '' }}"
WPT_ALWAYS_SUCCEED_ARG: "${{ inputs.wpt-sync-from-upstream && '--always-succeed' || '' }}"
jobs:
linux-wpt:
name: WPT ${{ inputs.wpt-layout }}
runs-on: ubuntu-22.04
env:
max_chunk_id: 20
strategy:
fail-fast: false
matrix:
chunk_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
steps:
- uses: actions/checkout@v3
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 2
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v3
if: github.event_name == 'pull_request_target'
with:
ref: refs/pull/${{ github.event.number }}/head
fetch-depth: 2
- 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: Bootstrap dependencies
run: |
python3 -m pip install --upgrade pip
sudo apt update
sudo apt install -qy --no-install-recommends mesa-vulkan-drivers
python3 ./mach bootstrap
- 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-${{ inputs.wpt-layout }}
mkdir -p wpt-full-logs/linux-${{ inputs.wpt-layout }}
python3 ./mach test-wpt \
$WPT_LAYOUT_ARG \
$WPT_ALWAYS_SUCCEED_ARG \
${{ inputs.wpt-tests-to-run }} \
--${{ inputs.profile }} --processes $(nproc) --timeout-multiplier 2 \
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
--log-raw wpt-full-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.log \
--log-raw-unexpected wpt-filtered-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.log \
--filter-intermittents wpt-filtered-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.json
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Archive results (filtered)
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}-${{ matrix.chunk_id }}
path: wpt-filtered-logs/*/
- name: Archive results (full)
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: wpt-full-logs-linux-${{ inputs.wpt-layout }}-${{ 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 (filtered)
uses: actions/upload-artifact/merge@v4
with:
name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}
pattern: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}-*
delete-merged: true
- name: Merge logs (full)
uses: actions/upload-artifact/merge@v4
with:
name: wpt-full-logs-linux-${{ inputs.wpt-layout }}
pattern: wpt-full-logs-linux-${{ inputs.wpt-layout }}-*
delete-merged: true
- uses: actions/checkout@v3
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
with:
fetch-depth: 2
- uses: actions/download-artifact@v4
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
with:
name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}
path: results
- name: Report results
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
run: |
etc/ci/report_aggregated_expected_results.py \
--tag="linux-wpt-${{ inputs.wpt-layout }}" \
results/linux-${{ inputs.wpt-layout }}/*.json
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RESULTS: ${{ toJson(needs.*.result) }}