diff --git a/.github/workflows/cmake-multi-platform.yaml b/.github/workflows/cmake-multi-platform.yaml
index eaba003349a86d92bebde83a74e4b5f4ef347575..bec0d3d2b500a33d8b4777ebc3d47622e02d8ba2 100644
--- a/.github/workflows/cmake-multi-platform.yaml
+++ b/.github/workflows/cmake-multi-platform.yaml
@@ -52,6 +52,13 @@ jobs:
         run: |
           echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
 
+      - name: Install gfortran on macOS
+        if: matrix.os == 'macos-latest' && matrix.f_compiler == 'gfortran' || matrix.os == 'macos-latest' && matrix.c_compiler == 'gcc'
+        run: |
+          brew install gcc
+          echo "Using Homebrew-installed gfortran:"
+          gfortran --version
+
       - name: CMake
         # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
         # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type