Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Add expectations check for PR branch #23226

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,32 @@ 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
git checkout - ./tools/maint/rebaseline_tests.py
./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
2 changes: 1 addition & 1 deletion tools/maint/rebaseline_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
Loading