-
Notifications
You must be signed in to change notification settings - Fork 21
72 lines (63 loc) · 2.71 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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