@@ -10,16 +10,44 @@ jobs:
1010 strategy :
1111 fail-fast : false
1212 matrix :
13- os : [macos-13, macos-14, ubuntu-22.04, ubuntu-24.04]
13+ os : [macos-13, macos-14, macos-15, ubuntu-22.04, ubuntu-24.04]
1414 compiler : [ gfortran ]
1515 version : [ 12, 13, 14 ]
16- extra_flags : [ -ffree-line-length-0 ]
16+ extra_flags : [ -g ]
17+
18+ exclude :
19+ - os : ubuntu-22.04
20+ version : 13 # no package available
21+ - os : ubuntu-22.04
22+ version : 14 # no package available
23+
1724 include :
25+ # --- LLVM flang coverage ---
26+
27+ - os : macos-13
28+ compiler : flang
29+ version : 20
30+ - os : macos-14
31+ compiler : flang
32+ version : 20
33+ - os : macos-15
34+ compiler : flang
35+ version : 20
36+
37+ # https://hub.docker.com/r/snowstep/llvm/tags
38+ - os : ubuntu-24.04
39+ compiler : flang
40+ version : latest
41+ container : snowstep/llvm:noble
42+ - os : ubuntu-22.04
43+ compiler : flang
44+ version : latest
45+ container : snowstep/llvm:jammy
46+
1847 # https://hub.docker.com/r/phhargrove/llvm-flang/tags
1948 - os : ubuntu-24.04
2049 compiler : flang
2150 version : 20
22- extra_flags : -g
2351 container : phhargrove/llvm-flang:20.1.0-1
2452 - os : ubuntu-24.04
2553 compiler : flang
@@ -30,33 +58,28 @@ jobs:
3058# compiler: flang
3159# version: new
3260# container: gmao/llvm-flang:latest
33- # extra_flags: -g
61+
62+ # --- Intel coverage ---
63+
3464 - os : ubuntu-24.04
3565 compiler : ifx
3666 version : 2025.1.0
3767 error_stop_code : 128
38- extra_flags : -g
3968 container : intel/fortran-essentials:2025.1.0-0-devel-ubuntu24.04
4069 # container: intel/oneapi-hpckit:2025.1.0-0-devel-ubuntu24.04
4170 - os : ubuntu-22.04
4271 compiler : ifx
4372 version : 2025.0.0
4473 error_stop_code : 128
45- extra_flags : -g
4674 container : intel/fortran-essentials:2025.0.0-0-devel-ubuntu22.04
4775
48- exclude :
49- - os : ubuntu-22.04
50- version : 13 # no package available
51- - os : ubuntu-22.04
52- version : 14 # no package available
53-
5476 container :
5577 image : ${{ matrix.container }}
5678
5779 env :
58- GCC_VERSION : ${{ matrix.version }}
80+ COMPILER_VERSION : ${{ matrix.version }}
5981 FC : ${{ matrix.compiler }}
82+ FFLAGS : ${{ matrix.extra_flags }}
6083 FPM_FLAGS : --profile release --verbose
6184
6285 steps :
6891 run : |
6992 sudo apt-get update
7093 sudo apt list -a 'gfortran-*'
71- sudo apt install -y gfortran-${GCC_VERSION} build-essential
72- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 \
73- --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_VERSION}
94+ sudo apt install -y gfortran-${COMPILER_VERSION} build-essential
95+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${COMPILER_VERSION} 100 \
96+ --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${COMPILER_VERSION}
97+
98+
99+ - name : Install Ubuntu Container Dependencies
100+ if : ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }}
101+ run : |
102+ set -x
103+ apt update
104+ apt install -y build-essential pkg-config make git curl
105+
106+ - name : Install macOS Dependencies
107+ if : contains(matrix.os, 'macos') && matrix.compiler == 'flang'
108+ run : |
109+ set -x
110+ brew update
111+ brew install llvm@${COMPILER_VERSION} flang
112+ # workaround issue #228: clang cannot find homebrew flang's C header
113+ for p in /opt/homebrew /usr/local $(brew --prefix) ; do find $p/Cellar/flang -name ISO_Fortran_binding.h 2>/dev/null || true ; done
114+ echo "CFLAGS=-I$(dirname $(find $(brew --prefix)/Cellar/flang -name ISO_Fortran_binding.h | head -1)) ${CFLAGS}" >> "$GITHUB_ENV"
115+ # Prepend homebrew clang to PATH:
116+ echo "PATH=$(brew --prefix)/opt/llvm/bin:${PATH}" >> "$GITHUB_ENV"
74117
75118 - name : Setup Compilers
76119 run : |
80123 elif test "$FC" = "ifx" ; then \
81124 echo "FPM_FC=ifx" >> "$GITHUB_ENV" ; \
82125 else \
83- echo "FPM_FC=gfortran-${GCC_VERSION}" >> "$GITHUB_ENV" ; \
126+ echo "FPM_FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV" ; \
127+ echo "FFLAGS=-ffree-line-length-0 $FFLAGS" >> "$GITHUB_ENV" ; \
84128 fi
85129 if test -n "${{ matrix.error_stop_code }}" ; then \
86130 echo "ERROR_STOP_CODE=${{ matrix.error_stop_code }}" >> "$GITHUB_ENV" ; \
@@ -90,12 +134,14 @@ jobs:
90134
91135 - name : Setup FPM
92136 uses : fortran-lang/setup-fpm@main
93- if : ${{ matrix.os != 'macos-14 ' }}
137+ if : ${{ !contains( matrix.os, 'macos') || matrix.os == 'macos-13 ' }}
94138 with :
95139 github-token : ${{ secrets.GITHUB_TOKEN }}
140+ fpm-version : latest
96141
97142 - name : Build FPM
98- if : ${{ matrix.os == 'macos-14' }} # no arm64 fpm distro, build from source
143+ # no macos-arm64 fpm distro, build from source
144+ if : ${{ contains(matrix.os, 'macos') && matrix.os != 'macos-13' }}
99145 run : |
100146 set -x
101147 curl --retry 5 -LOsS https://github.com/fortran-lang/fpm/releases/download/v0.11.0/fpm-0.11.0.F90
@@ -115,22 +161,22 @@ jobs:
115161 - name : Build and Test (Assertions OFF)
116162 run : |
117163 set -x
118- fpm test ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }} "
119- fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }} "
120- fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }} "
164+ fpm test ${FPM_FLAGS} --flag "$FFLAGS "
165+ fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS "
166+ fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "$FFLAGS "
121167
122168 - name : Build and Test (Assertions ON)
123169 env :
124170 FPM_FLAGS : ${{ env.FPM_FLAGS }} --flag -DASSERTIONS
125171 run : |
126172 set -x
127- fpm test ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }} "
128- ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }} " ; test $? = $ERROR_STOP_CODE )
129- ( set +e ; fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }} " ; test $? = $ERROR_STOP_CODE )
173+ fpm test ${FPM_FLAGS} --flag "$FFLAGS "
174+ ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS " ; test $? = $ERROR_STOP_CODE )
175+ ( set +e ; fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "$FFLAGS " ; test $? = $ERROR_STOP_CODE )
130176
131177 - name : Test Assertions w/ Parallel Callbacks
132178 env :
133179 FPM_FLAGS : ${{ env.FPM_FLAGS }} --flag -DASSERTIONS --flag -DASSERT_MULTI_IMAGE --flag -DASSERT_PARALLEL_CALLBACKS
134180 run : |
135181 set -x
136- ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }} " ; test $? = $ERROR_STOP_CODE )
182+ ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS " ; test $? = $ERROR_STOP_CODE )
0 commit comments