@@ -21,70 +21,76 @@ jobs:
2121 strategy :
2222 fail-fast : false
2323 matrix :
24- os : [ubuntu-latest, macos-11, windows-latest]
25- gcc_v : [10,11,12,13] # Version of GFortran we want to use.
24+ os : [ubuntu-latest, macos-13, windows-latest]
25+ toolchain :
26+ - {compiler: gcc, version: 10}
27+ - {compiler: gcc, version: 11}
28+ - {compiler: gcc, version: 12}
29+ - {compiler: gcc, version: 13}
30+ - {compiler: gcc, version: 14}
31+ - {compiler: intel, version: 2025.1}
32+ exclude :
33+ - os : macos-13 # No Intel on MacOS anymore since 2024
34+ toolchain : {compiler: intel, version: '2025.1'}
35+ - os : windows-latest # Doesn't pass build and tests yet
36+ toolchain : {compiler: intel, version: '2025.1'}
37+ - os : windows-latest # gcc 14 not available on Windows yet
38+ toolchain : {compiler: gcc, version: 14}
2639 include :
27- - os : ubuntu-latest
28- os-arch : linux-x86_64
29- release-flags : --flag '--static -g -fbacktrace -O3'
30-
31- - os : macos-11
32- os-arch : macos-x86_64
33- release-flags : --flag '-g -fbacktrace -O3'
34-
35- - os : windows-latest
36- os-arch : windows-x86_64
37- release-flags : --flag '--static -g -fbacktrace -O3'
38- exe : .exe
39-
40- env :
41- FC : gfortran
42- GCC_V : ${{ matrix.gcc_v }}
40+ - os : ubuntu-latest
41+ os-arch : linux-x86_64
42+ release-flags : --flag '--static -g -fbacktrace -O3'
43+ - os : macos-13
44+ os-arch : macos-x86_64
45+ release-flags : --flag '-g -fbacktrace -O3'
46+ - os : windows-latest
47+ os-arch : windows-x86_64
48+ release-flags : --flag '--static -g -fbacktrace -O3'
49+ exe : .exe
4350
4451 steps :
4552 - name : Checkout code
4653 uses : actions/checkout@v4
4754
48- - name : Install GFortran macOS
49- if : contains(matrix.os, 'macos')
50- run : |
51- ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran
52- which gfortran-${GCC_V}
53- which gfortran
54- # Backport gfortran shared libraries to version 9 folder. This is necessary because all macOS releases of fpm
55- # have these paths hardcoded in the executable (no PIC?). As the gcc ABIs have not changed from 9 to 10, we
56- # can just create symbolic links for now. This can be removed when an updated fpm release is built with gcc-10
57- mkdir /usr/local/opt/gcc@9
58- mkdir /usr/local/opt/gcc@9/lib
59- mkdir /usr/local/opt/gcc@9/lib/gcc
60- mkdir /usr/local/opt/gcc@9/lib/gcc/9
61- mkdir /usr/local/lib/gcc/9
62- ln -fs /usr/local/opt/gcc@${GCC_V}/lib/gcc/${GCC_V}/libquadmath.0.dylib /usr/local/opt/gcc@9/lib/gcc/9/libquadmath.0.dylib
63- ln -fs /usr/local/opt/gcc@${GCC_V}/lib/gcc/${GCC_V}/libgfortran.5.dylib /usr/local/opt/gcc@9/lib/gcc/9/libgfortran.5.dylib
64- ln -fs /usr/local/lib/gcc/${GCC_V}/libgcc_s.1.dylib /usr/local/lib/gcc/9/libgcc_s.1.dylib
65-
66- - name : Install GFortran Linux
67- if : contains(matrix.os, 'ubuntu')
68- run : |
69- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
70- --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
71- --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
72-
73- - name : Install GFortran Windows
74- if : contains(matrix.os, 'windows')
75- run : |
76- Invoke-WebRequest -Uri $Env:GCC_DOWNLOAD -OutFile mingw-w64.zip
77- Expand-Archive mingw-w64.zip
78- echo "$pwd\mingw-w64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
79- env :
80- GCC_DOWNLOAD : " https://github.com/brechtsanders/winlibs_mingw/releases/download/10.4.0-10.0.0-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-10.4.0-mingw-w64msvcrt-10.0.0-r1.zip"
55+ - name : Setup Fortran compiler
56+ uses :
fortran-lang/[email protected] 57+ id : setup-fortran
58+ with :
59+ compiler : ${{ matrix.toolchain.compiler }}
60+ version : ${{ matrix.toolchain.version }}
8161
8262 # Phase 1: Bootstrap fpm with existing version
8363 - name : Install fpm
84- uses : fortran-lang/setup-fpm@v5
64+ uses : fortran-lang/setup-fpm@v7
8565 with :
8666 fpm-version : ' v0.8.0'
8767
68+ # Backport gfortran shared libraries to version 10 folder. This is necessary because the macOS release of fpm
69+ # 0.10.0 used for bootstrapping has these paths hardcoded in the executable.
70+ - name : MacOS patch libgfortran
71+ if : contains(matrix.os, 'macos') && !contains(matrix.toolchain.version, '10')
72+ run : |
73+ which gfortran-${{ matrix.toolchain.version }}
74+ which gfortran
75+ mkdir /usr/local/opt/gcc@10
76+ mkdir /usr/local/opt/gcc@10/lib
77+ mkdir /usr/local/opt/gcc@10/lib/gcc
78+ mkdir /usr/local/opt/gcc@10/lib/gcc/10
79+ mkdir /usr/local/lib/gcc/10
80+ ln -fs /usr/local/opt/gcc@${{ matrix.toolchain.version }}/lib/gcc/${{ matrix.toolchain.version }}/libquadmath.0.dylib /usr/local/opt/gcc@10/lib/gcc/10/libquadmath.0.dylib
81+ ln -fs /usr/local/opt/gcc@${{ matrix.toolchain.version }}/lib/gcc/${{ matrix.toolchain.version }}/libgfortran.5.dylib /usr/local/opt/gcc@10/lib/gcc/10/libgfortran.5.dylib
82+ ln -fs /usr/local/lib/gcc/${{ matrix.toolchain.version }}/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgcc_s.1.dylib
83+
84+ # gcc and g++ will point to clang/clang++: use versioned alias for fpm
85+ - name : MacOS patch C and C++ compilers
86+ if : contains(matrix.os, 'macos')
87+ run : |
88+ echo "CC=gcc-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
89+ echo "FPM_CC=gcc-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
90+ echo "CXX=g++-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
91+ echo "FPM_CXX=g++-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
92+ echo "FPM_LDFLAGS=-lstdc++" >> $GITHUB_ENV
93+
8894 - name : Remove fpm from path
8995 shell : bash
9096 run : |
94100 - name : Build Fortran fpm (bootstrap)
95101 shell : bash
96102 run : |
97- ${{ env.BOOTSTRAP }} build
103+ ${{ env.BOOTSTRAP }} build
98104
99105 - name : Run Fortran fpm (bootstrap)
100106 shell : bash
@@ -139,11 +145,6 @@ jobs:
139145 env :
140146 REGEX : ' [0-9]\{1,4\}\.[0-9]\{1,4\}\.[0-9]\{1,4\}'
141147
142- - name : Build example packages
143- shell : bash
144- run : |
145- ci/run_tests.sh "${{ env.FPM }}"
146-
147148 - name : Build Fortran fpm
148149 shell : bash
149150 run : |
@@ -173,15 +174,15 @@ jobs:
173174 rm -v ${{ env.FPM }}
174175 echo "FPM_RELEASE=${{ env.EXE }}" >> $GITHUB_ENV
175176 env :
176- EXE : fpm-${{ env.VERSION }}-${{ matrix.os-arch }}${{ matrix.exe }}
177+ EXE : fpm-${{ env.VERSION }}-${{ matrix.os-arch }}-gcc-${{ matrix.toolchain.version }} ${{ matrix.exe }}
177178
178179 - name : Run release version
179180 shell : bash
180181 run : |
181182 ci/run_tests.sh "$PWD/${{ env.FPM_RELEASE }}"
182183
183184 - name : Upload artifact
184- uses : actions/upload-artifact@v2
185+ uses : actions/upload-artifact@v4
185186 with :
186187 name : ${{ env.FPM_RELEASE }}
187188 path : ${{ env.FPM_RELEASE }}
@@ -192,14 +193,19 @@ jobs:
192193 runs-on : windows-latest
193194 needs :
194195 - build
195-
196+ strategy :
197+ fail-fast : false
198+ matrix :
199+ gcc_v : [11,12,13]
200+
196201 steps :
197202 - uses : actions/checkout@v4
198203
199204 - name : Download Artifacts
200- uses : actions/download-artifact@v2
205+ uses : actions/download-artifact@v4
201206 with :
202- path : ${{ github.workspace }} # This will download all files
207+ path : ${{ github.workspace }}
208+ pattern : fpm-*-windows-*-gcc-${{ matrix.gcc_v }}.exe
203209
204210 - name : Get version (normal)
205211 if : github.event_name != 'release'
@@ -229,7 +235,7 @@ jobs:
229235 - name : Fetch Windows executable
230236 shell : msys2 {0}
231237 run : |
232- cp fpm-*/fpm* .exe ./ci/fpm.exe
238+ cp fpm-*/fpm-*-windows-*-gcc-${{ matrix.gcc_v }} .exe ./ci/fpm.exe
233239
234240 - name : Fetch Git for Windows
235241 shell : msys2 {0}
@@ -254,13 +260,13 @@ jobs:
254260 run : |
255261 cd ./ci
256262 makensis fpm-installer.nsi
257- move fpm-installer.exe fpm-installer-${{ env.VERSION }}.exe
263+ move fpm-installer.exe fpm-installer-${{ env.VERSION }}-gcc-${{ matrix.gcc_v }} .exe
258264
259265 - name : Upload artifact
260- uses : actions/upload-artifact@v2
266+ uses : actions/upload-artifact@v4
261267 with :
262- name : fpm-installer
263- path : ci/fpm-installer-${{ env.VERSION }}.exe
268+ name : fpm-installer-gcc-${{ matrix.gcc_v }}
269+ path : ci/fpm-installer-${{ env.VERSION }}-gcc-${{ matrix.gcc_v }} .exe
264270
265271 upload-artifacts :
266272 if : ${{ github.event_name == 'release' && contains(github.ref, 'v') || github.event_name == 'push' }}
@@ -281,27 +287,27 @@ jobs:
281287 if : ${{ github.event_name == 'push' }}
282288
283289 - name : Download Artifacts
284- uses : actions/download-artifact@v2
290+ uses : actions/download-artifact@v4
285291 with :
286- path : ${{ github.workspace }} # This will download all files
292+ path : fpm-cd-artifacts
293+ pattern : ' fpm-*-gcc-12*'
294+ merge-multiple : true
287295
288296 - name : Normalize file names for continuous delivery
289297 if : ${{ github.event_name == 'push' }}
290298 run : |
291- for output in fpm-*/fpm*; do
292- pushd $(dirname "$output")
299+ cd fpm-cd-artifacts
300+ for output in fpm-*; do
293301 mv -v $(basename $output) $(basename $output | sed -E '${{ env.replace }}')
294- popd
295302 done
296303 env :
297304 replace : ' s/-([0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g)?[0-9a-f]+//'
298305
299306 - name : Create SHA256 checksums
300307 run : |
301- for output in fpm-*/fpm*; do
302- pushd $(dirname "$output")
308+ cd fpm-cd-artifacts
309+ for output in fpm-*; do
303310 sha256sum $(basename "$output") | tee $(basename "$output").sha256
304- popd
305311 done
306312
307313 - name : Move/Create continuous tag
@@ -315,7 +321,7 @@ jobs:
315321 if : ${{ github.event_name == 'release' || steps.deploy-on-push.outputs.result != 0 }}
316322 with :
317323 repo_token : ${{ secrets.GITHUB_TOKEN }}
318- file : fpm-*/fpm *
324+ file : fpm-cd-artifacts/ *
319325 file_glob : true
320326 tag : ${{ github.event_name == 'release' && github.ref || 'current'}}
321327 overwrite : true
0 commit comments