Fortran compiler setup for GitHub actions

In addition to fortran-lang/setup-fortran (thank @awvwgk and contributors), I use the following scripts for the GitHub Actions of PRIMA to install Fortran compilers on GitHub-hosted runners.

I also have scripts to install sunf95 and g95 on GitHub-hosted runners even though these compilers are discontinued.

The scripts are naive (e.g., call apt install to install oneapi), and they may take a few minutes to run, which is tolerable in my case.

Here is a concrete workflow that applies them:

https://github.com/s-prima/prima/blob/main/.github/workflows/lint_hosted.yml#L87-L117,

where the Fortran source code of PRIMA is compiled using eight compilers (gfortran, ifort, ifx, nvfortran, AOCC flang, Classic flang, sunf95, and g95) with strict debug options to make sure that no error (of course) or warning is raised (PRIMA does not tolerate any warning).

N.B.: Do not use the scripts on your own computers before examining them. They may make unwanted changes to your system.

4 Likes