-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
tools: add a daily wpt.fyi synchronized report upload #46498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,110 @@ | ||
# This workflow runs every night and tests various releases of Node.js | ||
# (latest nightly, current, and two latest LTS release lines) against the | ||
# `epochs/daily` branch of WPT. | ||
|
||
name: Daily WPT report | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
node-versions: | ||
description: Node.js versions (as supported by actions/setup-node) to test as JSON array | ||
required: false | ||
default: '["current", "lts/*", "lts/-1"]' | ||
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: | ||
report: | ||
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch' | ||
strategy: | ||
matrix: | ||
node-version: ${{ fromJSON(github.event.inputs.node-versions || '["latest-nightly", "current", "lts/*", "lts/-1"]') }} | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
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 | ||
|
||
# install a version and checkout | ||
- name: Get latest nightly | ||
if: matrix.node-version == 'latest-nightly' | ||
run: echo "NIGHTLY=$(curl -s https://nodejs.org/download/nightly/index.json | jq -r '.[0].version')" >> $GITHUB_ENV | ||
- name: Install Node.js | ||
id: setup-node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NIGHTLY || matrix.node-version }} | ||
- name: Get nightly ref | ||
if: contains(matrix.node-version, 'nightly') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
SHORT_SHA=$(node -p 'process.version.split(/-nightly\d{8}/)[1]') | ||
echo "NIGHTLY_REF=$(gh api /repos/nodejs/node/commits/$SHORT_SHA | jq -r '.sha')" >> $GITHUB_ENV | ||
- name: Checkout ${{ steps.setup-node.outputs.node-version }} | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
ref: ${{ env.NIGHTLY_REF || steps.setup-node.outputs.node-version }} | ||
- name: Set env.NODE | ||
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 | ||
panva marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
anonrig marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Clone report for upload | ||
run: | | ||
if [ -e out/wpt/wptreport.json ]; then | ||
cd out/wpt | ||
cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json | ||
fi | ||
- name: Upload GitHub Actions artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: out/wpt/wptreport-*.json | ||
name: WPT Reports | ||
if-no-files-found: warn | ||
- name: Upload WPT Report to wpt.fyi API | ||
env: | ||
WPT_FYI_ENDPOINT: ${{ vars.WPT_FYI_ENDPOINT }} | ||
WPT_FYI_USERNAME: ${{ vars.WPT_FYI_USERNAME }} | ||
WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }} | ||
run: | | ||
if [ -e out/wpt/wptreport.json ]; then | ||
cd out/wpt | ||
gzip wptreport.json | ||
curl \ | ||
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \ | ||
-F "[email protected]" \ | ||
-F "labels=master" \ | ||
$WPT_FYI_ENDPOINT | ||
fi |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.