Skip to content

Commit 711dd07

Browse files
committed
tools: add a daily wpt.fyi synchronized report upload
1 parent 8c598d6 commit 711dd07

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

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

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# This workflow runs every night and tests various versions of Node.js
2+
# (main branch build, current, and two latest LTS release lines) against the
3+
# `epochs/daily` branch of WPT.
4+
5+
name: Daily WPT report
6+
7+
on:
8+
workflow_dispatch:
9+
schedule:
10+
# This is 20 minutes after `epochs/daily` branch is triggered to be created
11+
# in WPT repo.
12+
# https://github.com/web-platform-tests/wpt/blob/master/.github/workflows/epochs.yml
13+
- cron: 30 0 * * *
14+
15+
env:
16+
PYTHON_VERSION: '3.11'
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
generate:
23+
strategy:
24+
matrix:
25+
ref:
26+
- main
27+
- current
28+
- lts/*
29+
- lts/-1
30+
fail-fast: false
31+
runs-on: ubuntu-latest
32+
continue-on-error: true
33+
steps:
34+
- name: Set up Python ${{ env.PYTHON_VERSION }}
35+
uses: actions/setup-python@v4
36+
with:
37+
python-version: ${{ env.PYTHON_VERSION }}
38+
- name: Environment Information
39+
run: npx envinfo
40+
41+
# checkout main & build
42+
- name: Checkout ${{ matrix.ref }} branch
43+
if: matrix.ref == 'main'
44+
uses: actions/checkout@v3
45+
with:
46+
ref: ${{ matrix.ref }}
47+
persist-credentials: false
48+
- name: Build Node.js
49+
if: matrix.ref == 'main'
50+
run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn"
51+
52+
# or install a version and checkout
53+
- name: Install Node.js
54+
if: matrix.ref != 'main'
55+
id: setup-node
56+
uses: actions/setup-node@v3
57+
with:
58+
node-version: ${{ matrix.ref }}
59+
- name: Checkout ${{ steps.setup-node.outputs.node-version }}
60+
uses: actions/checkout@v3
61+
if: matrix.ref != 'main'
62+
with:
63+
persist-credentials: false
64+
ref: ${{ steps.setup-node.outputs.node-version }}
65+
- name: Set env.NODE
66+
if: matrix.ref != 'main'
67+
run: echo "NODE=$(which node)" >> $GITHUB_ENV
68+
69+
# replace checked out WPT with the synchronized branch
70+
- name: Remove stale WPT
71+
run: rm -rf wpt
72+
working-directory: test/fixtures
73+
- name: Checkout epochs/daily WPT
74+
uses: actions/checkout@v3
75+
with:
76+
repository: web-platform-tests/wpt
77+
persist-credentials: false
78+
path: test/fixtures/wpt
79+
clean: false
80+
ref: epochs/daily
81+
- name: Set env.WPT_REVISION
82+
run: echo "WPT_REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV
83+
working-directory: test/fixtures/wpt
84+
85+
- name: Run WPT and generate report
86+
run: make test-wpt-report || true
87+
env:
88+
NODE_REVISION: ${{ github.sha }}
89+
- name: Clone report for upload
90+
run: cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version || github.sha }}.json
91+
working-directory: out/wpt
92+
- name: Upload GitHub Actions artifact
93+
uses: actions/upload-artifact@v3
94+
with:
95+
path: out/wpt/wptreport-*.json
96+
name: WPT Reports
97+
if-no-files-found: error
98+
99+
# prev. step fails if no file was generated
100+
- name: Upload WPT Report to wpt.fyi API
101+
env:
102+
WPT_FYI_USERNAME: ${{ secrets.WPT_FYI_USERNAME }}
103+
WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }}
104+
working-directory: out/wpt
105+
run: |
106+
gzip wptreport.json
107+
curl \
108+
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
109+
110+
https://wpt.fyi/api/results/upload

0 commit comments

Comments
 (0)