-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: add a daily wpt.fyi synchronized report upload
- Loading branch information
Showing
1 changed file
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# This workflow runs every night and tests various versions of Node.js | ||
# (main branch build, current, and two latest LTS release lines) against the | ||
# `epochs/daily` branch of WPT. | ||
|
||
name: Daily WPT report | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# This is 20 minutes after `epochs/daily` branch is triggered to be created | ||
# in WPT repo. | ||
# https://github.com/web-platform-tests/wpt/blob/master/.github/workflows/epochs.yml | ||
- cron: 30 0 * * * | ||
|
||
env: | ||
PYTHON_VERSION: '3.11' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
generate: | ||
strategy: | ||
matrix: | ||
ref: | ||
- main | ||
- current | ||
- lts/* | ||
- lts/-1 | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
steps: | ||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Environment Information | ||
run: npx envinfo | ||
|
||
# checkout main & build | ||
- name: Checkout ${{ matrix.ref }} branch | ||
if: matrix.ref == 'main' | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ matrix.ref }} | ||
persist-credentials: false | ||
- name: Build Node.js | ||
if: matrix.ref == 'main' | ||
run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" | ||
|
||
# or install a version and checkout | ||
- name: Install Node.js | ||
if: matrix.ref != 'main' | ||
id: setup-node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.ref }} | ||
- name: Checkout ${{ steps.setup-node.outputs.node-version }} | ||
uses: actions/checkout@v3 | ||
if: matrix.ref != 'main' | ||
with: | ||
persist-credentials: false | ||
ref: ${{ steps.setup-node.outputs.node-version }} | ||
- name: Set env.NODE | ||
if: matrix.ref != 'main' | ||
run: echo "NODE=$(which node)" >> $GITHUB_ENV | ||
|
||
# replace checked out WPT with the synchronized branch | ||
- name: Remove stale WPT | ||
run: rm -rf wpt | ||
working-directory: test/fixtures | ||
- name: Checkout epochs/daily WPT | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: web-platform-tests/wpt | ||
persist-credentials: false | ||
path: test/fixtures/wpt | ||
clean: false | ||
ref: epochs/daily | ||
- name: Set env.WPT_REVISION | ||
run: echo "WPT_REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
working-directory: test/fixtures/wpt | ||
|
||
- name: Run WPT and generate report | ||
run: make test-wpt-report || true | ||
env: | ||
NODE_REVISION: ${{ github.sha }} | ||
- name: Upload WPT Report to wpt.fyi API | ||
env: | ||
WPT_FYI_USERNAME: Node.js | ||
WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }} | ||
working-directory: out/wpt | ||
run: | | ||
gzip wptreport.json | ||
curl \ | ||
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \ | ||
-F "[email protected]" \ | ||
https://wpt.fyi/api/results/upload | ||
- name: Rename report | ||
run: mv wptreport.json wptreport-${{ steps.setup-node.outputs.node-version || github.sha }}.json | ||
working-directory: out/wpt | ||
- name: Upload GitHub Actions artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: out/wpt/wptreport-*.json | ||
name: WPT Reports | ||
if-no-files-found: ignore |