Skip to content

fix(dfn): restore old dfn2toml logic #780

fix(dfn): restore old dfn2toml logic

fix(dfn): restore old dfn2toml logic #780

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '**.md'
- '.github/workflows/release.yml'
- '.gitignore'
pull_request:
branches:
- main
- develop
paths-ignore:
- '**.md'
- '.github/workflows/release.yml'
- '.gitignore'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
- name: Install
run: uv sync --group lint
- name: Lint
run: uvx ruff check
- name: Format
run: uvx ruff format --check
- name: Spelling
run: uvx codespell
- name: Typing
run: uv run mypy modflow_devtools
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
- name: Install project
run: uv sync --group build
- name: Print package version
run: uv run python -c "import modflow_devtools; print(modflow_devtools.__version__)"
- name: Build package
run: uv build
- name: Check distribution
run: uvx twine check --strict dist/*
test:
name: Test
needs:
- build
- lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-14, windows-2022 ]
python: [ "3.10", "3.11", "3.12", "3.13" ]
env:
GCC_V: 11
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: modflow-devtools
- name: Checkout modflow6 for DFN autodiscovery
uses: actions/checkout@v4
with:
repository: MODFLOW-ORG/modflow6
path: modflow6
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python }}
- name: Setup Fortran
if: runner.os != 'Windows'
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: ${{ env.GCC_V }}
- name: Setup Fortran (Windows)
if: runner.os == 'Windows'
uses: fortran-lang/setup-fortran@v1
with:
compiler: intel
version: 2025.2
- name: Install project
working-directory: modflow-devtools
run: uv sync --all-extras
- name: Run local tests
working-directory: modflow-devtools/autotest
env:
REPOS_PATH: ${{ github.workspace }}
MODFLOW_DEVTOOLS_NO_AUTO_SYNC: 1
TEST_DFN_PATH: ${{ github.workspace }}/modflow6/doc/mf6io/mf6ivar/dfn
# use --dist loadfile to so tests requiring pytest-virtualenv run on the same worker
run: uv run pytest -v -n auto --dist loadfile --durations 0 --ignore test_download.py --ignore test_models.py --ignore test_dfns_registry.py
- name: Run network-dependent tests
# only invoke the GH API on one OS and Python version
# to avoid rate limits (1000 rqs / hour / repository)
# https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits
if: runner.os == 'Linux' && matrix.python == '3.10'
working-directory: modflow-devtools/autotest
env:
REPOS_PATH: ${{ github.workspace }}
GITHUB_TOKEN: ${{ github.token }}
# TODO: switch to upstream when dfn registry file added
TEST_DFNS_REPO: wpbonelli/modflow6
TEST_DFNS_REF: registry
TEST_DFNS_SOURCE: modflow6
# Models API
TEST_MODELS_REPO: MODFLOW-ORG/modflow6-testmodels
TEST_MODELS_REF: develop
TEST_MODELS_SOURCE: modflow6-testmodels
TEST_MODELS_SOURCE_NAME: mf6/test
# Programs API
TEST_PROGRAMS_REPO: MODFLOW-ORG/modflow6
TEST_PROGRAMS_REF: develop
TEST_PROGRAMS_SOURCE: modflow6
run: uv run pytest -v -n auto --dist loadgroup --durations 0 test_download.py test_models.py test_dfns_registry.py
rtd:
name: Docs
needs: test
runs-on: ubuntu-22.04
if: github.repository_owner == 'MODFLOW-ORG' && github.event_name == 'push'
steps:
- name: Trigger RTD
uses: dfm/rtds-action@v1
with:
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
commit_ref: ${{ github.ref }}