modflowapi continuous integration #329
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: modflowapi continuous integration | |
on: | |
schedule: | |
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST) | |
push: | |
branches: | |
- main | |
- develop | |
- 'release*' | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
std_setup: | |
name: standard installation | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash | |
steps: | |
# check out repo | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Base installation | |
run: | | |
pip install -e . | |
- name: Print version | |
run: | | |
python -c "import modflowapi; print(modflowapi.__version__)" | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash | |
if: github.event_name != 'schedule' | |
steps: | |
# check out repo | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
# Standard python fails on Windows without GDAL installation. Using | |
# standard python here since only linting on linux. | |
# Use standard bash shell with standard python | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Print python version | |
run: | | |
python --version | |
- name: Install Python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[lint] | |
- name: Run black | |
run: | | |
echo "if black check fails run" | |
echo " black ./modflowapi" | |
echo "and then commit the changes." | |
black --check ./modflowapi | |
- name: Run flake8 | |
run: | | |
flake8 --count --show-source --exit-zero ./modflowapi | |
- name: Run pylint | |
run: | | |
pylint --jobs=2 --errors-only --exit-zero ./modflowapi | |
autotest_extensions: | |
name: modflowapi extensions autotests | |
needs: lint | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: [ 3.8, 3.9, "3.10", "3.11" ] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
# check out repo | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: pyproject.toml | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install git+https://[email protected]/Deltares/xmipy@develop | |
pip install git+https://[email protected]/MODFLOW-USGS/modflow-devtools@develop | |
pip install .[test] | |
- name: Install modflow executables | |
uses: modflowpy/install-modflow-action@v1 | |
with: | |
path: ${{ github.workspace }}/autotest | |
repo: modflow6-nightly-build | |
- name: Run autotests | |
working-directory: ./autotest | |
shell: bash -l {0} | |
run: pytest -v -n auto -m "not mf6" | |
autotest_mf6_examples: | |
name: modflowapi mf6 examples autotests | |
needs: lint | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: [ 3.8, 3.9, "3.10", "3.11" ] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
# check out repo | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: pyproject.toml | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install git+https://[email protected]/Deltares/xmipy@develop | |
pip install git+https://[email protected]/MODFLOW-USGS/modflow-devtools@develop | |
pip install .[test] | |
- name: Install modflow executables | |
uses: modflowpy/install-modflow-action@v1 | |
with: | |
path: ${{ github.workspace }}/autotest | |
repo: modflow6-nightly-build | |
- name: Run autotests | |
working-directory: ./autotest | |
shell: bash -l {0} | |
run: pytest -v -n auto -m "mf6 and not extensions" |