99
99
strategy :
100
100
fail-fast : false
101
101
matrix :
102
- os : [ubuntu-20.04 ]
102
+ os : [ubuntu-latest, macos-latest ]
103
103
fc : [ifort]
104
104
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
105
109
FC : ${{ matrix.fc }}
106
110
107
111
steps :
@@ -117,7 +121,21 @@ jobs:
117
121
if : contains(matrix.os, 'ubuntu')
118
122
run : ci/install_cmake.sh
119
123
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)
121
139
if : contains(matrix.os, 'ubuntu')
122
140
run : |
123
141
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
@@ -126,10 +144,31 @@ jobs:
126
144
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
127
145
sudo apt-get update
128
146
129
- - name : Install Intel oneAPI compiler
147
+ - name : Install Intel oneAPI compiler (Linux)
130
148
if : contains(matrix.os, 'ubuntu')
131
149
run : |
132
150
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 : |
133
172
source /opt/intel/oneapi/setvars.sh
134
173
printenv >> $GITHUB_ENV
135
174
0 commit comments