@@ -21,70 +21,76 @@ jobs:
21
21
strategy :
22
22
fail-fast : false
23
23
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}
26
39
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
43
50
44
51
steps :
45
52
- name : Checkout code
46
53
uses : actions/checkout@v4
47
54
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 }}
81
61
82
62
# Phase 1: Bootstrap fpm with existing version
83
63
- name : Install fpm
84
- uses : fortran-lang/setup-fpm@v5
64
+ uses : fortran-lang/setup-fpm@v7
85
65
with :
86
66
fpm-version : ' v0.8.0'
87
67
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
+
88
94
- name : Remove fpm from path
89
95
shell : bash
90
96
run : |
94
100
- name : Build Fortran fpm (bootstrap)
95
101
shell : bash
96
102
run : |
97
- ${{ env.BOOTSTRAP }} build
103
+ ${{ env.BOOTSTRAP }} build
98
104
99
105
- name : Run Fortran fpm (bootstrap)
100
106
shell : bash
@@ -139,11 +145,6 @@ jobs:
139
145
env :
140
146
REGEX : ' [0-9]\{1,4\}\.[0-9]\{1,4\}\.[0-9]\{1,4\}'
141
147
142
- - name : Build example packages
143
- shell : bash
144
- run : |
145
- ci/run_tests.sh "${{ env.FPM }}"
146
-
147
148
- name : Build Fortran fpm
148
149
shell : bash
149
150
run : |
@@ -173,15 +174,15 @@ jobs:
173
174
rm -v ${{ env.FPM }}
174
175
echo "FPM_RELEASE=${{ env.EXE }}" >> $GITHUB_ENV
175
176
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 }}
177
178
178
179
- name : Run release version
179
180
shell : bash
180
181
run : |
181
182
ci/run_tests.sh "$PWD/${{ env.FPM_RELEASE }}"
182
183
183
184
- name : Upload artifact
184
- uses : actions/upload-artifact@v2
185
+ uses : actions/upload-artifact@v4
185
186
with :
186
187
name : ${{ env.FPM_RELEASE }}
187
188
path : ${{ env.FPM_RELEASE }}
@@ -192,14 +193,19 @@ jobs:
192
193
runs-on : windows-latest
193
194
needs :
194
195
- build
195
-
196
+ strategy :
197
+ fail-fast : false
198
+ matrix :
199
+ gcc_v : [11,12,13]
200
+
196
201
steps :
197
202
- uses : actions/checkout@v4
198
203
199
204
- name : Download Artifacts
200
- uses : actions/download-artifact@v2
205
+ uses : actions/download-artifact@v4
201
206
with :
202
- path : ${{ github.workspace }} # This will download all files
207
+ path : ${{ github.workspace }}
208
+ pattern : fpm-*-windows-*-gcc-${{ matrix.gcc_v }}.exe
203
209
204
210
- name : Get version (normal)
205
211
if : github.event_name != 'release'
@@ -229,7 +235,7 @@ jobs:
229
235
- name : Fetch Windows executable
230
236
shell : msys2 {0}
231
237
run : |
232
- cp fpm-*/fpm* .exe ./ci/fpm.exe
238
+ cp fpm-*/fpm-*-windows-*-gcc-${{ matrix.gcc_v }} .exe ./ci/fpm.exe
233
239
234
240
- name : Fetch Git for Windows
235
241
shell : msys2 {0}
@@ -254,13 +260,13 @@ jobs:
254
260
run : |
255
261
cd ./ci
256
262
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
258
264
259
265
- name : Upload artifact
260
- uses : actions/upload-artifact@v2
266
+ uses : actions/upload-artifact@v4
261
267
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
264
270
265
271
upload-artifacts :
266
272
if : ${{ github.event_name == 'release' && contains(github.ref, 'v') || github.event_name == 'push' }}
@@ -281,27 +287,27 @@ jobs:
281
287
if : ${{ github.event_name == 'push' }}
282
288
283
289
- name : Download Artifacts
284
- uses : actions/download-artifact@v2
290
+ uses : actions/download-artifact@v4
285
291
with :
286
- path : ${{ github.workspace }} # This will download all files
292
+ path : fpm-cd-artifacts
293
+ pattern : ' fpm-*-gcc-12*'
294
+ merge-multiple : true
287
295
288
296
- name : Normalize file names for continuous delivery
289
297
if : ${{ github.event_name == 'push' }}
290
298
run : |
291
- for output in fpm-*/fpm*; do
292
- pushd $(dirname "$output")
299
+ cd fpm-cd-artifacts
300
+ for output in fpm-*; do
293
301
mv -v $(basename $output) $(basename $output | sed -E '${{ env.replace }}')
294
- popd
295
302
done
296
303
env :
297
304
replace : ' s/-([0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g)?[0-9a-f]+//'
298
305
299
306
- name : Create SHA256 checksums
300
307
run : |
301
- for output in fpm-*/fpm*; do
302
- pushd $(dirname "$output")
308
+ cd fpm-cd-artifacts
309
+ for output in fpm-*; do
303
310
sha256sum $(basename "$output") | tee $(basename "$output").sha256
304
- popd
305
311
done
306
312
307
313
- name : Move/Create continuous tag
@@ -315,7 +321,7 @@ jobs:
315
321
if : ${{ github.event_name == 'release' || steps.deploy-on-push.outputs.result != 0 }}
316
322
with :
317
323
repo_token : ${{ secrets.GITHUB_TOKEN }}
318
- file : fpm-*/fpm *
324
+ file : fpm-cd-artifacts/ *
319
325
file_glob : true
320
326
tag : ${{ github.event_name == 'release' && github.ref || 'current'}}
321
327
overwrite : true
0 commit comments