Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update main.yml to use modflowpy/install-intelfortran-action #124

Merged
merged 5 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 9 additions & 73 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,18 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
os_script: ifortvars_linux.sh
- os: macos-latest
os_script: ifortvars_macos.sh
- os: windows-2019
os_script: ifortvars_windows.bat
os: [ubuntu-latest, macos-latest, windows-2019]
defaults:
run:
shell: bash
env:
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18976/w_HPCKit_p_2022.3.1.19755_offline.exe
LINUX_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18975/l_HPCKit_p_2022.3.1.16997_offline.sh
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18977/m_HPCKit_p_2022.3.1.15344_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
WINDOWS_CPP_COMPONENTS: intel.oneapi.win.cpp-compiler
LINUX_CPP_COMPONENTS_WEB: intel.oneapi.lin.dpcpp-cpp-compiler-pro
MACOS_CPP_COMPONENTS: intel.oneapi.mac.cpp-compiler
FC: ifort

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Intel OneAPI Compilers
uses: modflowpy/install-intelfortran-action@v1

- name: Setup Graphviz
if: runner.os == 'Linux'
uses: ts-graphviz/setup-graphviz@v1
Expand All @@ -59,60 +45,20 @@ jobs:
run: |
.github/common/download-examples.sh

- name: cache install intel compilers on linux
- name: test on Linux
if: runner.os == 'Linux'
id: cache-install-linux
uses: actions/cache@v2
with:
path: |
/opt/intel/oneapi/compiler
key: install-${{ env.LINUX_HPCKIT_URL }}-${{ env.LINUX_CPP_COMPONENTS_WEB }}-${{ env.LINUX_FORTRAN_COMPONENTS_WEB }}-compiler-${{ hashFiles('**/.github/intel-scripts/cache_exclude_linux.sh') }}

- name: install intel compilers 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_CPP_COMPONENTS_WEB:$LINUX_FORTRAN_COMPONENTS_WEB
pytest -v -n=auto --dist=loadfile -m="base or regression" --durations=0 --cov=pymake --cov-report=xml autotest/

- name: cache install intel compilers on macos
- name: test 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_CPP_COMPONENTS }}-${{ env.MACOS_FORTRAN_COMPONENTS }}

- name: install intel compilers 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_CPP_COMPONENTS:$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\compiler
key: install-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_CPP_COMPONENTS }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-compiler-${{ hashFiles('**/.github/intel-scripts/cache_exclude_windows.sh') }}

- name: install intel compilers 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_CPP_COMPONENTS:$WINDOWS_FORTRAN_COMPONENTS

- name: activate intel and test on linux and macOS
if: runner.os == 'Linux' || runner.os == 'macOS'
env:
CC: icc
run: |
.github/intel-scripts/${{ matrix.os_script }}
pytest -v -n=auto --dist=loadfile -m="base" --durations=0 --cov=pymake --cov-report=xml autotest/

- name: activate intel and test on Windows
- name: test on Windows
if: runner.os == 'Windows'
env:
CC: icl
shell: cmd
run: |
call ".github/intel-scripts/ifortvars_windows.bat"
pytest -v -m="base" --durations=0 --cov=pymake --cov-report=xml autotest/

- name: Print coverage report before upload
Expand All @@ -123,13 +69,3 @@ jobs:
uses: codecov/[email protected]
with:
file: ./coverage.xml

- 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
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = mfpymake
version = attr: pymake.config.__version__
description = pymake is a Python package to compile MODFLOW-based models.
long_description = file: README.md, LICENSE.md
long_description = file: README.md
long_description_content_type = text/markdown
author = Joseph D. Hughes
author_email = [email protected]
Expand Down