33on : [push, pull_request]
44
55env :
6- CI : " ON" # We can detect this in the build system and other vendors implement it
76 CMAKE_BUILD_PARALLEL_LEVEL : " 2" # 2 cores on each GHA VM, enable parallel builds
87 CTEST_OUTPUT_ON_FAILURE : " ON" # This way we don't need a flag to ctest
98 CTEST_PARALLEL_LEVEL : " 2"
@@ -21,24 +20,29 @@ jobs:
2120 fail-fast : false
2221 matrix :
2322 os : [ubuntu-latest, macos-latest]
24- gcc_v : [7, 8, 9, 10] # Version of GFortran we want to use.
23+ gcc_v : [9, 10, 11] # Version of GFortran we want to use.
24+ build : [cmake]
25+ include :
26+ - os : ubuntu-latest
27+ gcc_v : 10
28+ build : cmake-inline
29+ - os : ubuntu-latest
30+ gcc_v : 10
31+ build : make
2532 env :
2633 FC : gfortran-${{ matrix.gcc_v }}
2734 GCC_V : ${{ matrix.gcc_v }}
35+ BUILD_DIR : ${{ matrix.build == 'cmake' && 'build' || '.' }}
2836
2937 steps :
3038 - name : Checkout code
31- uses : actions/checkout@v1
39+ uses : actions/checkout@v2
3240
3341 - name : Set up Python 3.x
3442 uses : actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
3543 with :
3644 python-version : 3.x
3745
38- - name : Install CMake Linux
39- if : contains(matrix.os, 'ubuntu')
40- run : ci/install_cmake.sh
41-
4246 - name : Install fypp
4347 run : pip install --upgrade fypp
4448
5054 sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
5155 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
5256 --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
53- --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}
57+ --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
5458
5559 - name : Install GFortran macOS
5660 if : contains( matrix.os, 'macos')
@@ -59,65 +63,82 @@ jobs:
5963 brew link gcc@${GCC_V}
6064
6165 - name : Configure with CMake
66+ if : ${{ contains(matrix.build, 'cmake') }}
6267 run : >-
6368 cmake -Wdev
6469 -DCMAKE_BUILD_TYPE=Release
65- -DCMAKE_MAXIMUM_RANK=4
70+ -DCMAKE_MAXIMUM_RANK:String =4
6671 -DCMAKE_INSTALL_PREFIX=$PWD/_dist
67- -S . -B build
72+ -S . -B ${{ env.BUILD_DIR }}
6873
6974 - name : Build and compile
70- run : cmake --build build
75+ if : ${{ contains(matrix.build, 'cmake') }}
76+ run : cmake --build ${{ env.BUILD_DIR }} --parallel
7177
7278 - name : catch build fail
73- run : cmake --build build --verbose --parallel 1
74- if : failure()
79+ run : cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
80+ if : ${{ failure() && contains(matrix.build, 'cmake') }}
7581
7682 - name : test
77- run : ctest --parallel --output-on-failure
78- working-directory : build
83+ if : ${{ contains(matrix.build, 'cmake') }}
84+ run : >-
85+ ctest
86+ --test-dir ${{ env.BUILD_DIR }}
87+ --parallel
88+ --output-on-failure
89+ --no-tests=error
7990
8091 - name : Install project
81- run : cmake --install build
82-
83- - name : Test in-tree builds
84- if : contains( matrix.gcc_v, '10') # Only test one compiler on each platform
85- run : |
86- cmake -DCMAKE_MAXIMUM_RANK=4 .
87- cmake --build .
88- cmake --build . --target test
92+ if : ${{ contains(matrix.build, 'cmake') }}
93+ run : cmake --install ${{ env.BUILD_DIR }}
8994
9095 - name : Test manual makefiles
91- if : contains(matrix.os, 'ubuntu') && contains( matrix.gcc_v, '10')
96+ if : ${{ matrix.build == 'make' }}
9297 run : |
93- make -f Makefile.manual FYPPFLAGS="-DMAXRANK=4" -j
98+ make -f Makefile.manual -j
9499 make -f Makefile.manual test
95100 make -f Makefile.manual clean
101+ env :
102+ ADD_FYPPFLAGS : " -DMAXRANK=4"
96103
97104 intel-build :
98105 runs-on : ${{ matrix.os }}
99106 strategy :
100107 fail-fast : false
101108 matrix :
102- os : [ubuntu-20.04 ]
109+ os : [ubuntu-latest, macos-latest ]
103110 fc : [ifort]
104111 env :
112+ MACOS_HPCKIT_URL : >-
113+ https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681_offline.dmg
114+ MACOS_FORTRAN_COMPONENTS : >-
115+ intel.oneapi.mac.ifort-compiler
105116 FC : ${{ matrix.fc }}
106117
107118 steps :
108119 - name : Checkout code
109- uses : actions/checkout@v1
120+ uses : actions/checkout@v2
110121
111122 - name : Set up Python 3.x
112123 uses : actions/setup-python@v1
113124 with :
114125 python-version : 3.x
115126
116- - name : Install CMake Linux
117- if : contains(matrix.os, 'ubuntu')
118- run : ci/install_cmake.sh
127+ - name : Prepare for cache restore (OSX)
128+ if : contains(matrix.os, 'macos')
129+ run : |
130+ sudo mkdir -p /opt/intel
131+ sudo chown $USER /opt/intel
119132
120- - name : Add Intel repository
133+ - name : Cache Intel install (OSX)
134+ if : contains(matrix.os, 'macos')
135+ id : cache-install
136+ uses : actions/cache@v2
137+ with :
138+ path : /opt/intel/oneapi
139+ key : install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }}
140+
141+ - name : Add Intel repository (Linux)
121142 if : contains(matrix.os, 'ubuntu')
122143 run : |
123144 wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
@@ -126,10 +147,31 @@ jobs:
126147 echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
127148 sudo apt-get update
128149
129- - name : Install Intel oneAPI compiler
150+ - name : Install Intel oneAPI compiler (Linux)
130151 if : contains(matrix.os, 'ubuntu')
131152 run : |
132153 sudo apt-get install intel-oneapi-compiler-fortran
154+
155+ - name : Install Intel oneAPI compiler (OSX)
156+ if : contains(matrix.os, 'macos') && steps.cache-install.outputs.cache-hit != 'true'
157+ run : |
158+ curl --output webimage.dmg --url "$URL" --retry 5 --retry-delay 5
159+ hdiutil attach webimage.dmg
160+ if [ -z "$COMPONENTS" ]; then
161+ sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=.
162+ installer_exit_code=$?
163+ else
164+ sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=.
165+ installer_exit_code=$?
166+ fi
167+ hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
168+ exit $installer_exit_code
169+ env :
170+ URL : ${{ env.MACOS_HPCKIT_URL }}
171+ COMPONENTS : ${{ env.MACOS_FORTRAN_COMPONENTS }}
172+
173+ - name : Setup Intel oneAPI environment
174+ run : |
133175 source /opt/intel/oneapi/setvars.sh
134176 printenv >> $GITHUB_ENV
135177
@@ -140,7 +182,7 @@ jobs:
140182 run : >-
141183 cmake -Wdev
142184 -DCMAKE_BUILD_TYPE=Release
143- -DCMAKE_MAXIMUM_RANK=4
185+ -DCMAKE_MAXIMUM_RANK:String =4
144186 -DCMAKE_INSTALL_PREFIX=$PWD/_dist
145187 -S . -B build
146188
@@ -152,7 +194,7 @@ jobs:
152194 if : failure()
153195
154196 - name : test
155- run : ctest --parallel --output-on-failure
197+ run : ctest --parallel --output-on-failure --no-tests=error
156198 working-directory : build
157199
158200 - name : Install project
0 commit comments