| name: Rebaseline Tests | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| rebaseline-tests: | |
| name: Rebaseline Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_TOKEN: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Read emsdk version | |
| id: emsdk_version | |
| run: echo "version=$(cat test/emsdk_version.txt)" >> $GITHUB_OUTPUT | |
| - name: Install emsdk | |
| uses: emscripten-core/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16 | |
| with: | |
| version: ${{ steps.emsdk_version.outputs.version }} | |
| # The version of the emsdk repo that we use here is still not pinned. | |
| # TODO(sbc): Pin (and auto-roll) this revision too. | |
| emsdk-version: main | |
| - name: Set EM_CONFIG | |
| run: | |
| echo "EM_CONFIG=$EMSDK/.emscripten" >> $GITHUB_ENV | |
| - name: pip install | |
| run: | | |
| which python3 | |
| python3 --version | |
| python3 -m pip install -r requirements-dev.txt | |
| - name: Rebaseline tests | |
| env: | |
| REF_NAME: ${{ github.ref_name }} | |
| run: | | |
| git config user.name emscripten-bot | |
| git config user.email emscripten-bot@users.noreply.github.com | |
| ./bootstrap.py | |
| if ./tools/maint/rebaseline_tests.py --new-branch; then | |
| echo "rebaseline_tests returned zero, expectations up-to-date" | |
| # Exit early and don't create a PR | |
| exit 0 | |
| else | |
| code=$? | |
| if [[ $code != 2 ]] ; then | |
| echo "rebaseline_tests.py failed with unexpected error $code (expected 2)" | |
| exit 1 | |
| fi | |
| fi | |
| git push origin rebaseline_tests | |
| gh pr create --fill --base "$REF_NAME" --reviewer sbc100,kripken | |
| gh pr merge --squash --auto |