Skip to content

Commit c0072b2

Browse files
committed
test: add undici WPTs to daily WPT Report
1 parent c90ea93 commit c0072b2

File tree

1 file changed

+44
-14
lines changed

1 file changed

+44
-14
lines changed

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

+44-14
Original file line numberDiff line numberDiff line change
@@ -83,32 +83,62 @@ jobs:
8383
run: echo "WPT_REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV
8484
working-directory: test/fixtures/wpt
8585

86+
# Node.js WPT Runner
8687
- name: Run WPT and generate report
87-
run: make test-wpt-report || true
88-
- name: Clone report for upload
8988
run: |
89+
make test-wpt-report || true
9090
if [ -e out/wpt/wptreport.json ]; then
91-
cd out/wpt
92-
cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json
91+
echo "WPT_REPORT=$(pwd)/out/wpt/wptreport.json" >> $GITHUB_ENV
9392
fi
93+
94+
# undici WPT Runner
95+
- name: Set env.UNDICI_VERSION
96+
if: ${{ env.WPT_REPORT != '' }}
97+
run: echo "UNDICI_VERSION=v$(cat deps/undici/src/package.json | jq -r '.version')" >> $GITHUB_ENV
98+
- name: Remove deps/undici
99+
if: ${{ env.WPT_REPORT != '' }}
100+
run: rm -rf deps/undici
101+
- name: Checkout undici
102+
if: ${{ env.WPT_REPORT != '' }}
103+
uses: actions/checkout@v3
104+
with:
105+
repository: nodejs/undici
106+
persist-credentials: false
107+
path: deps/undici
108+
clean: false
109+
ref: ${{ env.UNDICI_VERSION }}
110+
- name: Add undici WPTs to the report
111+
if: ${{ env.WPT_REPORT != '' }}
112+
run: |
113+
rm -rf test/wpt/tests
114+
mv ../../test/fixtures/wpt/ test/wpt/tests/
115+
npm install
116+
npm run test:wpt || true
117+
working-directory: deps/undici
118+
119+
# Upload artifacts
120+
- name: Clone report for upload
121+
if: ${{ env.WPT_REPORT != '' }}
122+
working-directory: out/wpt
123+
run: cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json
94124
- name: Upload GitHub Actions artifact
125+
if: ${{ env.WPT_REPORT != '' }}
95126
uses: actions/upload-artifact@v3
96127
with:
97128
path: out/wpt/wptreport-*.json
98129
name: WPT Reports
99-
if-no-files-found: warn
130+
if-no-files-found: error
100131
- name: Upload WPT Report to wpt.fyi API
132+
if: ${{ env.WPT_REPORT != '' }}
101133
env:
102134
WPT_FYI_ENDPOINT: ${{ vars.WPT_FYI_ENDPOINT }}
103135
WPT_FYI_USERNAME: ${{ vars.WPT_FYI_USERNAME }}
104136
WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }}
137+
working-directory: out/wpt
105138
run: |
106-
if [ -e out/wpt/wptreport.json ]; then
107-
cd out/wpt
108-
gzip wptreport.json
109-
curl \
110-
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
111-
112-
-F "labels=master" \
113-
$WPT_FYI_ENDPOINT
114-
fi
139+
gzip wptreport.json
140+
curl \
141+
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
142+
143+
-F "labels=master" \
144+
$WPT_FYI_ENDPOINT

0 commit comments

Comments
 (0)