-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add core WebAssembly tests to WPT (#49277)
* Regularly add core WebAssembly tests to WPT * Fix Wasm spelling * Address review feedback - Add myself as a reviewer for .github/ - Remove the path fix up step as it's now done by build.py - Use better name for the wpt repo directory
- Loading branch information
Showing
2 changed files
with
65 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
suggested_reviewers: | ||
- foolip | ||
- jgraham | ||
- past |
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,64 @@ | ||
name: Update Wasm tests | ||
|
||
on: | ||
# Trigger at every Sunday UTC noon, or manually. | ||
schedule: | ||
- cron: 0 12 * * 0 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-wpt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout WPT repo | ||
uses: actions/checkout@v4 | ||
with: | ||
path: wpt | ||
- name: Checkout Wasm repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: WebAssembly/spec | ||
path: wasm-spec | ||
- name: Setup OCaml | ||
uses: ocaml/setup-ocaml@v3 | ||
with: | ||
ocaml-compiler: 4.14.x | ||
- name: Setup OCaml tools | ||
run: opam install --yes ocamlfind.1.9.5 js_of_ocaml.4.0.0 js_of_ocaml-ppx.4.0.0 | ||
- name: Build interpreter | ||
run: cd wasm-spec/interpreter && opam exec make | ||
- name: Convert WAST tests to WPT | ||
run: wasm-spec/test/build.py --dont-recompile --html wasm-spec/out/ | ||
- name: Copy Wasm tests to WPT | ||
# Replace wasm/core entirely. | ||
run: | | ||
rm -rf wpt/wasm/core | ||
cp -r wasm-spec/out/ wpt/wasm/core/ | ||
- 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 wasm/core/ | ||
git commit -m "$COMMIT_TITLE" | ||
env: | ||
GIT_AUTHOR_NAME: "wpt-pr-bot" | ||
GIT_AUTHOR_EMAIL: "[email protected]" | ||
BRANCH_PREFIX: "wasm-update" | ||
COMMIT_TITLE: "Update Wasm tests" | ||
- name: Create PR | ||
# Check outcome for success as continue-on-error will mask failure. | ||
if: ${{ steps.commit.outcome == 'success' }} | ||
run: | | ||
cd wpt | ||
git push --set-upstream origin $BRANCH_NAME | ||
gh pr create --title "$COMMIT_TITLE" --body "$PR_BODY" --reviewer past | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMMIT_TITLE: "Update Wasm tests" | ||
PR_BODY: "Scheduled weekly update auto-generated by the '${{ github.workflow }}' workflow." |