Skip to content

Commit 7dc2839

Browse files
author
ordo-ci
committed
ci: 🔄 synced local '.github/workflows/' with remote 'workflows/swift'
1 parent ca86751 commit 7dc2839

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

‎.github/workflows/swift-benchmark-delta.yml‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,23 @@ jobs:
5757
continue-on-error: true
5858
run: |
5959
echo $(date) >> $GITHUB_STEP_SUMMARY
60-
swift package ${BENCHMARK_PACKAGE_PATH} benchmark baseline check main pull_request --format markdown >> $GITHUB_STEP_SUMMARY
61-
echo "exitStatus=$?" >> $GITHUB_ENV
60+
swift package ${BENCHMARK_PACKAGE_PATH} benchmark baseline check main pull_request --format markdown >> $GITHUB_STEP_SUMMARY 2>benchmark_stderr
61+
rawExitStatus=$?
62+
cat benchmark_stderr >&2
63+
# SwiftPM maps all non-zero plugin exit codes to 1, so parse stderr to recover the real status
64+
if [ "$rawExitStatus" -eq 0 ]; then
65+
echo "exitStatus=0" >> $GITHUB_ENV
66+
elif grep -q "benchmarkThresholdImprovement" benchmark_stderr; then
67+
echo "exitStatus=4" >> $GITHUB_ENV
68+
elif grep -q "benchmarkThresholdRegression" benchmark_stderr; then
69+
echo "exitStatus=2" >> $GITHUB_ENV
70+
elif grep -q "benchmarkCrashed" benchmark_stderr; then
71+
echo "exitStatus=3" >> $GITHUB_ENV
72+
elif grep -q "baselineNotFound" benchmark_stderr; then
73+
echo "exitStatus=5" >> $GITHUB_ENV
74+
else
75+
echo "exitStatus=$rawExitStatus" >> $GITHUB_ENV
76+
fi
6277
- if: ${{ env.exitStatus == '0' }}
6378
name: Pull request comment text same
6479
run: |
@@ -98,4 +113,9 @@ jobs:
98113
if: ${{ success() || failure() }}
99114
run: |
100115
#/usr/bin/ordo-performance powersave
101-
exit ${{ env.exitStatus }}
116+
# Treat improvement (4) and same-as-baseline (0) as success
117+
if [ "${{ env.exitStatus }}" = "0" ] || [ "${{ env.exitStatus }}" = "4" ]; then
118+
exit 0
119+
else
120+
exit ${{ env.exitStatus }}
121+
fi

0 commit comments

Comments
 (0)