-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(automation): Add workflow to vendor and update Test262 tests [pt 4/5] #56843
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: Update Test262 tests | ||
|
|
||
| on: | ||
| # Trigger at every Sunday UTC noon, or manually. | ||
| schedule: | ||
| - cron: '0 12 * * 0' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| update-test262: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout WPT repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| path: wpt | ||
| - name: Checkout Test262 repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: tc39/test262 | ||
| path: test262-spec | ||
| - name: Copy Test262 tests to WPT | ||
| run: | | ||
| LATEST_SHA=$(git -C test262-spec rev-parse HEAD) | ||
| echo "Latest remote Test262 SHA: $LATEST_SHA" | ||
|
|
||
| rm -rf wpt/third_party/test262/test/ | ||
| mkdir -p wpt/third_party/test262/test/ | ||
| mkdir -p wpt/third_party/test262/harness/ | ||
|
|
||
| # Selectively copy only Interop 2026 feature tests for now | ||
| # See: https://github.com/web-platform-tests/wpt.fyi/issues/4681 | ||
| # Mapping of web feature to test directory can be found at: https://github.com/tc39/test262/blob/main/WEB_FEATURES.yml | ||
| # Temporal tests | ||
| mkdir -p wpt/third_party/test262/test/built-ins/Date/prototype/toTemporalInstant | ||
| mkdir -p wpt/third_party/test262/test/built-ins/Temporal | ||
| mkdir -p wpt/third_party/test262/test/intl402/Temporal | ||
| cp -r test262-spec/test/built-ins/Date/prototype/toTemporalInstant/* wpt/third_party/test262/test/built-ins/Date/prototype/toTemporalInstant | ||
| cp -r test262-spec/test/built-ins/Temporal/* wpt/third_party/test262/test/built-ins/Temporal | ||
| cp -r test262-spec/test/intl402/Temporal/* wpt/third_party/test262/test/intl402/Temporal | ||
|
|
||
| # Top-level-await tests | ||
| mkdir -p wpt/third_party/test262/test/language/module-code/top-level-await | ||
| cp -r test262-spec/test/language/module-code/top-level-await/* wpt/third_party/test262/test/language/module-code/top-level-await | ||
|
|
||
| # Always sync the harness files | ||
| rsync -a --delete test262-spec/harness/ wpt/third_party/test262/harness/ | ||
| printf "[test262]\nsource = \"https://github.com/tc39/test262\"\nrev = \"${LATEST_SHA}\"\n" > wpt/third_party/test262/vendored.toml | ||
| - name: Commit changes | ||
| id: commit | ||
| continue-on-error: true | ||
| run: | | ||
| cd wpt | ||
| export BRANCH_NAME="$BRANCH_PREFIX-$(date +'%Y%m%d%H%M%S')" | ||
| echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | ||
| git config user.name "$GIT_AUTHOR_NAME" | ||
| git config user.email "$GIT_AUTHOR_EMAIL" | ||
| git checkout -B $BRANCH_NAME | ||
| git add third_party/test262/ | ||
| git commit -m "$COMMIT_TITLE" | ||
|
Comment on lines
+23
to
+60
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional nit: The scripts are somewhat long and may be subject to change. Would it be better to move some of this to a separate file?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strong agree with this; I don't think we should have non-trivial scripts directly in GH actions files. |
||
| env: | ||
| GIT_AUTHOR_NAME: "wpt-pr-bot" | ||
| GIT_AUTHOR_EMAIL: "[email protected]" | ||
| BRANCH_PREFIX: "test262-update" | ||
| COMMIT_TITLE: "Update Test262 tests" | ||
| - name: Create PR | ||
| if: ${{ steps.commit.outcome == 'success' }} | ||
| run: | | ||
| cd wpt | ||
| git push --set-upstream origin $BRANCH_NAME | ||
| gh pr create --title "$COMMIT_TITLE" --body "$PR_BODY" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| COMMIT_TITLE: "Update Test262 tests" | ||
| PR_BODY: "Scheduled weekly update auto-generated by the '${{ github.workflow }}' workflow." | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we copy everything and instead configure the CI to only run specific directories for now? That will perhaps make things easier if people want to run a different subset in their own CI.