Skip to content

Commit 6e52383

Browse files
committed
CI: Silence all of Homebrew's intrusive/irritating nonsense warnings
Homebrew is waaaaaay too spammy with their warning policy and we're fed up with seeing their harmless warnings polluting our workflow summary. Downgrade all Homebrew warnings to only appear in the log.
1 parent 647ea7c commit 6e52383

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
FFLAGS: ${{ matrix.extra_flags }}
175175
FPM_FLAGS: --profile release --verbose
176176
CURL_OPTIONS: --retry 10 --retry-all-errors --fail -L
177-
BREW_WARNING_FILTER: 's/^[[:punct:]]*warning[[:punct:]]*(You are using macOS)/warn: \1/i'
177+
BREW_WARNING_FILTER: 's/^[[:punct:]]+warning[[:punct:]]+/warning: /i'
178178

179179
steps:
180180
- name: Checkout code
@@ -214,7 +214,8 @@ jobs:
214214
chmod +x install-homebrew.sh
215215
env CI=1 ./install-homebrew.sh
216216
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
217-
retry ${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils
217+
retry ${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils \
218+
2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0
218219
ls -al ${HOMEBREW_PREFIX}/bin
219220
echo "PATH=${HOMEBREW_PREFIX}/bin:${PATH}" >> "$GITHUB_ENV"
220221
: Homebrew GCC@15 needs binutils 2.44+
@@ -241,7 +242,8 @@ jobs:
241242
if: ${{ contains(matrix.os, 'macos') }}
242243
run: |
243244
# silence Homebrew tap trust warnings:
244-
(set +e ; brew untap -f aws/tap hashicorp/tap 2>&1 | perl -pe 's/^::*//;s/^##*//' ; brew trust azure/bicep ; echo )
245+
(set +e ; brew untap -f aws/tap hashicorp/tap ; brew trust azure/bicep ) \
246+
2>&1 | perl -pe "$BREW_WARNING_FILTER"
245247
# set some Homebrew knobs to accelerate installation
246248
# but only when we are not simulating the user environment brew-via-install workflow
247249
if [[ -z "${{ matrix.brew_via_install }}" ]] ; then
@@ -254,7 +256,8 @@ jobs:
254256
- name: Install macOS Dependencies
255257
if: contains(matrix.os, 'macos')
256258
run: |
257-
retry brew update
259+
retry brew update \
260+
2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0
258261
# fpm binary distribution for macOS requires gfortran shared libraries from gcc@12
259262
retry brew install gcc@12 \
260263
2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0

0 commit comments

Comments
 (0)