Skip to content

Integration testing #414

Integration testing

Integration testing #414

Workflow file for this run

name: Integration testing
on:
push:
paths-ignore:
- '**.md'
pull_request:
branches:
- master
- develop
paths-ignore:
- '**.md'
schedule:
- cron: '0 6 * * *' # run at 6 AM UTC every day
jobs:
test_modflow:
name: MODFLOW 6 integration tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, macos-latest, windows-2019 ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: executables
- name: Checkout modflow6
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6
path: modflow6
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: modflow6/environment.yml
cache-environment: true
cache-downloads: true
init-shell: bash
- name: Setup Intel fortran
uses: fortran-lang/setup-fortran@v1
with:
compiler: intel-classic
version: 2021.7
# only necessary because we need mf5to6 for mf6 autotests
- name: Build modflow6
working-directory: modflow6
run: |
meson setup builddir --prefix=$(pwd) --libdir=bin -Ddebug=false
meson install -C builddir
- name: Get OS tag
id: ostag
run: |
ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
echo "ostag=$ostag" >> $GITHUB_OUTPUT
- name: Build programs
run: |
# build programs
ostag="${{ steps.ostag.outputs.ostag }}"
mkdir $ostag
python executables/scripts/build_programs.py -p $ostag
# move programs where mf6 autotests expect them
mkdir modflow6/bin/downloaded
cp $ostag/* modflow6/bin/downloaded
# move mf6 binaries to top-level bindir in mf6 repo
if [[ "$RUNNER_OS" == "Windows" ]]; then
eext=".exe"
oext=".dll"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
eext=""
oext=".so"
else
eext=""
oext=".dylib"
fi
cp "$ostag/mf6$eext" modflow6/bin
cp "$ostag/libmf6$oext" modflow6/bin
cp "$ostag/zbud6$eext" modflow6/bin
# set execute permissions
if [[ "$RUNNER_OS" != "Windows" ]]; then
sudo chmod +x modflow6/bin/*
sudo chmod +x modflow6/bin/downloaded/*
fi
- name: Upload programs
uses: actions/upload-artifact@v3
with:
name: ${{ steps.ostag.outputs.ostag }}
path: ${{ steps.ostag.outputs.ostag }}.zip
- name: Upload metadata
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: metadata
path: |
./code.json
./code.md
- name: Test modflow6
working-directory: modflow6/autotest
run: |
python update_flopy.py
# when mf6.5.0 is released with new models and exes dist is updatd, remove filters below
pytest -v -n auto -k "not gwe and not swf and not prt" -m "not developmode" --durations 0