forked from async-aws/aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flysystem BC test (async-aws#481)
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/Integration/Flysystem/S3/.github/workflows/bc.entrypoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh -l | ||
|
||
# | ||
# This file is a hack to suppress warnings from Roave BC check | ||
# | ||
|
||
composer install | ||
|
||
# Capture output to variable AND print it | ||
exec 4711>&1 | ||
OUTPUT=$(/composer/vendor/bin/roave-backward-compatibility-check 2>&1 | tee /dev/fd/4711) | ||
|
||
# Remove rows we want to suppress | ||
OUTPUT=`echo "$OUTPUT" | sed '/Roave\\\BetterReflection\\\Reflection\\\ReflectionClass "League\\\Flysystem\\\Adapter\\\AbstractAdapter" could not be found in the located source/'d` | ||
|
||
# Number of rows we found with "[BC]" in them | ||
BC_BREAKS=`echo "$OUTPUT" | grep -o '\[BC\]' | wc -l | awk '{ print $1 }'` | ||
|
||
# The last row of the output is "X backwards-incompatible changes detected". Find X. | ||
STATED_BREAKS=`echo "$OUTPUT" | tail -n 1 | awk -F' ' '{ print $1 }'` | ||
|
||
# If | ||
# We found "[BC]" in the command output after we removed suppressed lines | ||
# OR | ||
# We have suppressed X number of BC breaks. If $STATED_BREAKS is larger than X | ||
# THEN | ||
# exit 1 | ||
|
||
if [ $BC_BREAKS -gt 0 ] || [ $STATED_BREAKS -gt 7 ]; then | ||
echo "EXIT 1" | ||
exit 1 | ||
fi | ||
|
||
# No BC breaks found | ||
echo "EXIT 0" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters