Skip to content

Commit

Permalink
ci: expand Intel testing, use awvwgk/setup-fortran (MODFLOW-USGS#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli authored Jul 29, 2023
1 parent 8b94238 commit 13d9b59
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 53 deletions.
124 changes: 77 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ jobs:
- name: Meson compile
run: meson compile -C builddir

- name: Show build log
if: failure()
run: cat builddir/meson-logs/meson-log.txt

- name: Meson test
run: meson test --verbose --no-rebuild -C builddir

Expand Down Expand Up @@ -106,7 +110,15 @@ jobs:
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson install -C builddir
meson test --verbose --no-rebuild -C builddir
- name: Show build log
if: failure()
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt

- name: Unit test programs
working-directory: modflow6
run: meson test --verbose --no-rebuild -C builddir

- name: Update flopy
working-directory: modflow6/autotest
Expand Down Expand Up @@ -204,7 +216,12 @@ jobs:
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson install -C builddir
- name: Unit test modflow6
- name: Show build log
if: failure()
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt

- name: Unit test programs
working-directory: modflow6
run: meson test --verbose --no-rebuild -C builddir

Expand Down Expand Up @@ -262,8 +279,8 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0

test_ifort:
name: Test (ifort)
test_intel_fortran:
name: Test (Intel)
needs:
- lint
- build
Expand All @@ -272,7 +289,47 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
### ifx
## 2022.2.x autotests disabled
# - mf5to6 test_evt: failure to converge
# - mf6 Keating_[disu_]dev: bad head comparison
- {os: ubuntu-22.04, compiler: intel, version: 2022.2.1, test: false}
- {os: ubuntu-22.04, compiler: intel, version: 2022.2, test: false}
## 2021.1 segfault in meson serial sim test
# - {os: ubuntu-22.04, compiler: intel, version: 2022.1, test: false}
## 2022.0 & 2021.[1,2,4] segfault at compile time
# - {os: ubuntu-22.04, compiler: intel, version: "2022.0", test: false}
# - {os: ubuntu-22.04, compiler: intel, version: 2021.4, test: false}
# - {os: ubuntu-22.04, compiler: intel, version: 2021.2, test: false}
# - {os: ubuntu-22.04, compiler: intel, version: 2021.1, test: false}
## ifx not yet supported on macOS
# - {os: macos-12, compiler: intel, version: 2023.2, test: true}
## 2023.[0,1] fail to compile
# - {os: windows-2022, compiler: intel, version: 2023.1, test: false}
# - {os: windows-2022, compiler: intel, version: "2023.0", test: false}
- {os: windows-2022, compiler: intel, version: 2022.2, test: false}
## 2022.1 fail to link
# - {os: windows-2022, compiler: intel, version: 2022.1, test: false}

### ifort
## only autotest latest on each platform
- {os: ubuntu-22.04, compiler: intel-classic, version: "2021.10", test: false}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.9, test: false}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.8, test: false}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.7, test: true}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.6, test: false}
- {os: macos-12, compiler: intel-classic, version: "2021.10", test: false}
- {os: macos-12, compiler: intel-classic, version: 2021.9, test: false}
- {os: macos-12, compiler: intel-classic, version: 2021.8, test: false}
- {os: macos-12, compiler: intel-classic, version: 2021.7, test: true}
- {os: macos-12, compiler: intel-classic, version: 2021.6, test: false}
- {os: windows-2022, compiler: intel-classic, version: "2021.10", test: false}
- {os: windows-2022, compiler: intel-classic, version: 2021.9, test: false}
- {os: windows-2022, compiler: intel-classic, version: 2021.8, test: false}
- {os: windows-2022, compiler: intel-classic, version: 2021.7, test: true}
- {os: windows-2022, compiler: intel-classic, version: 2021.6, test: false}

defaults:
run:
shell: bash -l {0}
Expand Down Expand Up @@ -300,50 +357,44 @@ jobs:
cache-downloads: true

- name: Setup Intel Fortran
uses: modflowpy/install-intelfortran-action@v1
uses: awvwgk/setup-fortran@main
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}

- name: Update version files
working-directory: modflow6/distribution
run: python update_version.py

- name: Build modflow6
if: runner.os != 'Windows'
working-directory: modflow6
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson install -C builddir
meson test --verbose --no-rebuild -C builddir
- name: Build modflow6 (Windows)
if: runner.os == 'Windows'
- name: Show build log
if: failure()
working-directory: modflow6
shell: pwsh
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson install -C builddir
meson test --verbose --no-rebuild -C builddir
run: cat builddir/meson-logs/meson-log.txt

- name: Unit test programs
working-directory: modflow6
run: meson test --verbose --no-rebuild -C builddir

- name: Update flopy
if: matrix.test
working-directory: modflow6/autotest
run: python update_flopy.py

- name: Get executables
if: runner.os != 'Windows'
working-directory: modflow6/autotest
env:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0 get_exes.py

- name: Get executables (Windows)
if: runner.os == 'Windows'
if: matrix.test
working-directory: modflow6/autotest
shell: pwsh
env:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0 get_exes.py

- name: Test programs
if: runner.os != 'Windows'
if: matrix.test
working-directory: modflow6/autotest
env:
REPOS_PATH: ${{ github.workspace }}
Expand All @@ -354,30 +405,9 @@ jobs:
pytest -v -n auto --durations 0 -m "not large"
fi
- name: Test programs (Windows)
if: runner.os == 'Windows'
working-directory: modflow6/autotest
shell: pwsh
env:
REPOS_PATH: ${{ github.workspace }}
run: |
if ( "${{ github.ref_name }}" -eq "master" ) {
pytest -v -n auto --durations 0 -m "not large and not developmode"
} else {
pytest -v -n auto --durations 0 -m "not large"
}
- name: Test scripts
if: runner.os != 'Windows'
working-directory: modflow6/distribution
env:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0

- name: Test scripts (Windows)
if: runner.os == 'Windows'
if: matrix.test
working-directory: modflow6/distribution
shell: pwsh
env:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0
Expand Down
24 changes: 18 additions & 6 deletions autotest/get_exes.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import argparse
from os import environ
from pathlib import Path
from tempfile import TemporaryDirectory
from warnings import warn
from platform import system

import flopy
import pytest
from conftest import project_root_path
from flaky import flaky
from modflow_devtools.build import meson_build
from modflow_devtools.download import download_and_unzip, get_release
from modflow_devtools.misc import get_ostag
from modflow_devtools.misc import get_ostag, is_in_ci, set_env

repository = "MODFLOW-USGS/modflow6"
top_bin_path = project_root_path / "bin"
Expand Down Expand Up @@ -73,11 +75,21 @@ def test_rebuild_release(rebuilt_bin_path: Path):
f.write(f"{line}\n")

# rebuild with Meson
meson_build(
project_path=source_files_path.parent,
build_path=download_path / "builddir",
bin_path=rebuilt_bin_path,
)
def rebuild():
meson_build(
project_path=source_files_path.parent,
build_path=download_path / "builddir",
bin_path=rebuilt_bin_path,
)

# temp workaround until next release,
# ifx fails to build 6.4.2 on Windows
# most likely due to backspace issues
if system() == "Windows" and environ.get("FC") == "ifx":
with set_env(FC="ifort", CC="icl"):
rebuild()
else:
rebuild()


@flaky(max_runs=3)
Expand Down

0 comments on commit 13d9b59

Please sign in to comment.