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
This commit is contained in:
Martin Robinson 2024-02-17 17:59:43 +01:00 committed by GitHub
parent d5c9e569bf
commit 1cc546c4fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 144 additions and 133 deletions

View file

@ -20,8 +20,10 @@ on:
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
WPT_COMMAND_LINE_ARG: "${{ inputs.wpt-layout == 'layout-2013' && '--legacy-layout' || '' }}"
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:
@ -45,12 +47,12 @@ jobs:
with:
ref: refs/pull/${{ github.event.number }}/head
fetch-depth: 2
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: release-binary
path: release-binary
name: ${{ inputs.profile }}-binary-linux
path: ${{ inputs.profile }}-binary-linux
- name: unPackage binary
run: tar -xzf release-binary/target.tar.gz
run: tar -xzf ${{ inputs.profile }}-binary-linux/target.tar.gz
- name: Bootstrap dependencies
run: |
python3 -m pip install --upgrade pip
@ -62,75 +64,66 @@ jobs:
run: |
./mach update-wpt --sync --patch
- name: Run tests
if: ${{ !inputs.wpt-sync-from-upstream }}
run: |
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG ${{ inputs.wpt-tests-to-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 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
--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) }}
INTERMITTENT_TRACKER_DASHBOARD_SECRET: ${{ secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET }}
- name: Run tests (sync)
if: ${{ inputs.wpt-sync-from-upstream }}
run: |
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
--${{ inputs.profile }} --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-from-upstream }}
- name: Archive results (filtered)
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: wpt-filtered-results-linux-${{ inputs.wpt-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-from-upstream }}
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-logs-linux-${{ inputs.wpt-layout }}
path: |
test-wpt.${{ matrix.chunk_id }}.log
- name: Archive logs
uses: actions/upload-artifact@v3
if: ${{ inputs.wpt-sync-from-upstream }}
with:
name: wpt-logs-linux-${{ inputs.wpt-layout }}
path: |
test-wpt.${{ matrix.chunk_id }}.log
wpt-jsonsummary.${{ matrix.chunk_id }}.log
name: wpt-full-logs-linux-${{ inputs.wpt-layout }}-${{ matrix.chunk_id }}
path: wpt-full-logs/*/
report-test-results:
name: Report WPT Results
name: Process WPT Results
runs-on: ubuntu-latest
if: ${{ always() && !cancelled() && !inputs.wpt-sync-from-upstream }}
needs:
- "linux-wpt"
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@v3
- uses: actions/download-artifact@v4
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
with:
name: wpt-filtered-results-linux-${{ inputs.wpt-layout }}
path: wpt-filtered-results-linux
- name: Create aggregated unexpected results
name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}
path: results
- name: Report results
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
run: |
cat wpt-filtered-results-linux/*.log > unexpected-test-wpt-${{ inputs.wpt-layout }}.log
- name: Archive aggregate results
uses: actions/upload-artifact@v3
with:
name: wpt-filtered-results-linux
path: |
unexpected-test-wpt-${{ inputs.wpt-layout }}.log
- name: Comment on PR with results
run: |
etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-${{ inputs.wpt-layout }}" wpt-filtered-results-linux/*.json
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 }}