-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add reusable github actions cache_ifort and cache_gfortran * use ifort/gfortran actions in CI workflows * bump actions/cache to v3
- Loading branch information
Showing
5 changed files
with
176 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Cache gfortran | ||
description: Cache gfortran installation (cross-platform) | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Cache gfortran (Linux) | ||
if: runner.os == 'Linux' | ||
id: cache-install-linux | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/usr/bin/gfortran-10 | ||
/usr/bin/gcc-10 | ||
/usr/bin/g++-10 | ||
key: gfortran-${{ runner.os }}-${{ hashFiles('**/.github/actions/cache_gfortran/action.yml') }} | ||
|
||
- name: Symlink to gfortran (Linux) | ||
if: runner.os == 'Linux' && steps.cache-install-linux.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
sudo ln -fs /usr/bin/gfortran-10 /usr/local/bin/gfortran | ||
sudo ln -fs /usr/bin/gcc-10 /usr/local/bin/gcc | ||
sudo ln -fs /usr/bin/g++-10 /usr/local/bin/g++ | ||
- name: Cache gfortran (MacOS) | ||
if: runner.os == 'macOS' | ||
id: cache-install-macos | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/usr/local/bin/gfortran-11 | ||
/usr/local/bin/gcc-11 | ||
/usr/local/bin/g++-11 | ||
key: gfortran-${{ runner.os }}-${{ hashFiles('**/.github/actions/cache_gfortran/action.yml') }} | ||
|
||
- name: Symlink to gfortran (MacOS) | ||
if: runner.os == 'macOS' && steps.cache-install-macos.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
sudo ln -fs /usr/local/bin/gfortran-11 /usr/local/bin/gfortran | ||
sudo ln -fs /usr/local/bin/gcc-11 /usr/local/bin/gcc | ||
sudo ln -fs /usr/local/bin/g++-11 /usr/local/bin/g++ | ||
- name: Cache gfortran (Windows) | ||
if: runner.os == 'Windows' | ||
id: cache-install-windows | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
# TODO: where is windows install? | ||
/c/ProgramData/Chocolatey/ | ||
key: gfortran-${{ runner.os }}-${{ hashFiles('**/.github/actions/cache_gfortran/action.yml', '**/.github/common/link-gfortranlib5.sh') }} | ||
|
||
- name: Workaround for windows-2022 v20220626.1 gfortran executable run failures | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
.github/common/link-gfortranlib5.sh | ||
- name: Print GNU compiler versions | ||
if: runner.os != 'Windows' | ||
shell: bash | ||
run: | | ||
gfortran --version | ||
gcc --version | ||
g++ --version | ||
- name: Print GNU compiler versions (Windows) | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
run: | | ||
gfortran --version | ||
gcc --version | ||
g++ --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Cache Intel fortran | ||
description: Cache Intel fortran installation (cross-platform) | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Set install path (Linux & MacOS) | ||
if: runner.os != 'Windows' | ||
id: set-install-path | ||
shell: bash | ||
run: | | ||
echo "::set-output name=install-path::/opt/intel/oneapi" | ||
- name: Set resources (Linux) | ||
id: set-resources-linux | ||
shell: bash | ||
run: | | ||
echo "::set-output name=hpckit_url::https://registrationcenter-download.intel.com/akdlm/irc_nas/18679/l_HPCKit_p_2022.2.0.191_offline.sh" | ||
echo "::set-output name=fortran::intel.oneapi.lin.ifort-compiler" | ||
- name: Cache ifort (Linux) | ||
if: runner.os == 'Linux' | ||
id: cache-install-linux | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.set-install-path.outputs.install-path }} | ||
key: install-${{ env.HPCKIT_URL }}-${{ env.FORTRAN }}-compiler-${{ hashFiles('**/.github/actions/cache_ifort/action.yml', '**/.github/intel-scripts/cache_exclude_linux.sh') }} | ||
env: | ||
HPCKIT_URL: ${{ steps.set-resources-linux.outputs.hpckit_url }} | ||
FORTRAN: ${{ steps.set-resources-linux.outputs.fortran }} | ||
|
||
- name: Install ifort (Linux) | ||
if: runner.os == 'Linux' && steps.cache-install-linux.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
.github/intel-scripts/install_linux.sh $HPCKIT_URL $FORTRAN | ||
env: | ||
HPCKIT_URL: ${{ steps.set-resources-linux.outputs.hpckit_url }} | ||
FORTRAN: ${{ steps.set-resources-linux.outputs.fortran }} | ||
|
||
- name: Set resources (Mac) | ||
id: set-resources-macos | ||
shell: bash | ||
run: | | ||
echo "::set-output name=hpckit_url::https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18681/m_HPCKit_p_2022.2.0.158_offline.dmg" | ||
echo "::set-output name=fortran::intel.oneapi.mac.ifort-compiler" | ||
- name: Cache ifort (MacOS) | ||
if: runner.os == 'macOS' | ||
id: cache-install-macos | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.set-install-path.outputs.install-path }} | ||
key: install-${{ env.HPCKIT_URL }}-${{ env.FORTRAN }}-${{ hashFiles('**/.github/actions/cache_ifort/action.yml') }} | ||
env: | ||
HPCKIT_URL: ${{ steps.set-resources-macos.outputs.hpckit_url }} | ||
FORTRAN: ${{ steps.set-resources-macos.outputs.fortran }} | ||
|
||
- name: Install ifort (MacOS) | ||
if: runner.os == 'macOS' && steps.cache-install-macos.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
.github/intel-scripts/install_macos.sh $HPCKIT_URL $FORTRAN_COMPONENTS | ||
env: | ||
HPCKIT_URL: ${{ steps.set-resources-macos.outputs.hpckit_url }} | ||
FORTRAN: ${{ steps.set-resources-macos.outputs.fortran }} | ||
|
||
- name: Set resources (Windows) | ||
id: set-resources-windows | ||
shell: pwsh | ||
run: | | ||
echo "::set-output name=hpckit_url::https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18680/w_HPCKit_p_2022.2.0.173_offline.exe" | ||
echo "::set-output name=fortran::intel.oneapi.win.ifort-compiler" | ||
- name: Cache ifort (Windows) | ||
if: runner.os == 'Windows' | ||
id: cache-install-windows | ||
uses: actions/cache@v3 | ||
with: | ||
path: C:\Program Files (x86)\Intel\oneAPI | ||
key: install-${{ env.HPCKIT_URL }}-${{ env.FORTRAN }}-compiler-${{ hashFiles('**/.github/actions/cache_ifort/action.yml', '**/.github/intel-scripts/cache_exclude_windows.sh') }} | ||
env: | ||
HPCKIT_URL: ${{ steps.set-resources-windows.outputs.hpckit_url }} | ||
FORTRAN: ${{ steps.set-resources-windows.outputs.fortran }} | ||
|
||
- name: Install ifort (Windows) | ||
if: runner.os == 'Windows' && steps.cache-install-windows.outputs.cache-hit != 'true' | ||
shell: pwsh | ||
run: | | ||
.github/intel-scripts/install_windows.bat $env:HPCKIT_URL $env:FORTRAN | ||
env: | ||
HPCKIT_URL: ${{ steps.set-resources-windows.outputs.hpckit_url }} | ||
FORTRAN: ${{ steps.set-resources-windows.outputs.fortran }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,58 +39,14 @@ jobs: | |
shell: bash | ||
|
||
env: | ||
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18680/w_HPCKit_p_2022.2.0.173_offline.exe | ||
LINUX_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18679/l_HPCKit_p_2022.2.0.191_offline.sh | ||
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18681/m_HPCKit_p_2022.2.0.158_offline.dmg | ||
WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler | ||
LINUX_FORTRAN_COMPONENTS_WEB: intel.oneapi.lin.ifort-compiler | ||
MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler | ||
FC: ifort | ||
VS_VER: vs2022 | ||
|
||
steps: | ||
- name: Checkout this github repo | ||
uses: actions/[email protected] | ||
|
||
- name: cache install ifort on linux | ||
if: runner.os == 'Linux' | ||
id: cache-install-linux | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
/opt/intel/oneapi | ||
key: install-${{ env.LINUX_HPCKIT_URL }}-${{ env.LINUX_FORTRAN_COMPONENTS_WEB }}-compiler-${{ hashFiles('**/.github/intel-scripts/cache_exclude_linux.sh') }} | ||
|
||
- name: install ifort on linux | ||
if: runner.os == 'Linux' && steps.cache-install-linux.outputs.cache-hit != 'true' | ||
run: | | ||
.github/intel-scripts/install_linux.sh $LINUX_HPCKIT_URL $LINUX_FORTRAN_COMPONENTS_WEB | ||
- name: cache install ifort on macos | ||
if: runner.os == 'macOS' | ||
id: cache-install-macos | ||
uses: actions/cache@v2 | ||
with: | ||
path: /opt/intel/oneapi | ||
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }} | ||
|
||
- name: install ifort on macos | ||
if: runner.os == 'macOS' && steps.cache-install-macos.outputs.cache-hit != 'true' | ||
run: | | ||
.github/intel-scripts/install_macos.sh $MACOS_HPCKIT_URL $MACOS_FORTRAN_COMPONENTS | ||
- name: cache install ifort on windows | ||
if: runner.os == 'Windows' | ||
id: cache-install-windows | ||
uses: actions/cache@v2 | ||
with: | ||
path: C:\Program Files (x86)\Intel\oneAPI | ||
key: install-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-compiler-${{ hashFiles('**/.github/intel-scripts/cache_exclude_windows.sh') }} | ||
|
||
- name: install ifort on windows | ||
if: runner.os == 'Windows' && steps.cache-install-windows.outputs.cache-hit != 'true' | ||
run: | | ||
.github/intel-scripts/install_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_FORTRAN_COMPONENTS | ||
- name: Install ifort | ||
uses: ./.github/actions/cache_ifort | ||
|
||
- name: Setup Python | ||
uses: actions/[email protected] | ||
|
@@ -155,6 +111,8 @@ jobs: | |
run: | | ||
call ".github/intel-scripts/build_windows.bat" | ||
python make_distribution.py -mf6p ./modflow6 -mf6ep ./modflow6-examples -dp ./${{ runner.os }} | ||
env: | ||
VS_VER: vs2022 | ||
|
||
- name: Create an artifact of the distributions | ||
uses: actions/[email protected] | ||
|