Skip to content

Commit 3543d18

Browse files
authored
Merge pull request #76 from bonachea/ci-linux-gfortran15
[NO REVIEW] CI: Use Homebrew to install gfortran 15 on Ubuntu
2 parents 2c8136d + 543a722 commit 3543d18

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [macos-13, macos-14, macos-15, macos-15-intel, ubuntu-24.04]
16+
os: [ macos-13, macos-14, macos-15, macos-15-intel, ubuntu-24.04 ]
1717
compiler: [ gfortran ]
1818
version: [ 12, 13, 14, 15 ]
1919
extra_flags: [ -g ]
2020

21-
exclude:
22-
- os: ubuntu-24.04
23-
version: 15 # no package available (yet?)
24-
2521
include:
2622
- os: ubuntu-22.04
2723
compiler: gfortran
@@ -140,7 +136,24 @@ jobs:
140136
set -x
141137
sudo apt update
142138
# sudo apt list -a 'gfortran-*'
143-
sudo apt install -y build-essential gfortran-${COMPILER_VERSION}
139+
sudo apt install -y build-essential
140+
if [[ ${COMPILER_VERSION} < 15 ]] ; then \
141+
sudo apt install -y gfortran-${COMPILER_VERSION} ; \
142+
else \
143+
curl -L https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh ; \
144+
chmod +x install-homebrew.sh ; \
145+
env CI=1 ./install-homebrew.sh ; \
146+
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" ; \
147+
${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils ; \
148+
ls -al ${HOMEBREW_PREFIX}/bin ; \
149+
echo "PATH=${HOMEBREW_PREFIX}/bin:${PATH}" >> "$GITHUB_ENV" ; \
150+
: Homebrew GCC@15 needs binutils 2.44+ ; \
151+
HOMEBREW_BINUTILS=$(ls -d ${HOMEBREW_PREFIX}/Cellar/binutils/2.*/bin ) ; \
152+
ls -al ${HOMEBREW_BINUTILS} ; \
153+
echo "FFLAGS=$FFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
154+
echo "CFLAGS=$CFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
155+
echo "CXXFLAGS=$CXXFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
156+
fi
144157
145158
- name: Install Ubuntu Container Dependencies
146159
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }}

0 commit comments

Comments
 (0)