From 66c0a02884b74e9c726e26f46f5af1c47557ddbc Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 19 Dec 2024 13:35:22 -0800 Subject: [PATCH] [ci] Add expectations check for PR branch (#23226) See #23146 --- .github/workflows/ci.yml | 20 +++++++++++++++++++- tools/maint/rebaseline_tests.py | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 821915ea44462..f6b1abea01ce7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,7 @@ jobs: cat $EM_CONFIG - name: Check test expectations on target branch run: | + echo "Checking out ${{ github.base_ref }}" git checkout ${{ github.base_ref }} git rev-parse HEAD # Hack to honor changes to rebaseline_tests.py in the current PR @@ -62,7 +63,24 @@ jobs: ./bootstrap if ! ./tools/maint/rebaseline_tests.py --check-only; then echo "Test expectations are out-of-date on the target branch." - echo "You can run `./tools/maint/rebaseline_tests.py --new-branch`" + echo "You can run './tools/maint/rebaseline_tests.py --new-branch'" echo "and use it to create a seperate PR." + echo "-- This failure is only a warning and can be ignored" + exit 1 + fi + - name: Check test expectations on PR branch + run: | + echo "Checking out ${{ github.ref }} (${{ github.sha }})" + # For some reason we cannot pass ${{ github.ref }} direclty to git + # since it doesn't recognise it. + git checkout ${{ github.sha }} + git rev-parse HEAD + ./bootstrap + if ! ./tools/maint/rebaseline_tests.py --check-only --clear-cache; then + echo "Test expectations are out-of-date on the PR branch." + echo "You can run './tools/maint/rebaseline_tests.py' to" + echo "create a commit updating the expectations." + echo "Be sure to have `emsdk install tot` first." + echo "-- This failure is only a warning and can be ignored" exit 1 fi diff --git a/tools/maint/rebaseline_tests.py b/tools/maint/rebaseline_tests.py index 307af1cda61e1..151a37ef5f3e0 100755 --- a/tools/maint/rebaseline_tests.py +++ b/tools/maint/rebaseline_tests.py @@ -71,7 +71,7 @@ def main(argv): args = parser.parse_args() if args.clear_cache: - run(['emcc', '--clear-cache']) + run(['./emcc', '--clear-cache']) if not args.skip_tests: if not args.check_only and run(['git', 'status', '-uno', '--porcelain']).strip():