Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ci: use fortran-setup for GCC version testing
  • Loading branch information
gnikit committed Jun 9, 2024
commit 175f1d8e9bb34250e087efd6e2dd457bb5ff7cbb
35 changes: 13 additions & 22 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12]
gcc_v: [10, 11, 12, 13] # Version of GFortran we want to use.
toolchain:
- {compiler: gcc, version: 10}
- {compiler: gcc, version: 11}
- {compiler: gcc, version: 12}
- {compiler: gcc, version: 13}
build: [cmake]
include:
- os: ubuntu-latest
gcc_v: 10
build: cmake-inline
toolchain:
- {compiler: gcc, version: 10}
env:
FC: gfortran-${{ matrix.gcc_v }}
CC: gcc-${{ matrix.gcc_v }}
CXX: g++-${{ matrix.gcc_v }}
GCC_V: ${{ matrix.gcc_v }}
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}

steps:
Expand All @@ -45,22 +46,12 @@ jobs:
- name: Install fypp
run: pip install --upgrade fypp

- name: Install GCC compilers Linux
if: contains( matrix.os, 'ubuntu')
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V} gfortran-${GCC_V}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}

- name: Install GCC compilers macOS
if: contains( matrix.os, 'macos')
run: |
brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
brew link gcc@${GCC_V}
- name: Setup Fortran compiler
uses: fortran-lang/setup-fortran@v1.6.1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Configure with CMake
if: ${{ contains(matrix.build, 'cmake') }}
Expand Down