Skip to content

modflowapi continuous integration #665

modflowapi continuous integration

modflowapi continuous integration #665

Workflow file for this run

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:
- 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
if: github.event_name != 'schedule'
strategy:
fail-fast: false
defaults:
run:
shell: bash
steps:
- 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: Lint
run: ruff check .
- name: Check format
run: ruff format . --check
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.9, "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash
steps:
- 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_preidm_extensions:
name: modflowapi pre-idm extensions autotests
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.9, "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash
steps:
- 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: executables
tag: "14.0"
- 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.9, "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash
steps:
- 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 modflow6 nightly build
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"