Skip to content
Merged
106 changes: 106 additions & 0 deletions .github/workflows/ci-mf6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: flopy mf6 CI

on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
push:
branches:
- master
- develop
- 'release*'
pull_request:
branches: [master, develop]

jobs:

flopymf6CI:
name: mf6 flopy autotests
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash

steps:
# check out repo
- name: Checkout flopy repo
uses: actions/checkout@v2.3.4

- name: Get branch name
uses: nelonoel/branch-name@v1.0.1

- name: Setup Python 3.9
uses: actions/setup-python@v2.2.2
with:
python-version: 3.9

- name: Install Python 3.9 packages
run: |
python -m pip install --upgrade pip
pip install -r etc/requirements.pip.txt

- name: Install pymake, xmipy, modflowapi, and flopy
run: |
python -m pip install --upgrade pip
pip install https://github.com/modflowpy/flopy/zipball/develop
pip install https://github.com/modflowpy/pymake/zipball/master
pip install https://github.com/Deltares/xmipy/zipball/develop
pip install https://github.com/MODFLOW-USGS/modflowapi/zipball/develop
pip install . --use-feature=in-tree-build

- name: Setup symbolic links on 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: Print GNU compiler versions
run: |
gfortran --version
gcc --version
g++ --version

- name: Clone MODFLOW 6 repo
run: |
git clone https://github.com/MODFLOW-USGS/modflow6.git modflow6

- name: Update flopy MODFLOW 6 classes
working-directory: ./modflow6/autotest
run: |
python update_flopy.py

- name: Install meson
run: |
pip install meson ninja

- name: Setup modflow
working-directory: ./modflow6
run: |
meson setup builddir --buildtype=debugoptimized --prefix=$(pwd) --libdir=bin

- name: Build modflow
working-directory: ./modflow6
run: |
meson compile -C builddir

- name: Install modflow
working-directory: ./modflow6
run: |
meson install -C builddir

- name: Get executables
working-directory: ./modflow6/autotest
run: |
pytest -v --durations=0 get_exes.py

- name: Run pytest
working-directory: ./modflow6/autotest
run: |
pytest -v -n auto -k "test_gw" --durations=0 --cov=flopy --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0
with:
directory: ./modflow6/autotest
file: coverage.xml
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,6 @@ jobs:
--cover-xml-file=../coverage.xml -w ./autotest ${{ matrix.test-path }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.15
uses: codecov/codecov-action@v2.1.0
with:
file: ./coverage.xml
3 changes: 3 additions & 0 deletions etc/requirements.pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ requests
appdirs
numpy
matplotlib
pytest
pytest-xdist
pytest-cov