Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: add undici WPTs to daily WPT Report #46763

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 57 additions & 17 deletions .github/workflows/daily-wpt-fyi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,34 +80,74 @@ jobs:
clean: false
ref: ${{ env.WPT_REVISION }}

# Node.js WPT Runner
- name: Run WPT and generate report
run: make test-wpt-report || true
- name: Clone report for upload
run: |
make test-wpt-report || true
if [ -e out/wpt/wptreport.json ]; then
cd out/wpt
cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json
echo "WPT_REPORT=$(pwd)/out/wpt/wptreport.json" >> $GITHUB_ENV
fi

# undici WPT Runner
- name: Set env.UNDICI_VERSION
if: ${{ env.WPT_REPORT != '' }}
run: echo "UNDICI_VERSION=v$(jq -r '.version' < deps/undici/src/package.json)" >> $GITHUB_ENV
- name: Remove deps/undici
if: ${{ env.WPT_REPORT != '' }}
run: rm -rf deps/undici
- name: Checkout undici
if: ${{ env.WPT_REPORT != '' }}
uses: actions/checkout@v3
with:
repository: nodejs/undici
persist-credentials: false
path: deps/undici
clean: false
ref: ${{ env.UNDICI_VERSION }}
- name: Add undici WPTs to the report
if: ${{ env.WPT_REPORT != '' }}
run: |
rm -rf test/wpt/tests
mv ../../test/fixtures/wpt/ test/wpt/tests/
npm install
npm run test:wpt || true
working-directory: deps/undici

# Upload artifacts
- name: Clone report for upload
if: ${{ env.WPT_REPORT != '' }}
working-directory: out/wpt
run: cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json
- name: Upload GitHub Actions artifact
if: ${{ env.WPT_REPORT != '' }}
uses: actions/upload-artifact@v3
with:
path: out/wpt/wptreport-*.json
name: WPT Reports
if-no-files-found: warn
if-no-files-found: error
- name: Upload WPT Report to wpt.fyi API
if: ${{ env.WPT_REPORT != '' }}
env:
WPT_FYI_USERNAME: ${{ vars.WPT_FYI_USERNAME }}
WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }}
working-directory: out/wpt
run: |
if [ -e out/wpt/wptreport.json ]; then
cd out/wpt
gzip wptreport.json
for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload"
do
curl \
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
-F "result_file=@wptreport.json.gz" \
-F "labels=master" \
$WPT_FYI_ENDPOINT
done
fi
gzip wptreport.json
echo "## Node.js ${{ steps.setup-node.outputs.node-version }}" >> $GITHUB_STEP_SUMMARY
for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload"
do
response=$(curl -sS \
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
-F "result_file=@wptreport.json.gz" \
-F "labels=master" \
$WPT_FYI_ENDPOINT)

if [[ $response =~ Task\ ([0-9]+)\ added\ to\ queue ]]; then
run_id=${BASH_REMATCH[1]}
origin=${WPT_FYI_ENDPOINT%/api/results/upload}

echo "" >> $GITHUB_STEP_SUMMARY
echo "Run ID [$run_id]($origin/api/runs/$run_id) added to the processor queue at $origin" >> $GITHUB_STEP_SUMMARY
echo "- [View on the ${origin:8} dashboard]($origin/results?run_id=$run_id)" >> $GITHUB_STEP_SUMMARY
fi
done