Skip to content

Commit 66c0a02

Browse files
authored
[ci] Add expectations check for PR branch (#23226)
See #23146
1 parent c4ecb13 commit 66c0a02

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,32 @@ jobs:
5555
cat $EM_CONFIG
5656
- name: Check test expectations on target branch
5757
run: |
58+
echo "Checking out ${{ github.base_ref }}"
5859
git checkout ${{ github.base_ref }}
5960
git rev-parse HEAD
6061
# Hack to honor changes to rebaseline_tests.py in the current PR
6162
git checkout - ./tools/maint/rebaseline_tests.py
6263
./bootstrap
6364
if ! ./tools/maint/rebaseline_tests.py --check-only; then
6465
echo "Test expectations are out-of-date on the target branch."
65-
echo "You can run `./tools/maint/rebaseline_tests.py --new-branch`"
66+
echo "You can run './tools/maint/rebaseline_tests.py --new-branch'"
6667
echo "and use it to create a seperate PR."
68+
echo "-- This failure is only a warning and can be ignored"
69+
exit 1
70+
fi
71+
- name: Check test expectations on PR branch
72+
run: |
73+
echo "Checking out ${{ github.ref }} (${{ github.sha }})"
74+
# For some reason we cannot pass ${{ github.ref }} direclty to git
75+
# since it doesn't recognise it.
76+
git checkout ${{ github.sha }}
77+
git rev-parse HEAD
78+
./bootstrap
79+
if ! ./tools/maint/rebaseline_tests.py --check-only --clear-cache; then
80+
echo "Test expectations are out-of-date on the PR branch."
81+
echo "You can run './tools/maint/rebaseline_tests.py' to"
82+
echo "create a commit updating the expectations."
83+
echo "Be sure to have `emsdk install tot` first."
84+
echo "-- This failure is only a warning and can be ignored"
6785
exit 1
6886
fi

tools/maint/rebaseline_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def main(argv):
7171
args = parser.parse_args()
7272

7373
if args.clear_cache:
74-
run(['emcc', '--clear-cache'])
74+
run(['./emcc', '--clear-cache'])
7575

7676
if not args.skip_tests:
7777
if not args.check_only and run(['git', 'status', '-uno', '--porcelain']).strip():

0 commit comments

Comments
 (0)