Skip to content

Commit 63df1a1

Browse files
authored
Update .github/workflows/rebaseline-tests.yml (#23803)
1 parent 961c40e commit 63df1a1

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
# Hack to honor changes to rebaseline_tests.py in the current PR
6565
git checkout - ./tools/maint/rebaseline_tests.py
6666
./bootstrap
67-
if ./tools/maint/rebaseline_tests.py --check-only; then
67+
if ! ./tools/maint/rebaseline_tests.py --check-only; then
6868
echo "Test expectations are out-of-date on the target branch."
6969
echo "You can run './tools/maint/rebaseline_tests.py --new-branch'"
7070
echo "and use it to create a seperate PR."
@@ -79,7 +79,7 @@ jobs:
7979
git checkout ${{ github.sha }}
8080
git rev-parse HEAD
8181
./bootstrap
82-
if ./tools/maint/rebaseline_tests.py --check-only --clear-cache; then
82+
if ! ./tools/maint/rebaseline_tests.py --check-only --clear-cache; then
8383
echo "Test expectations are out-of-date on the PR branch."
8484
echo "You can run './tools/maint/rebaseline_tests.py' to"
8585
echo "create a commit updating the expectations."

.github/workflows/rebaseline-tests.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,18 @@ jobs:
3939
run: |
4040
git config user.name emscripten-bot
4141
git config user.email emscripten-bot@users.noreply.github.com
42-
#echo "TEST" >> README.md
43-
#git add README.md
44-
#git checkout -b testing ${{ github.ref_name }}
45-
#git commit -m "Testing"
4642
./bootstrap
47-
./tools/maint/rebaseline_tests.py
43+
if ./tools/maint/rebaseline_tests.py; then
44+
echo "rebaseline_tests returned zero, expectations up-to-date"
45+
exit 0
46+
fi
47+
code=$?
48+
if [[ $code != 2 ]] ; then
49+
echo "rebaseline_tests.py failed with unexpected error $code"
50+
exit 1
51+
fi
4852
- name: Create PR
49-
id: cpr
5053
run: |
5154
git push origin testing
5255
gh pr create --fill --base ${{ github.ref_name }}
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
- name: Enable auto-merge
56-
run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}"
57-
env:
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
gh pr merge --squash --auto

tools/maint/rebaseline_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def main():
8989

9090
if not filenames:
9191
print('test expectations are up-to-date')
92-
return 1
92+
return 0
9393

9494
if args.check_only:
9595
message = f'''Test expectations are out-of-date
@@ -120,14 +120,14 @@ def main():
120120

121121
print(message)
122122
if args.check_only:
123-
return 0
123+
return 1
124124

125125
if args.new_branch:
126126
run(['git', 'checkout', '-b', 'rebaseline_tests'])
127127
run(['git', 'add', '-u', '.'])
128128
run(['git', 'commit', '-F', '-'], input=message)
129129

130-
return 0
130+
return 2
131131

132132

133133
if __name__ == '__main__':

0 commit comments

Comments
 (0)