Skip to content

modflowapi continuous integration #185

modflowapi continuous integration

modflowapi continuous integration #185

Workflow file for this run

name: modflowapi continuous integration
on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
push:
pull_request:
branches: [main, develop]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
- name: Print version
run: uv 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@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: false
- name: Lint
run: uvx ruff check .
- name: Format
run: uvx ruff format . --check
- name: Spelling
run: uvx codespell
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.10", "3.11", "3.12", "3.13" ]
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}
- name: Install
run: uv sync --all-extras
- name: Install Python dependencies
run: |
uv pip install git+https://git@github.com/Deltares/xmipy@develop
uv pip install git+https://git@github.com/MODFLOW-ORG/modflow-devtools@develop
- 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: uv 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-13, windows-latest ]
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}
- name: Install
run: uv sync --all-extras
- name: Install Python dependencies
run: |
uv pip install git+https://git@github.com/Deltares/xmipy@develop
uv pip install git+https://git@github.com/MODFLOW-ORG/modflow-devtools@develop
- 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.10", "3.11", "3.12", "3.13" ]
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}
- name: Install
run: uv sync --all-extras
- 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: uv run pytest -v -n auto test_mf6_examples.py