Rebaseline Tests #69
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
name: Rebaseline Tests | |
on: | |
workflow_dispatch: | |
# Trigger every day at 3.30 AM PST (= 10:30 AM UTC) | |
schedule: | |
- cron: "30 10 * * *" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
rebaseline-tests: | |
name: Rebaseline Tests | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: pip install | |
run: | | |
which python3 | |
python3 --version | |
python3 -m pip install -r requirements-dev.txt | |
- name: Install emsdk | |
run: | | |
EM_CONFIG=$HOME/emsdk/.emscripten | |
echo $EM_CONFIG | |
curl -# -L -o ~/emsdk-main.tar.gz https://github.com/emscripten-core/emsdk/archive/main.tar.gz | |
tar -C ~ -xf ~/emsdk-main.tar.gz | |
mv ~/emsdk-main ~/emsdk | |
cd ~/emsdk | |
./emsdk install tot | |
./emsdk activate tot | |
echo "JS_ENGINES = [NODE_JS]" >> $EM_CONFIG | |
echo "final config:" | |
cat $EM_CONFIG | |
echo "EM_CONFIG=$EM_CONFIG" >> $GITHUB_ENV | |
- name: Rebaseline tests | |
run: | | |
git config user.name emscripten-bot | |
git config user.email [email protected] | |
./bootstrap | |
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 ${{ github.ref_name }} | |
gh pr merge --squash --auto |