Skip to content

Commit

Permalink
Merge pull request #19 from w-bonelli/ci
Browse files Browse the repository at this point in the history
ci: use fortran cache/install actions
  • Loading branch information
langevin-usgs committed Sep 19, 2022
2 parents 6a1adb7 + 9d7ecef commit 38d4d06
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 358 deletions.
6 changes: 0 additions & 6 deletions .github/common/install-python-std.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .github/common/link-gfortranlib5.sh

This file was deleted.

17 changes: 0 additions & 17 deletions .github/intel-scripts/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions .github/intel-scripts/build_windows.bat

This file was deleted.

13 changes: 0 additions & 13 deletions .github/intel-scripts/cache_exclude_linux.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .github/intel-scripts/cache_exclude_windows.sh

This file was deleted.

23 changes: 0 additions & 23 deletions .github/intel-scripts/install_linux.sh

This file was deleted.

20 changes: 0 additions & 20 deletions .github/intel-scripts/install_macos.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .github/intel-scripts/install_windows.bat

This file was deleted.

102 changes: 17 additions & 85 deletions .github/workflows/nightly-build-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
branches:
- master

env:
FC: ifort

jobs:
build_for_os:
name: compile code
Expand All @@ -38,105 +41,45 @@ jobs:
run:
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
- name: Checkout repo
uses: actions/[email protected]

- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.9

- name: Install python packages
run: |
.github/common/install-python-std.sh
- name: Print python package versions
- name: Install Python packages
run: |
pip install -r requirements.txt
pip list
- 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
uses: modflowpy/install-intelfortran-action@v1

- 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
- name: Checkout modflow6
uses: actions/checkout@v3
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') }}
repository: MODFLOW-USGS/modflow6
path: modflow6

- 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: Clone MODFLOW 6 repo
run: |
git clone https://github.com/MODFLOW-USGS/modflow6.git modflow6
- name: Determine MODFLOW 6 branch
run: |
pwd
cd ./modflow6/
pwd
git branch
cd ../
pwd
ls ./
- name: Update flopy MODFLOW 6 classes
- name: Update flopy classes
working-directory: modflow6/autotest
run: |
python update_flopy.py
- name: Build and zip applications on linux and MacOS
if: runner.os == 'Linux' || runner.os == 'macOS'
- name: Build and zip
if: runner.os != 'Windows'
working-directory: modflow6/distribution
run: |
source /opt/intel/oneapi/setvars.sh
python build_nightly.py
- name: Build and zip applications on Windows
- name: Build and zip (Windows)
if: runner.os == 'Windows'
working-directory: modflow6/distribution
shell: cmd
run: |
call "../../.github/intel-scripts/build_windows.bat"
export PATH="/C/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64":$PATH
python build_nightly.py
- name: Move the build zip file
Expand All @@ -145,7 +88,6 @@ jobs:
mv ./modflow6/distribution/temp_zip/${{ matrix.artifact_name }} ./${{ matrix.artifact_name }}
ls -l ./
# Build LaTeX document
- name: Copy the modflow6/docs directory
if: runner.os == 'Linux'
shell: python
Expand Down Expand Up @@ -225,16 +167,6 @@ jobs:
path: |
./mf6io.pdf
- name: exclude unused files from cache on windows
if: runner.os == 'Windows' && steps.cache-install-windows.outputs.cache-hit != 'true'
run: |
.github/intel-scripts/cache_exclude_windows.sh
- name: exclude unused files from cache on linux
if: runner.os == 'Linux' && steps.cache-install-linux.outputs.cache-hit != 'true'
run: |
.github/intel-scripts/cache_exclude_linux.sh
# make the release if previous job was successful
release:
name: Make a nightly release
Expand Down
61 changes: 13 additions & 48 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,63 +34,29 @@ jobs:
shell: bash

steps:
- name: Checkout this github repo
uses: actions/checkout@v2.3.4
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.9

- name: Install python packages
run: |
.github/common/install-python-std.sh
- name: Print python package versions
- name: Install Python packages
run: |
pip install -r requirements.txt
pip list
- name: Workaround for windows-2022 v20220626.1 gfortran executable run failures
if: runner.os == 'Windows'
run: |
.github/common/link-gfortranlib5.sh
- name: Setup symbolic link to gfortran on Linux
if: runner.os == 'Linux'
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: Setup symbolic link to gfortran on macOS
if: runner.os == 'macOS'
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: Install gfortran
uses: modflowpy/install-gfortran-action@v1

- name: Print GNU compiler versions
shell: bash
run: |
gfortran --version
gcc --version
g++ --version
- name: Clone MODFLOW 6 repo
run: |
git clone https://github.com/MODFLOW-USGS/modflow6.git modflow6
- name: Determine MODFLOW 6 branch
run: |
pwd
cd ./modflow6/
pwd
git branch
cd ../
pwd
ls ./
- name: Checkout modflow6
uses: actions/checkout@v3
with:
repository: MODFLOW-USGS/modflow6
path: modflow6

- name: Update flopy MODFLOW 6 classes
- name: Update flopy classes
working-directory: modflow6/autotest
run: |
python update_flopy.py
Expand All @@ -104,5 +70,4 @@ jobs:
run: |
ls -l ./modflow6/distribution/*
mv ./modflow6/distribution/temp_zip/${{ matrix.artifact_name }} ./${{ matrix.artifact_name }}
ls -l ./
ls -l ./
Loading

0 comments on commit 38d4d06

Please sign in to comment.