Skip to content

Commit 12a5618

Browse files
panvatargos
authored andcommitted
tools: add undici WPTs to daily WPT Report
PR-URL: #46763 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 84f5a1f commit 12a5618

File tree

1 file changed

+47
-17
lines changed

1 file changed

+47
-17
lines changed

.github/workflows/daily-wpt-fyi.yml

+47-17
Original file line numberDiff line numberDiff line change
@@ -81,34 +81,64 @@ jobs:
8181
clean: false
8282
ref: ${{ env.WPT_REVISION }}
8383

84+
# Node.js WPT Runner
8485
- name: Run WPT and generate report
85-
run: make test-wpt-report || true
86-
- name: Clone report for upload
8786
run: |
87+
make test-wpt-report || true
8888
if [ -e out/wpt/wptreport.json ]; then
89-
cd out/wpt
90-
cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json
89+
echo "WPT_REPORT=$(pwd)/out/wpt/wptreport.json" >> $GITHUB_ENV
9190
fi
91+
92+
# undici WPT Runner
93+
- name: Set env.UNDICI_VERSION
94+
if: ${{ env.WPT_REPORT != '' }}
95+
run: echo "UNDICI_VERSION=v$(jq -r '.version' < deps/undici/src/package.json)" >> $GITHUB_ENV
96+
- name: Remove deps/undici
97+
if: ${{ env.WPT_REPORT != '' }}
98+
run: rm -rf deps/undici
99+
- name: Checkout undici
100+
if: ${{ env.WPT_REPORT != '' }}
101+
uses: actions/checkout@v3
102+
with:
103+
repository: nodejs/undici
104+
persist-credentials: false
105+
path: deps/undici
106+
clean: false
107+
ref: ${{ env.UNDICI_VERSION }}
108+
- name: Add undici WPTs to the report
109+
if: ${{ env.WPT_REPORT != '' }}
110+
run: |
111+
rm -rf test/wpt/tests
112+
mv ../../test/fixtures/wpt/ test/wpt/tests/
113+
npm install
114+
npm run test:wpt || true
115+
working-directory: deps/undici
116+
117+
# Upload artifacts
118+
- name: Clone report for upload
119+
if: ${{ env.WPT_REPORT != '' }}
120+
working-directory: out/wpt
121+
run: cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json
92122
- name: Upload GitHub Actions artifact
123+
if: ${{ env.WPT_REPORT != '' }}
93124
uses: actions/upload-artifact@v3
94125
with:
95126
path: out/wpt/wptreport-*.json
96127
name: WPT Reports
97-
if-no-files-found: warn
128+
if-no-files-found: error
98129
- name: Upload WPT Report to wpt.fyi API
130+
if: ${{ env.WPT_REPORT != '' }}
99131
env:
100132
WPT_FYI_USERNAME: ${{ vars.WPT_FYI_USERNAME }}
101133
WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }}
134+
working-directory: out/wpt
102135
run: |
103-
if [ -e out/wpt/wptreport.json ]; then
104-
cd out/wpt
105-
gzip wptreport.json
106-
for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload"
107-
do
108-
curl \
109-
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
110-
-F "result_file=@wptreport.json.gz" \
111-
-F "labels=master" \
112-
$WPT_FYI_ENDPOINT
113-
done
114-
fi
136+
gzip wptreport.json
137+
for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload"
138+
do
139+
curl \
140+
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
141+
-F "result_file=@wptreport.json.gz" \
142+
-F "labels=master" \
143+
$WPT_FYI_ENDPOINT
144+
done

0 commit comments

Comments
 (0)