Replies: 1 comment
-
I was looking for Github Actions that are useful to create workflows with Fortran and came across this page. It will be really nice if there is a standard set up for Fortran (as a public action in GitHub Marketplace) that allows something like: jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-20.04, fortran-compiler: gfortran-10 }
- { os: ubuntu-20.04, fortran-compiler: gfortran-11 }
- { os: ubuntu-20.04, fortran-compiler: intel-oneapi-2021.1 }
- { os: macos-10.15, fortran-compiler: gfortran-11 }
- { os: windows-2019, fortran-compiler: gfortran-msys-10 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: fortran-lang/setup-fpm@v3
with:
fpm-version: v0.5.0
# Set up a Fortran compiler and other tools (for example, gcov)
# as well as relevant environment variables like $FPM_FC.
- uses: fortran-lang/setup-fortran@v1
with:
fortran-compiler: ${{ matrix.fortran-compiler }}
- run: fpm test |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am new to github actions and I see quite a few members of the fpm(1) community actively using them so I think it would be very appealing for the community to provide a standard .github directory that contains files for as many platforms as possible that sets up the environments and then does an "fpm test ...." for the debug and release profiles.
Currently my attempt at this, using several other's packages is at [M_time](at https://github.com/urbanjost/M_time) in the .github
directory.
My thought is that fpm users are generally encouraged to use git and github and to create tests in the test/ directory. And there are several on-going projects to provide unit test frameworks as fpm packages. To encourage this further, if these standard github action files are provided for multiple platforms (perhaps along with a STATUS.md file showing the little CI tags) that anyone providing an fpm package on github would merely have to copy the .github directory into their project, perhaps deleting some of the platforms they do not want to use, and they instantly have tests for gfortran on macos, windows, and ubunto; intel tests on ubunto; mingw32 and mingw64 on windows, and msys2 on windows and maybe more (nvfortran is free, but I did not immediately find a setup for it).
One issue, which I think has been mentioned in the fpm forums, is that the default MSWindows environment has gfortran 8, which is a lot of features and bugs ago. I could not find an easy way to install a newer version using the CLI interface the YAML files use.
With what I have working (still in progress) I have been able to do just that -- copy the directory to another repository directory,
do "git add -f .github; git commit -m 'github actions'; git push" and (in projects where I have a good set of tests in test/) I have
automated tests on three platforms with two compilers. Takes about a minute.
I think this is a significant side-benefit of using fpm and the test/ directory and encourages people setting up their repo on github (and hopefully sharing it).
SInce I am just a novice at github actions and YAML I'm hoping there is community support for this and that it becomes a standard feature of fortran-lang/fpm. If not, if anyone has improvements or knows how to use additional platforms let me know and I will set up a fpm-actions repository. This might also be a perfect fpm plugin program, where you could be prompted through which platforms you want to generate and some info for a ford.md file (or doxygen) and within a minute or two a user can add automated multi-platform builds and start developer documentation on their github repository without having to (at least initially) know anything about all the gory details (and there are a lot of them, I am finding out).
Beta Was this translation helpful? Give feedback.
All reactions