9999 strategy :
100100 fail-fast : false
101101 matrix :
102- os : [ubuntu-20.04 ]
102+ os : [ubuntu-latest, macos-latest ]
103103 fc : [ifort]
104104 env :
105+ MACOS_HPCKIT_URL : >-
106+ https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681_offline.dmg
107+ MACOS_FORTRAN_COMPONENTS : >-
108+ intel.oneapi.mac.ifort-compiler
105109 FC : ${{ matrix.fc }}
106110
107111 steps :
@@ -117,7 +121,21 @@ jobs:
117121 if : contains(matrix.os, 'ubuntu')
118122 run : ci/install_cmake.sh
119123
120- - name : Add Intel repository
124+ - name : Prepare for cache restore (OSX)
125+ if : contains(matrix.os, 'macos')
126+ run : |
127+ sudo mkdir -p /opt/intel
128+ sudo chown $USER /opt/intel
129+
130+ - name : Cache Intel install (OSX)
131+ if : contains(matrix.os, 'macos')
132+ id : cache-install
133+ uses : actions/cache@v2
134+ with :
135+ path : /opt/intel/oneapi
136+ key : install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }}
137+
138+ - name : Add Intel repository (Linux)
121139 if : contains(matrix.os, 'ubuntu')
122140 run : |
123141 wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
@@ -126,10 +144,31 @@ jobs:
126144 echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
127145 sudo apt-get update
128146
129- - name : Install Intel oneAPI compiler
147+ - name : Install Intel oneAPI compiler (Linux)
130148 if : contains(matrix.os, 'ubuntu')
131149 run : |
132150 sudo apt-get install intel-oneapi-compiler-fortran
151+
152+ - name : Install Intel oneAPI compiler (OSX)
153+ if : contains(matrix.os, 'macos') && steps.cache-install.outputs.cache-hit != 'true'
154+ run : |
155+ curl --output webimage.dmg --url "$URL" --retry 5 --retry-delay 5
156+ hdiutil attach webimage.dmg
157+ if [ -z "$COMPONENTS" ]; then
158+ sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=.
159+ installer_exit_code=$?
160+ else
161+ sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=.
162+ installer_exit_code=$?
163+ fi
164+ hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
165+ exit $installer_exit_code
166+ env :
167+ URL : ${{ env.MACOS_HPCKIT_URL }}
168+ COMPONENTS : ${{ env.MACOS_FORTRAN_COMPONENTS }}
169+
170+ - name : Setup Intel oneAPI environment
171+ run : |
133172 source /opt/intel/oneapi/setvars.sh
134173 printenv >> $GITHUB_ENV
135174
0 commit comments