-
Notifications
You must be signed in to change notification settings - Fork 22
/
action.yml
75 lines (67 loc) · 3.75 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: "dependencies"
description: "macos and linux dependencies"
# Note: needs GCC > 12, and sudo, wherever you're building
# Using gcc-11 will return a bug when compiling gas/wavelengths_gas.f90
runs:
using: "composite"
steps:
# Each OS has some quirk for each compiler, so these 4 steps deal with those
- name: install wget (GNU / linux)
if: matrix.compiler == 'gfortran' && matrix.os == 'linux'
shell: bash
run: dnf install -y sudo wget epel-release
- name: install intel compilers (intel / linux)
if: matrix.compiler == 'ifort' && matrix.os == 'linux'
shell: bash
run: |
wget -nv https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ebf5d9aa-17a7-46a4-b5df-ace004227c0e/l_dpcpp-cpp-compiler_p_2023.2.1.8_offline.sh &
wget -nv https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0d65c8d4-f245-4756-80c4-6712b43cf835/l_fortran-compiler_p_2023.2.1.8_offline.sh &
wait
chmod +x l_dpcpp-cpp-compiler_p_2023.2.1.8_offline.sh
./l_dpcpp-cpp-compiler_p_2023.2.1.8_offline.sh -a --silent --eula accept
chmod +x l_fortran-compiler_p_2023.2.1.8_offline.sh
./l_fortran-compiler_p_2023.2.1.8_offline.sh -a --silent --eula accept
echo "INTEL_PATH=/home/runner/intel/oneapi" >> "$GITHUB_ENV"
sudo chown root /bin/tar && sudo chmod u+s /bin/tar # tar needs to run as root to extract when restoring the cache
- name: fix gcc issue on the runner (GNU / macos)
if: matrix.compiler == 'gfortran' && matrix.os == 'macos'
shell: bash
run: |
brew reinstall gcc@13
ln -s /usr/local/bin/gcc-13 /usr/local/bin/gcc
ln -s /usr/local/bin/g++-13 /usr/local/bin/g++
ln -s /usr/local/bin/gfortran-13 /usr/local/bin/gfortran
- name: install intel compilers (intel / macos)
if: matrix.compiler == 'ifort' && matrix.os == 'macos'
shell: bash
run: |
wget -nv https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2fbce033-15f4-4e13-8d14-f5a2016541ce/m_fortran-compiler-classic_p_2023.2.0.49001_offline.dmg &
wget -nv https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ebba13f8-1690-4d30-9d43-1e2fa2d536cd/m_cpp-compiler-classic_p_2023.2.0.48999_offline.dmg &
wait
hdiutil attach m_fortran-compiler-classic_p_2023.2.0.49001_offline.dmg
sudo /Volumes/m_fortran-compiler-classic_p_2023.2.0.49001_offline/bootstrapper.app/Contents/MacOS/install.sh --silent --eula accept
hdiutil attach m_cpp-compiler-classic_p_2023.2.0.48999_offline.dmg
sudo /Volumes/m_cpp-compiler-classic_p_2023.2.0.48999_offline/bootstrapper.app/Contents/MacOS/install.sh --silent --eula accept
echo "INTEL_PATH=/opt/intel/oneapi" >> "$GITHUB_ENV"
# Cache other dependencies for mcfost to avoid downloading/installing them each time this workflow runs
- name: cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: |
${{ env.MCFOST_INSTALL }}/include
${{ env.MCFOST_INSTALL }}/lib/${{ matrix.compiler }}
key: mcfost-deps-${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('lib/install.sh') }}
- name: unset setuid bit for tar if cache not found
if: matrix.compiler == 'ifort' && matrix.os == 'linux' && steps.cache-deps.outputs.cache-hit != 'true'
shell: bash
run: sudo chmod u-s /bin/tar
# Only do this (lengthy) setup if dependency cache not found
- name: prepare mcfost environment
if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
shell: bash -e {0}
working-directory: lib
run: |
[ ! "$SETVARS_COMPLETED" == 1 ] && test -f "$INTEL_PATH"/setvars.sh && . "$INTEL_PATH"/setvars.sh
sudo chmod o+w /usr/local/include /usr/local/lib
./install.sh