This repository was archived by the owner on Aug 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh -l
2
+
3
+ #
4
+ # This file is a hack to suppress warnings from Roave BC check
5
+ #
6
+
7
+ composer install
8
+
9
+ # Capture output to variable AND print it
10
+ exec 4711>&1
11
+ OUTPUT=$( /composer/vendor/bin/roave-backward-compatibility-check 2>&1 | tee /dev/fd/4711)
12
+
13
+ # Remove rows we want to suppress
14
+ OUTPUT=` echo " $OUTPUT " | sed ' /Roave\\\BetterReflection\\\Reflection\\\ReflectionClass "Swift_Transport" could not be found in the located source/' d`
15
+
16
+ # Number of rows we found with "[BC]" in them
17
+ BC_BREAKS=` echo " $OUTPUT " | grep -o ' \[BC\]' | wc -l | awk ' { print $1 }' `
18
+
19
+ # The last row of the output is "X backwards-incompatible changes detected". Find X.
20
+ STATED_BREAKS=` echo " $OUTPUT " | tail -n 1 | awk -F' ' ' { print $1 }' `
21
+
22
+ # If
23
+ # We found "[BC]" in the command output after we removed suppressed lines
24
+ # OR
25
+ # We have suppressed X number of BC breaks. If $STATED_BREAKS is larger than X
26
+ # THEN
27
+ # exit 1
28
+
29
+ if [ $BC_BREAKS -gt 0 ] || [ $STATED_BREAKS -gt 6 ]; then
30
+ echo " EXIT 1"
31
+ exit 1
32
+ fi
33
+
34
+ # No BC breaks found
35
+ echo " EXIT 0"
36
+ exit 0
Original file line number Diff line number Diff line change 25
25
26
26
- name : Roave BC Check
27
27
uses : docker://nyholm/roave-bc-check-ga
28
+ with :
29
+ entrypoint : ./.github/workflows/bc.entrypoint
You can’t perform that action at this time.
0 commit comments