Hi all,
I was wondering if I could address all the issues we’re having in fortran-lang/setup-fortran at once by rewriting the GitHub Action from the ground up and I think it may have worked.
7 Fortran compilers are now supported:
- gfortran (16 to 11)
- ifx (2026.0.0 to 2021.1.1)
- ifort (2021.13 to 2021.1)
- nvfortran (26.3 to 20.11, now supports ubuntu-arm)
- aocc (5.1 to 4.1)
- lfortran (0.63.0 to 0.57.0)
- flang (22 to 16, also on ubuntu-arm and windows-arm)
We don’t have a single huge matrix anymore, instead coverage has been quite expanded and we’re running a test matrix per compiler family. This also allows us to exceed the 256 job limit as that limit is per workflow file. Every compiler has its own file now.
The installations should also be more robust as they are now actually tested (more than a “Hello World” example). The integration tests that run Fortran code are basic, but they now include module linking, the use of iso_fortran_env, some basic math, an implementation of polymorphism (class), c-interop with cpp and iso_c_binding and omp. So every entry that a green check mark means it deterministically passes all these tests (some earlier Flang and lfortran versions have been flagged out for omp and polymorphism).
If hundreds of tests are started at once, it might happen that apt feels like it’s being attacked, hence retries have been added. You still might get rate limiting issues if you start too many jobs at once. Caching has been added for our “big download candidates” (Intel compilers, nvfortran, aocc etc.). The first run might be slower but consecutive runs should be quite fast, however, the biggest limitation here is probably the 10 GB cache that GitHub gives you.
I tried it out in combination with setup-fpm and it works for me, although I think setup-fpm could need some love, too. Next up would probably be adding tests for BLAS/LAPACK.
The Action is written purely in TypeScript now, the Bash script is completely gone, no Python scripts whatsoever.
Please try it out and let me know if it works better for you. Please create an issue with error messages if you have any and I’ll try to address those. Feature requests are always welcome.
This will install gfortran 16 by default:
- uses: minhqdao/setup-fortran@v1
You can see the support matrices and options here:
See here for a real-world example: