@@ -83,32 +83,62 @@ jobs:
83
83
run : echo "WPT_REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV
84
84
working-directory : test/fixtures/wpt
85
85
86
+ # Node.js WPT Runner
86
87
- name : Run WPT and generate report
87
- run : make test-wpt-report || true
88
- - name : Clone report for upload
89
88
run : |
89
+ make test-wpt-report || true
90
90
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
93
92
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
94
124
- name : Upload GitHub Actions artifact
125
+ if : ${{ env.WPT_REPORT != '' }}
95
126
uses : actions/upload-artifact@v3
96
127
with :
97
128
path : out/wpt/wptreport-*.json
98
129
name : WPT Reports
99
- if-no-files-found : warn
130
+ if-no-files-found : error
100
131
- name : Upload WPT Report to wpt.fyi API
132
+ if : ${{ env.WPT_REPORT != '' }}
101
133
env :
102
134
WPT_FYI_ENDPOINT : ${{ vars.WPT_FYI_ENDPOINT }}
103
135
WPT_FYI_USERNAME : ${{ vars.WPT_FYI_USERNAME }}
104
136
WPT_FYI_PASSWORD : ${{ secrets.WPT_FYI_PASSWORD }}
137
+ working-directory : out/wpt
105
138
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