Fixes for favpro #317
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
Build: | |
runs-on: [ubuntu-22.04] | |
env: | |
FC: gfortran | |
GCC_V: 13 | |
OC_V: 2.10.2 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install fpm | |
uses: fortran-lang/setup-fpm@v5 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup cache for opencoarrays | |
id: cache-opencoarrays | |
uses: actions/cache@v4 | |
with: | |
path: "~/apps/OpenCoarrays/" | |
key: OC-${{ env.OC_V }} | |
- name: Install GFortran | |
run: | | |
sudo apt update | |
sudo apt install -y build-essential gfortran-${GCC_V} g++-${GCC_V} cmake mpich | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ | |
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ | |
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} | |
- name: Maybe install opencoarrays | |
if: steps.cache-opencoarrays.outputs.cache-hit != 'true' | |
run: | | |
wget https://github.com/sourceryinstitute/OpenCoarrays/releases/download/${OC_V}/OpenCoarrays-${OC_V}.tar.gz | |
tar xzvf OpenCoarrays-${OC_V}.tar.gz | |
cd OpenCoarrays-${OC_V} | |
mkdir -p "~/apps/OpenCoarrays/${OC_V}" | |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX="~/apps/OpenCoarrays/${OC_V}" | |
cmake --build build -t install -j | |
echo "${HOME}/apps/OpenCoarrays/${OC_V}/bin" >> $GITHUB_PATH | |
- name: Add to PATH if cache hit | |
if: steps.cache-opencoarrays.outputs.cache-hit == 'true' | |
run: echo "${HOME}/apps/OpenCoarrays/${OC_V}/bin" >> $GITHUB_PATH | |
- name: Build, run, and test | |
run: | | |
which caf | |
caf --show | |
# Build the example executable to test the commandline without caf first, since you cannot spawn new MPI jobs from within an MPI job | |
fpm run --example get-flag-value -- --input-file some_file_name | |
fpm test --compiler caf --runner "cafrun -n 2" |