Set up Fortran compiler toolchains for GitHub Actions. Supports GNU, Intel, LLVM, NVIDIA, AMD, Arm, and LFortran compilers across Linux, macOS, and Windows.
Migrating from v1 requires only a few changes:
- The legacy compiler names
gcc,intel,intel-classic, andnvidia-hpcremain supported as compatibility aliases. Migrating to the canonical names is recommended. ifxconfigurations on macOS were previously redirected toifort. This behavior is no longer supported;ifxon macOS will fail. Remove these configurations from your workflow matrices.- In 2022, oneAPI release numbers differed from compiler version numbers. For example, oneAPI
2022.1on Windows installedifxversion2022.2.0. Compiler versions are now used consistently, so2022.1is no longer listed as a supported version. Use2022.2.0instead.
- uses: minhqdao/setup-fortran@v2
with:
compiler: <compiler>
version: <version>| Input | Description | Default |
|---|---|---|
compiler |
Compiler to install (gfortran, ifx, ifort, nvfortran, aocc, lfortran, flang, armflang) |
gfortran |
version |
Compiler version to install. Enclose the version string in quotation marks (e.g. "2026.1.1" or "0.64.0") |
latest |
msystem |
Windows toolchain environment (native, ucrt64, clang64) |
native |
cleanup-disk |
Free up disk space by removing large pre-installed toolkits during nvfortran setup (true, false) |
false |
update-environment |
Whether to export toolchain environment variables (FC, CC, CXX, FPM_*, F77, F90, FORTRAN_COMPILER) into the runner environment (true, false) |
true |
For compatibility with fortran-lang/setup-fortran, the legacy names gcc,
intel, intel-classic, and nvidia-hpc are accepted as aliases for
gfortran, ifx, ifort, and nvfortran, respectively. Aliases do not
change based on platform; for example, intel always resolves to ifx.
Use of the canonical names is recommended.
| Version | ubuntu-24.04 | ubuntu-22.04 | ubuntu-24.04-arm | ubuntu-22.04-arm | macos-26 | macos-26-intel | macos-15 | macos-15-intel | macos-14 | windows-2025 | windows-2022 | windows-2025 (ucrt64) | windows-2022 (ucrt64) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| latest | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 16 | β | β | β | β | β | β | β | β | β | β | β | ||
| 15 | β | β | β | β | β | β | β | β | β | β | β | ||
| 14 | β | β | β | β | β | β | β | β | β | β | β | ||
| 13 | β | β | β | β | β | β | β | β | β | β | β | ||
| 12 | β | β | β | β | β | β | β | β | β | β | β | ||
| 11 | β | β | β | β | β | β | β | β | β | β | β |
| Version | ubuntu-24.04 | ubuntu-22.04 | windows-2025 | windows-2022 |
|---|---|---|---|---|
| latest | β | β | β | β |
| 2026.1.1 | β | β | ||
| 2026.1.0 | β | β | ||
| 2026.1 | β | β | β | β |
| 2026.0 | β | β | β | β |
| 2025.3.3 | β | β | ||
| 2025.3.2 | β | β | ||
| 2025.3.1 | β | β | ||
| 2025.3.0 | β | β | ||
| 2025.3 | β | β | β | β |
| 2025.2.1 | β | β | ||
| 2025.2.0 | β | β | ||
| 2025.2 | β | β | β | β |
| 2025.1.0 | β | β | ||
| 2025.1 | β | β | β | β |
| 2025.0.0 | β | β | ||
| 2025.0 | β | β | β | β |
| 2024.2.1 | β | β | ||
| 2024.2.0 | β | β | ||
| 2024.2 | β | β | β | β |
| 2024.1.0 | β | β | ||
| 2024.1 | β | β | β | β |
| 2024.0.2 | β | β | ||
| 2024.0.1 | β | β | ||
| 2024.0 | β | β | β | β |
| 2023.2.4 | β | β | ||
| 2023.2.3 | β | β | ||
| 2023.2.2 | β | β | ||
| 2023.2.1 | β | β | β | β |
| 2023.2.0 | β | β | β | β |
| 2023.2 | β | β | β | β |
| 2023.1.0 | β | β | β | β |
| 2023.1 | β | β | β | β |
| 2023.0.0 | β | β | ||
| 2023.0 | β | β | ||
| 2022.3.0 | β | β | ||
| 2022.3 | β | β | ||
| 2022.2.1 | β | β | ||
| 2022.2.0 | β | β | β | β |
| 2022.2 | β | β | β | β |
| 2022.1.0 | β | β | ||
| 2022.1 | β | β | ||
| 2022.0.2 | β | β | ||
| 2022.0.1 | β | β | ||
| 2022.0 | β | β | ||
| 2021.4.0 | β | β | ||
| 2021.4 | β | β | ||
| 2021.3.0 | β | β | ||
| 2021.3 | β | β | ||
| 2021.2.0 | β | β | ||
| 2021.2 | β | β | ||
| 2021.1.2 | β | β | ||
| 2021.1.1 | β | β | ||
| 2021.1 | β | β |
In 2022,
ifxcompiler version numbers differed from oneAPI release numbers. Specify the compiler version here, not the oneAPI release number.
| Version | ubuntu-24.04 | ubuntu-22.04 | macos-26 | macos-15 | macos-14 | macos-26-intel | macos-15-intel | windows-2025 | windows-2022 |
|---|---|---|---|---|---|---|---|---|---|
| latest | β | β | β | β | β | β | β | β | β |
| 2021.13 | β | β | β | β | |||||
| 2021.12 | β | β | β | β | |||||
| 2021.11 | β | β | β | β | |||||
| 2021.10 | β | β | β | β | β | β | β | β | β |
| 2021.9 | β | β | β | β | β | β | β | β | |
| 2021.8 | β | β | β | β | β | β | |||
| 2021.7.1 | β | β | |||||||
| 2021.7 | β | β | β | β | |||||
| 2021.6 | β | β | β | β | β | β | β | β | |
| 2021.5 | β | β | β | β | β | β | |||
| 2021.4 | β | β | |||||||
| 2021.3 | β | β | β | β | β | β | |||
| 2021.2 | β | β | β | β | β | β | |||
| 2021.1.2 | β | β | |||||||
| 2021.1 | β | β | β | β | β | β |
Intel ships
ifortfor macOS as x86_64 binaries. On ARM64 runners they run under Rosetta 2, which the action verifies (and installs if missing) before installation. To keep companion C/C++ objects linkable there, the action exportsCFLAGS,CXXFLAGS, andLDFLAGSwith-arch x86_64.
| Version | ubuntu-24.04 | ubuntu-22.04 | ubuntu-24.04-arm | ubuntu-22.04-arm |
|---|---|---|---|---|
| latest | β | β | β | β |
| 26.5 | β | β | β | β |
| 26.3 | β | β | β | β |
| 26.1 | β | β | β | β |
| 25.11 | β | β | β | β |
| 25.9 | β | β | β | β |
| 25.7 | β | β | β | β |
| 25.5 | β | β | β | β |
| 25.3 | β | β | β | β |
| 25.1 | β | β | β | β |
| 24.11 | β | β | β | β |
| 24.9 | β | β | β | β |
| 24.7 | β | β | β | β |
| 24.5 | β | β | β | β |
| 24.3 | β | β | β | β |
| 24.1 | β | β | β | β |
| 23.11 | β | β | β | β |
| 23.9 | β | β | β | β |
| 23.7 | β | β | β | β |
| 23.5 | β | β | β | β |
| 23.3 | β | β | β | β |
| 23.1 | β | β | β | β |
| 22.11 | β | β | β | β |
| 22.9 | β | β | β | β |
| 22.7 | β | β | β | β |
| 22.5 | β | β | β | β |
| 22.3 | β | β | β | β |
| 22.2 | β | β | β | β |
| 22.1 | β | β | β | β |
| 21.11 | β | β | β | β |
| 21.9 | β | β | β | β |
| 21.7 | β | β | β | β |
| 21.5 | β | β | β | β |
| 21.3 | β | β | β | β |
| 21.2 | β | β | β | β |
| 21.1 | β | β | β | β |
| 20.11 | β | β | β | β |
| 20.9 | β | β | β | β |
| 20.7 | β | β | β | β |
| Version | ubuntu-24.04 | ubuntu-22.04 |
|---|---|---|
| latest | β | β |
| 5.2 | β | β |
| 5.1 | β | β |
| 5.0 | β | β |
| 4.2 | β | β |
| 4.1 | β | β |
| Version | ubuntu-24.04 | ubuntu-22.04 | ubuntu-24.04-arm | ubuntu-22.04-arm | macos-26 | macos-26-intel | macos-15 | macos-15-intel | macos-14 | windows-2025 | windows-2022 | windows-2025 (ucrt64) | windows-2022 (ucrt64) | windows-2025 (clang64) | windows-2022 (clang64) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| latest | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0.65.0 | β | β | β | β | β | β | β | β | β | β | β | ||||
| 0.64.0 | β | β | β | β | β | β | β | β | β | β | β | ||||
| 0.63.0 | β | β | β | β | β | β | β | β | β | ||||||
| 0.62.0 | β | β | β | β | β | β | β | β | β | ||||||
| 0.61.0 | β | β | β | β | β | β | β | β | β | ||||||
| 0.60.0 | β | β | β | β | β | β | β | β | β | ||||||
| 0.59.0 | β | β | β | β | β | β | β | β | β | ||||||
| 0.58.0 | β | β | β | β | β | β | β | β | β | ||||||
| 0.57.0 | β | β | β | β | β | β | β | β | β |
| Version | ubuntu-24.04 | ubuntu-22.04 | ubuntu-24.04-arm | ubuntu-22.04-arm | macos-26 | macos-26-intel | macos-15 | macos-15-intel | macos-14 | windows-2025 | windows-2022 | windows-11-arm | windows-2025 (ucrt64) | windows-2022 (ucrt64) | windows-2025 (clang64) | windows-2022 (clang64) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| latest | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 23 | β | β | β | β | β | |||||||||||
| 22 | β | β | β | β | β | β | β | |||||||||
| 21 | β | β | β | β | β | β | β | |||||||||
| 20 | β | β | β | β | β | β | β | |||||||||
| 19 | β | β | β | β | β | β | β | β | ||||||||
| 18 | β | β | β | β | ||||||||||||
| 17 | β | β | β | β | ||||||||||||
| 16 | β |
Specific patch versions (e.g.
21.1.6) are supported on macOS and native Windows runners and validated against available GitHub releases. Patch versions are not individually tested.
| Version | ubuntu-24.04-arm | ubuntu-22.04-arm |
|---|---|---|
| latest | β | β |
| 22.1 | β | β |
| 21.1 | β | β |
| 20.1 | β | β |
steps:
- uses: actions/checkout@v7
- uses: minhqdao/setup-fortran@v2
- run: ${{ env.FC }} hello.f90If omitted, compiler defaults to gfortran and version to the latest
supported version for the platform.
- uses: minhqdao/setup-fortran@v2
with:
compiler: lfortran
version: "0.65.0"strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain:
- { compiler: gfortran, version: "15" }
- { compiler: ifx, version: "2026.1" }
- { compiler: lfortran, version: "0.65.0" }
exclude:
- os: macos-latest
toolchain: { compiler: ifx, version: "2026.1" }
include:
- os: windows-11-arm
toolchain: { compiler: flang, version: "22" }
jobs:
test:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: minhqdao/setup-fortran@v2
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- run: ${{ env.FC }} hello.f90- uses: minhqdao/setup-fortran@v2
with:
compiler: lfortran
msystem: ucrt64| Output | Description |
|---|---|
version |
Resolved version of the installed compiler |
fc |
Command or path to the Fortran compiler |
cc |
Command or path to the C compiler |
cxx |
Command or path to the C++ compiler |
| Variable | Description |
|---|---|
FC |
Command or path to the Fortran compiler |
CC |
Command or path to the C compiler |
CXX |
Command or path to the C++ compiler |
FPM_FC |
Command or path to the Fortran compiler for fpm |
FPM_CC |
Command or path to the C compiler for fpm |
FPM_CXX |
Command or path to the C++ compiler for fpm |
F77 |
Command or path to the Fortran compiler (alias for FC) |
F90 |
Command or path to the Fortran compiler (alias for FC) |
Requires Node.js 24 or newer (.nvmrc pins the version CI uses).
Install dependencies with npm ci.
Run npm run all to format and lint the source, run unit tests, bundle the
action into dist, and run the smoke tests.
Commit changes to dist together with the source changes, as GitHub Actions
executes the bundled code from this directory.
- Add the version to
SUPPORTED_VERSIONSin the respective installation script (latest first). - Add the version to the CI matrix for that compiler.
- Update the README.
- Run
npm run allβ it will fail if the version isn't tested or documented.
Compilers have separate installation scripts for each platform they support.
Report bugs and feature requests in the issue tracker.