mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
tools: re-enable undici WPTs in daily wpt.fyi job
Refs: https://github.com/nodejs/node/pull/60444 Closes: https://github.com/nodejs/undici/issues/4644 Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: https://github.com/nodejs/node/pull/62677 Fixes: https://github.com/nodejs/undici/issues/4644 Refs: https://github.com/nodejs/node/pull/60444 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
1 parent
430c69d25f
commit
a932fbd10b
3 files changed
+135
No files matched your search
@@ -0,0 +1,56 @@
|
||||
name: Run undici WPT (current)
|
||||
description: Runs undici WPT tests for undici >= 7 and merges results into the Node.js WPT report
|
||||
|
||||
inputs:
|
||||
undici-version:
|
||||
required: true
|
||||
description: undici version tag to checkout
|
||||
wpt-report:
|
||||
required: true
|
||||
description: Path to the Node.js WPT report to merge into
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Checkout undici
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
repository: nodejs/undici
|
||||
persist-credentials: false
|
||||
path: undici
|
||||
clean: false
|
||||
ref: ${{ inputs.undici-version }}
|
||||
- name: Prepare WPT checkout
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf undici/test/web-platform-tests/wpt
|
||||
mv test/fixtures/wpt undici/test/web-platform-tests/wpt
|
||||
- name: Configure hosts
|
||||
shell: bash
|
||||
working-directory: undici/test/web-platform-tests/wpt
|
||||
run: python3 wpt make-hosts-file | sudo tee -a /etc/hosts
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
working-directory: undici
|
||||
run: npm install
|
||||
- name: Run WPT
|
||||
shell: bash
|
||||
working-directory: undici
|
||||
env:
|
||||
CI: 'true'
|
||||
WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json
|
||||
run: npm run test:wpt || true
|
||||
- name: Merge report
|
||||
shell: bash
|
||||
env:
|
||||
NODE_WPT_REPORT: ${{ inputs.wpt-report }}
|
||||
UNDICI_WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json
|
||||
run: |
|
||||
if [ -f "$UNDICI_WPT_REPORT" ]; then
|
||||
jq -sc '
|
||||
.[0].results += .[1].results |
|
||||
.[0].time_end = .[1].time_end |
|
||||
.[0]
|
||||
' "$NODE_WPT_REPORT" "$UNDICI_WPT_REPORT" > "${NODE_WPT_REPORT}.tmp"
|
||||
mv "${NODE_WPT_REPORT}.tmp" "$NODE_WPT_REPORT"
|
||||
fi
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Run undici WPT (legacy)
|
||||
description: Runs undici WPT tests for undici < 7 and appends results to the Node.js WPT report
|
||||
|
||||
inputs:
|
||||
undici-version:
|
||||
required: true
|
||||
description: undici version tag to checkout
|
||||
wpt-report:
|
||||
required: true
|
||||
description: Path to the Node.js WPT report
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Checkout undici
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
repository: nodejs/undici
|
||||
persist-credentials: false
|
||||
path: undici
|
||||
clean: false
|
||||
ref: ${{ inputs.undici-version }}
|
||||
- name: Prepare WPT checkout
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf undici/test/wpt/tests
|
||||
mv test/fixtures/wpt undici/test/wpt/tests
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
working-directory: undici
|
||||
run: npm install
|
||||
- name: Run WPT
|
||||
shell: bash
|
||||
working-directory: undici
|
||||
env:
|
||||
WPT_REPORT: ${{ inputs.wpt-report }}
|
||||
run: npm run test:wpt || true
|
||||
@@ -95,6 +95,48 @@ jobs:
|
||||
echo "WPT_REPORT=$(pwd)/out/wpt/wptreport.json" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
# undici WPT Runner
|
||||
- name: Set env.UNDICI_VERSION
|
||||
if: ${{ env.WPT_REPORT != '' }}
|
||||
run: |
|
||||
UNDICI_VERSION=$(jq -r '.version' < deps/undici/src/package.json)
|
||||
echo "UNDICI_VERSION=v$UNDICI_VERSION" >> $GITHUB_ENV
|
||||
if [ "${UNDICI_VERSION%%.*}" -ge 7 ]; then
|
||||
echo "UNDICI_WPT=current" >> $GITHUB_ENV
|
||||
else
|
||||
echo "UNDICI_WPT=legacy" >> $GITHUB_ENV
|
||||
fi
|
||||
# Checkout composite actions from the default branch since the
|
||||
# version-specific checkout above overwrites .github/actions/
|
||||
- name: Checkout undici WPT actions
|
||||
if: ${{ env.WPT_REPORT != '' }}
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github/actions/undici-wpt-current
|
||||
.github/actions/undici-wpt-legacy
|
||||
sparse-checkout-cone-mode: false
|
||||
persist-credentials: false
|
||||
path: _wpt_actions
|
||||
clean: false
|
||||
- name: Place undici WPT actions
|
||||
if: ${{ env.WPT_REPORT != '' }}
|
||||
run: |
|
||||
mkdir -p .github/actions
|
||||
cp -r _wpt_actions/.github/actions/undici-wpt-* .github/actions/
|
||||
- name: Run undici WPT (current)
|
||||
if: ${{ env.UNDICI_WPT == 'current' }}
|
||||
uses: ./.github/actions/undici-wpt-current
|
||||
with:
|
||||
undici-version: ${{ env.UNDICI_VERSION }}
|
||||
wpt-report: ${{ env.WPT_REPORT }}
|
||||
- name: Run undici WPT (legacy)
|
||||
if: ${{ env.UNDICI_WPT == 'legacy' }}
|
||||
uses: ./.github/actions/undici-wpt-legacy
|
||||
with:
|
||||
undici-version: ${{ env.UNDICI_VERSION }}
|
||||
wpt-report: ${{ env.WPT_REPORT }}
|
||||
|
||||
# Upload artifacts
|
||||
- name: Clone report for upload
|
||||
if: ${{ env.WPT_REPORT != '' }}
|
||||
|
||||
Reference in new issue
Block a user