Skip to content

Commit d28eee9

Browse files
authored
Merge pull request #69 from bonachea/ci-lfortran-macos
[NO REVIEW] CI: Add LFortran coverage on macos
2 parents 647ea7c + 4a66e2a commit d28eee9

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ jobs:
165165
version: latest
166166
container: ghcr.io/lfortran/lfortran:latest
167167

168+
# https://github.com/fortran-lang/homebrew-fortran
169+
- os: macos-15
170+
compiler: lfortran
171+
version: 0.67.0
172+
- os: macos-26
173+
compiler: lfortran
174+
version: 0.67.0
175+
168176
container:
169177
image: ${{ matrix.container }}
170178

@@ -174,7 +182,7 @@ jobs:
174182
FFLAGS: ${{ matrix.extra_flags }}
175183
FPM_FLAGS: --profile release --verbose
176184
CURL_OPTIONS: --retry 10 --retry-all-errors --fail -L
177-
BREW_WARNING_FILTER: 's/^[[:punct:]]*warning[[:punct:]]*(You are using macOS)/warn: \1/i'
185+
BREW_WARNING_FILTER: 's/^[[:punct:]]+warning[[:punct:]]+/warning: /i'
178186

179187
steps:
180188
- name: Checkout code
@@ -214,7 +222,8 @@ jobs:
214222
chmod +x install-homebrew.sh
215223
env CI=1 ./install-homebrew.sh
216224
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
217-
retry ${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils
225+
retry ${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils \
226+
2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0
218227
ls -al ${HOMEBREW_PREFIX}/bin
219228
echo "PATH=${HOMEBREW_PREFIX}/bin:${PATH}" >> "$GITHUB_ENV"
220229
: Homebrew GCC@15 needs binutils 2.44+
@@ -241,7 +250,8 @@ jobs:
241250
if: ${{ contains(matrix.os, 'macos') }}
242251
run: |
243252
# 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 )
253+
(set +e ; brew untap -f aws/tap hashicorp/tap ; brew trust azure/bicep ) \
254+
2>&1 | perl -pe "$BREW_WARNING_FILTER"
245255
# set some Homebrew knobs to accelerate installation
246256
# but only when we are not simulating the user environment brew-via-install workflow
247257
if [[ -z "${{ matrix.brew_via_install }}" ]] ; then
@@ -254,14 +264,19 @@ jobs:
254264
- name: Install macOS Dependencies
255265
if: contains(matrix.os, 'macos')
256266
run: |
257-
retry brew update
267+
retry brew update \
268+
2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0
258269
# fpm binary distribution for macOS requires gfortran shared libraries from gcc@12
259270
retry brew install gcc@12 \
260271
2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0
261272
if [[ ${{ matrix.compiler }} == 'gfortran' && ${COMPILER_VERSION} -gt 15 ]] ; then
262273
retry brew install gcc@${COMPILER_VERSION} \
263274
2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0
264275
fi
276+
if [[ ${{ matrix.compiler }} == 'lfortran' ]] ; then
277+
retry brew install fortran-lang/fortran/lfortran \
278+
2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0
279+
fi
265280
266281
- name: Install LLVM flang on macOS
267282
if: contains(matrix.os, 'macos') && matrix.compiler == 'flang'

0 commit comments

Comments
 (0)