tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

update-wasm-tests.yml (2281B)


      1 name: Update Wasm tests
      2 
      3 on:
      4  # Trigger at every Sunday UTC noon, or manually.
      5  schedule:
      6    - cron: 0 12 * * 0
      7  workflow_dispatch:
      8 
      9 jobs:
     10  build-wpt:
     11    runs-on: ubuntu-24.04
     12    steps:
     13      - name: Checkout WPT repo
     14        uses: actions/checkout@v4
     15        with:
     16          path: wpt
     17      - name: Checkout Wasm repo
     18        uses: actions/checkout@v4
     19        with:
     20          repository: WebAssembly/spec
     21          path: wasm-spec
     22      - name: Setup OCaml
     23        uses: ocaml/setup-ocaml@v3
     24        with:
     25          ocaml-compiler: 4.14.x
     26      - name: Setup OCaml tools
     27        run: opam install --yes ocamlfind.1.9.5 js_of_ocaml.4.0.0 js_of_ocaml-ppx.4.0.0
     28      - name: Build interpreter
     29        run: cd wasm-spec/interpreter && opam exec make
     30      - name: Convert WAST tests to WPT
     31        run: wasm-spec/test/build.py --dont-recompile --html wasm-spec/out/
     32      - name: Copy Wasm tests to WPT
     33        # Replace wasm/core entirely, but preserve WEB_FEATURES.yml files.
     34        run: |
     35          rsync -a --delete --exclude 'WEB_FEATURES.yml' wasm-spec/out/ wpt/wasm/core/
     36      - name: Commit changes
     37        id: commit
     38        continue-on-error: true
     39        run: |
     40          cd wpt
     41          export BRANCH_NAME="$BRANCH_PREFIX-$(date +'%Y%m%d%H%M%S')"
     42          echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
     43          git config user.name "$GIT_AUTHOR_NAME"
     44          git config user.email "$GIT_AUTHOR_EMAIL"
     45          git checkout -b $BRANCH_NAME
     46          git add wasm/core/
     47          git commit -m "$COMMIT_TITLE"
     48        env:
     49          GIT_AUTHOR_NAME: "wpt-pr-bot"
     50          GIT_AUTHOR_EMAIL: "wpt-pr-bot@users.noreply.github.com"
     51          BRANCH_PREFIX: "wasm-update"
     52          COMMIT_TITLE: "Update Wasm tests"
     53      - name: Create PR
     54        # Check outcome for success as continue-on-error will mask failure.
     55        if: ${{ steps.commit.outcome == 'success' }}
     56        run: |
     57          cd wpt
     58          git push --set-upstream origin $BRANCH_NAME
     59          gh pr create --title "$COMMIT_TITLE" --body "$PR_BODY" --reviewer jcscottiii,dschuff
     60        env:
     61          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     62          COMMIT_TITLE: "Update Wasm tests"
     63          PR_BODY: "Scheduled weekly update auto-generated by the '${{ github.workflow }}' workflow."