servo/.github/workflows/linux-wpt.yml

143 lines
5.5 KiB
YAML

name: Linux WPT Tests
on:
workflow_call:
inputs:
production:
required: false
type: boolean
wpt:
required: false
type: string
layout:
required: true
type: string
env:
cargo_profile_option: ${{ inputs.production && '--profile production' || '--release' }}
RUST_BACKTRACE: 1
SHELL: /bin/bash
WPT_COMMAND_LINE_ARG: "${{ inputs.layout == 'layout-2013' && '--legacy-layout' || '' }}"
jobs:
linux-wpt:
name: WPT ${{ inputs.layout }}
runs-on: ubuntu-20.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 != 'issue_comment' && github.event_name != 'pull_request_target'
with:
fetch-depth: 2
# This is necessary to checkout the pull request if this run was triggered
# via an `issue_comment` action on a pull request.
- uses: actions/checkout@v3
if: github.event_name == 'issue_comment' || github.event_name == 'pull_request_target'
with:
ref: refs/pull/${{ github.event.issue.number || github.event.number }}/head
fetch-depth: 2
- uses: actions/download-artifact@v3
with:
name: release-binary
path: release-binary
- name: Cache libffi
id: cache
uses: actions/cache@v3
with:
path: ./libffi6_3.2.1-8_amd64.deb
key: cache-libffi
- name: Download libffi
if: steps.cache.outputs.cache-hit != 'true'
run: |
wget http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
- name: unPackage binary
run: tar -xzf release-binary/target.tar.gz
- name: Prep test environment
run: |
python3 -m pip install --upgrade pip virtualenv
sudo apt update
sudo apt install -qy --no-install-recommends libgl1 libssl1.1 libdbus-1-3 libxcb-xfixes0-dev libxcb-shape0-dev libunwind8 libgl1-mesa-dri mesa-vulkan-drivers libegl1-mesa
sudo apt install ./libffi6_3.2.1-8_amd64.deb
python3 ./mach bootstrap-gstreamer
- name: Sync from upstream WPT
if: ${{ inputs.wpt == 'sync' }}
run: |
./mach update-wpt --sync --patch
- name: Run tests
if: ${{ inputs.wpt != 'sync' }}
run: |
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
${{ env.cargo_profile_option }} --processes $(nproc) --timeout-multiplier 2 \
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
--log-raw-unexpected unexpected-test-wpt.${{ matrix.chunk_id }}.log \
--filter-intermittents filtered-test-wpt.${{ matrix.chunk_id }}.json
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
INTERMITTENT_TRACKER_DASHBOARD_SECRET: ${{ secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET }}
- name: Run tests (sync)
if: ${{ inputs.wpt == 'sync' }}
run: |
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
${{ env.cargo_profile_option }} --processes $(nproc) --timeout-multiplier 2 \
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
--always-succeed
- name: Archive filtered results
uses: actions/upload-artifact@v3
if: ${{ always() && inputs.wpt != 'sync' }}
with:
name: wpt-filtered-results-linux-${{ inputs.layout }}
path: |
filtered-test-wpt.${{ matrix.chunk_id }}.json
unexpected-test-wpt.${{ matrix.chunk_id }}.log
- name: Archive logs
uses: actions/upload-artifact@v3
if: ${{ failure() && inputs.wpt != 'sync' }}
with:
name: wpt-logs-linux-${{ inputs.layout }}
path: |
test-wpt.${{ matrix.chunk_id }}.log
- name: Archive logs
uses: actions/upload-artifact@v3
if: ${{ inputs.wpt == 'sync' }}
with:
name: wpt-logs-linux-${{ inputs.layout }}
path: |
test-wpt.${{ matrix.chunk_id }}.log
wpt-jsonsummary.${{ matrix.chunk_id }}.log
report-test-results:
name: Report WPT Results
runs-on: ubuntu-latest
if: ${{ always() && !cancelled() && (github.ref_name == 'try-wpt' || github.ref_name == 'try-wpt-2020' || inputs.wpt == 'test') }}
needs:
- "linux-wpt"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/download-artifact@v3
with:
name: wpt-filtered-results-linux-${{ inputs.layout }}
path: wpt-filtered-results-linux
- name: Create aggregated unexpected results
run: |
cat wpt-filtered-results-linux/*.log > unexpected-test-wpt-${{ inputs.layout }}.log
- name: Archive aggregate results
uses: actions/upload-artifact@v3
with:
name: wpt-filtered-results-linux
path: |
unexpected-test-wpt-${{ inputs.layout }}.log
- name: Comment on PR with results
run: |
etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-${{ inputs.layout }}" wpt-filtered-results-linux/*.json
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RESULTS: ${{ toJson(needs.*.result) }}