@@ -81,34 +81,64 @@ jobs:
81
81
clean : false
82
82
ref : ${{ env.WPT_REVISION }}
83
83
84
+ # Node.js WPT Runner
84
85
- name : Run WPT and generate report
85
- run : make test-wpt-report || true
86
- - name : Clone report for upload
87
86
run : |
87
+ make test-wpt-report || true
88
88
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
91
90
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
92
122
- name : Upload GitHub Actions artifact
123
+ if : ${{ env.WPT_REPORT != '' }}
93
124
uses : actions/upload-artifact@v3
94
125
with :
95
126
path : out/wpt/wptreport-*.json
96
127
name : WPT Reports
97
- if-no-files-found : warn
128
+ if-no-files-found : error
98
129
- name : Upload WPT Report to wpt.fyi API
130
+ if : ${{ env.WPT_REPORT != '' }}
99
131
env :
100
132
WPT_FYI_USERNAME : ${{ vars.WPT_FYI_USERNAME }}
101
133
WPT_FYI_PASSWORD : ${{ secrets.WPT_FYI_PASSWORD }}
134
+ working-directory : out/wpt
102
135
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