Translated using Weblate (Japanese) #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: test | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-11, windows-latest] | |
gcc: [10] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install GFortran (MacOS) | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: | | |
brew install gcc@${{ matrix.gcc }} | |
ln -s /usr/local/bin/gfortran-${{ matrix.gcc }} /usr/local/bin/gfortran | |
# Backport gfortran shared libraries to version 9 folder. This is necessary because all macOS releases of fpm | |
# have these paths hardcoded in the executable (no PIC?). As the gcc ABIs have not changed from 9 to 10, we | |
# can just create symbolic links for now. This can be removed when an updated fpm release is built with gcc-10 | |
mkdir /usr/local/opt/gcc@9 | |
mkdir /usr/local/opt/gcc@9/lib | |
mkdir /usr/local/opt/gcc@9/lib/gcc | |
mkdir /usr/local/opt/gcc@9/lib/gcc/9 | |
mkdir /usr/local/lib/gcc/9 | |
ln -fs /usr/local/opt/gcc@${{ matrix.gcc }}/lib/gcc/${{ matrix.gcc }}/libquadmath.0.dylib /usr/local/opt/gcc@9/lib/gcc/9/libquadmath.0.dylib | |
ln -fs /usr/local/opt/gcc@${{ matrix.gcc }}/lib/gcc/${{ matrix.gcc }}/libgfortran.5.dylib /usr/local/opt/gcc@9/lib/gcc/9/libgfortran.5.dylib | |
ln -fs /usr/local/lib/gcc/${{ matrix.gcc }}/libgcc_s.1.dylib /usr/local/lib/gcc/9/libgcc_s.1.dylib | |
- name: Install GFortran (Linux) | |
if: ${{ contains(matrix.os, 'ubuntu') }} | |
run: | | |
sudo update-alternatives \ | |
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 \ | |
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc }} \ | |
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.gcc }} | |
- name: Install GFortran (Windows) | |
if: ${{ contains(matrix.os, 'windows') }} | |
run: | | |
Invoke-WebRequest -Uri ${{ env.DOWNLOAD }} -OutFile mingw-w64.zip | |
Expand-Archive mingw-w64.zip | |
echo "$pwd\mingw-w64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
env: | |
DOWNLOAD: "https://github.com/brechtsanders/winlibs_mingw/releases/download/10.3.0-12.0.0-9.0.0-r2/winlibs-x86_64-posix-seh-gcc-10.3.0-mingw-w64-9.0.0-r2.zip" | |
- name: Setup FPM | |
uses: fortran-lang/setup-fpm@v5 | |
with: | |
fpm-version: 'v0.9.0' | |
- name: Build all projects | |
run: | | |
set -ex | |
for proj in $(find src/ -name fpm.toml) | |
do | |
pushd $(dirname $proj) | |
for profile in ${{env.PROFILES}} | |
do | |
fpm build --profile $profile | |
done | |
popd | |
done | |
shell: bash -l {0} | |
env: | |
PROFILES: debug releae |