Skip to content

chore(deps): bump dawidd6/action-download-artifact from 18 to 19 #5822

chore(deps): bump dawidd6/action-download-artifact from 18 to 19

chore(deps): bump dawidd6/action-download-artifact from 18 to 19 #5822

Workflow file for this run

name: MODFLOW 6 continuous integration
on:
push:
paths-ignore:
- "**.md"
- "**.pdf"
- "**.tex"
- "**.jpg"
- "**.jpeg"
- "**.png"
- "**.bbl"
- "**.bib"
- "doc/**.dat"
- "doc/**.ipynb"
- "doc/**.py"
- "doc/**.sh"
- "doc/**.xlsx"
- ".hpc/**"
pull_request:
branches:
- master
- develop
paths-ignore:
- "**.md"
- "**.pdf"
- "**.tex"
- "**.jpg"
- "**.jpeg"
- "**.png"
- "**.bbl"
- "**.bib"
- "doc/**.dat"
- "doc/**.ipynb"
- "doc/**.py"
- "doc/**.sh"
- "doc/**.xlsx"
- ".hpc/**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PIXI_BETA_WARNING_OFF: true
jobs:
lint:
name: Check format
runs-on: ubuntu-latest
steps:
- name: Checkout MF6
uses: actions/checkout@v6
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
- name: Check Fortran source formatting
run: pixi run check-format
- name: Check MSVS project files
run: pixi run check-vfproj
- name: Check python lint
run: pixi run check-python-lint
- name: Check python format
run: pixi run check-python-format
- name: Check CITATION.cff
run: pixi run check-citations
- name: Check generated Fortran IDM files are up to date
run: |
pixi run update-fortran-definitions
if ! git diff --exit-code src/Idm/; then
echo "::error::Generated Fortran IDM files are out of date!"
echo "::error::Run 'pixi run update-fortran-definitions' and commit changes."
git diff --stat src/Idm/
exit 1
fi
build:
name: Build
runs-on: ubuntu-22.04
env:
FC: gfortran
FC_V: 13
steps:
- name: Checkout MF6
uses: actions/checkout@v6
- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: ${{ env.FC_V }}
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
- name: Setup MF6
run: pixi run setup -Dwerror=true builddir
- name: Build MF6
run: pixi run build builddir
- name: Setup mf5to6
run: pixi run setup-mf5to6 -Dwerror=true builddir
- name: Build mf5to6
run: pixi run build-mf5to6 builddir
- name: Show build log
if: failure()
run: cat builddir/meson-logs/meson-log.txt
- name: Unit test MF6
run: pixi run test builddir
build-static:
name: Static gcc build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: windows-2022
defaults:
run:
shell: bash
env:
FC: gfortran
FC_V: 13
steps:
- name: Checkout MF6
uses: actions/checkout@v6
- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: ${{ env.FC_V }}
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
- name: Setup static MF6
run: pixi run setup -Dwerror=true -Ddefault_library=static builddir
- name: Build MF6
run: pixi run build builddir
- name: Show build log
if: failure()
run: cat builddir/meson-logs/meson-log.txt
- name: Unit test MF6
run: pixi run test builddir
- name: Confirm modflow6 has no dependencies (Linux)
if: runner.os == 'Linux'
run: |
echo "Checking dependencies with ldd..."
if ldd bin/mf6; then
echo mf6 is dynamically linked
exit 1
else
echo mf6 is statically linked
fi
- name: Clone ntldd repository and build
if: runner.os == 'Windows'
run: |
git clone https://github.com/LRN/ntldd.git
cd ntldd
./makeldd.sh
ls -lha
- name: Confirm modflow6 has no dependencies (Windows)
if: runner.os == 'Windows'
working-directory: ntldd
run: |
echo "Checking dependencies with ntldd..."
set +e
./ntldd.exe ../bin/mf6.exe > mf6.dependencies.txt
dep_count=$(grep -vc "KERNEL32.dll" mf6.dependencies.txt)
echo "Number of dependencies: $dep_count"
set -e
if [ "$dep_count" -eq 0 ]; then
echo mf6.exe is statically linked
else
echo mf6.exe is dynamically linked
echo exit 1
fi
smoke_test:
name: Smoke test
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
env:
FC: gfortran
FC_V: 13
steps:
- name: Checkout MF6
uses: actions/checkout@v6
with:
path: modflow6
- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: ${{ env.FC_V }}
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
manifest-path: "modflow6/pixi.toml"
- name: Custom pixi install
working-directory: modflow6
run: pixi run install
- name: Build MF6
working-directory: modflow6
run: |
pixi run setup builddir
pixi run build builddir
pixi run setup-mf5to6 builddir
pixi run build-mf5to6 builddir
- name: Show build log
if: failure()
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt
- name: Unit test MF6
working-directory: modflow6
run: pixi run test builddir
- name: Update flopy
working-directory: modflow6
run: pixi run update-flopy
- name: Get executables
working-directory: modflow6
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run get-exes
- name: Test MF6
working-directory: modflow6
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
pixi run autotest -m "not slow and not regression and not developmode"
else
pixi run autotest --smoke
fi
- name: Upload failed test output
if: failure()
uses: actions/upload-artifact@v7
with:
name: failed-smoke-${{ runner.os }}-${{ env.FC }}-${{ env.FC_V }}
path: modflow6/autotest/.failed
test_gfortran:
name: Test GNU fortran
needs:
- lint
- build
- smoke_test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# arm mac, release mode
- os: macos-14
debug: false
xcode-version: '15.1.0'
# arm mac, debug mode
- os: macos-14
debug: true
xcode-version: '15.1.0'
# intel mac, release mode
- os: macos-15-intel
debug: false
xcode-version: '16.1.0'
# ubuntu, release mode
- os: ubuntu-22.04
debug: false
# ubuntu, debug mode
- os: ubuntu-22.04
debug: true
# windows, release mode
- os: windows-2022
debug: false
defaults:
run:
shell: bash
env:
FC: gfortran
FC_V: 13
steps:
- name: Free disk space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout MF6
uses: actions/checkout@v6
with:
path: modflow6
- name: Checkout test models
uses: actions/checkout@v6
with:
repository: MODFLOW-ORG/modflow6-testmodels
path: modflow6-testmodels
- name: Checkout examples
uses: actions/checkout@v6
with:
repository: MODFLOW-ORG/modflow6-examples
path: modflow6-examples
- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: ${{ env.FC_V }}
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
manifest-path: "modflow6/pixi.toml"
- name: Custom pixi install
working-directory: modflow6
run: pixi run install
- name: Set xcode version (macOS)
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode-version }}
# static link gfortran libs
- name: Hide dylibs (macOS)
if: runner.os == 'macOS'
run: |
version="${{ env.FC_V }}"
brew_prefix="$(brew --prefix)"
libpath="$brew_prefix/opt/gcc@$version/lib/gcc/$version"
mv $libpath/libgcc_s.1.1.dylib $libpath/libgcc_s.1.1.dylib.bak
mv $libpath/libgfortran.5.dylib $libpath/libgfortran.5.dylib.bak
mv $libpath/libquadmath.0.dylib $libpath/libquadmath.0.dylib.bak
# use classic xcode linker, static link libgcc
- name: Set LDFLAGS (macOS)
if: runner.os == 'macOS'
run: |
ldflags="$LDFLAGS -Wl,-ld_classic -static-libgcc"
echo "LDFLAGS=$ldflags" >> $GITHUB_ENV
- name: Update version files
working-directory: modflow6
run: pixi run update-version
- name: Set setupargs
run: |
setupargs=""
if [[ "${{ matrix.debug }}" == "true" ]]; then
setupargs="-Ddebug=true -Doptimization=0"
elif [[ "${{ matrix.os }}" == "macos-14" ]]; then
setupargs="-Doptimization=1"
fi
echo "MESON_SETUP_ARGS=$setupargs" >> $GITHUB_ENV
- name: Build MF6
working-directory: modflow6
run: |
pixi run setup builddir $MESON_SETUP_ARGS
pixi run build builddir
- name: Build mf5to6 converter
working-directory: modflow6
run: |
pixi run setup-mf5to6 builddir $MESON_SETUP_ARGS
pixi run build-mf5to6 builddir
- name: Show build log
if: failure()
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt
- name: Upload build log
if: failure()
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.os }}-${{ env.FC }}-${{ env.FC_V }}-meson-log.txt
path: modflow6/builddir/meson-logs/meson-log.txt
- name: Check arch/libs (macOS)
if: runner.os == 'macOS'
working-directory: modflow6/bin
run: |
otool -L mf6
otool -L libmf6.dylib
otool -L mf5to6
otool -L zbud6
lipo -info mf6
lipo -info libmf6.dylib
lipo -info mf5to6
lipo -info zbud6
# TODO remove after next executables release. only necessary because
# tests using gridgen were failing as the current gridgen depends on
# some dylibs. new executables all statically link gcc/gfortran libs
- name: Restore dylibs (macOS)
if: runner.os == 'macOS'
run: |
version="${{ env.FC_V }}"
brew_prefix="$(brew --prefix)"
libpath="$brew_prefix/opt/gcc@$version/lib/gcc/$version"
mv $libpath/libgcc_s.1.1.dylib.bak $libpath/libgcc_s.1.1.dylib
mv $libpath/libgfortran.5.dylib.bak $libpath/libgfortran.5.dylib
mv $libpath/libquadmath.0.dylib.bak $libpath/libquadmath.0.dylib
- name: Unit test MF6
working-directory: modflow6
run: pixi run test builddir
- name: Update flopy
working-directory: modflow6
run: pixi run update-flopy
- name: Get executables
working-directory: modflow6/autotest
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run get-exes
- name: Set markers
id: set_markers
run: |
markers=""
if [[ "${{ github.ref_name }}" == "master" ]]; then
markers="not large and not developmode"
else
markers="not large"
fi
echo "markers=$markers" >> $GITHUB_OUTPUT
- name: Set filters
id: set_filters
run: |
filters=""
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
# comparison fails on macos-14 with optimization=1
filters="not test028_sfr_rewet"
fi
echo "filters=$filters" >> $GITHUB_OUTPUT
- name: Test MF6
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest -m "${{ steps.set_markers.outputs.markers }} and not external" -k "${{ steps.set_filters.outputs.filters }}"
- name: Test MF6 models
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest -m "${{ steps.set_markers.outputs.markers }} and external" -k "${{ steps.set_filters.outputs.filters }}" --models-path ../../modflow6-testmodels/mf6
- name: Test converter models
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest -m "${{ steps.set_markers.outputs.markers }} and external" -k "${{ steps.set_filters.outputs.filters }}" --models-path ../../modflow6-testmodels/mf5to6 --namefile-pattern "*.nam"
- name: Install executables
uses: modflowpy/install-modflow-action@v1
- name: Test examples
working-directory: modflow6
if: runner.os != 'Windows'
shell: pixi run bash -e {0}
run: |
cp -R bin/* ~/.local/bin/modflow/
cd ../modflow6-examples/autotest
pytest -v -n auto test_scripts.py
- name: Test examples
working-directory: modflow6
if: runner.os == 'Windows'
run: |
cp -R bin/* /c/Users/runneradmin/.local/bin/modflow/
cd ../modflow6-examples/autotest
pixi run --manifest-path ../../modflow6/pixi.toml pytest -v -n auto test_scripts.py
- name: Upload failed test output
if: failure()
uses: actions/upload-artifact@v7
with:
name: failed-${{ matrix.os }}-${{ env.FC }}-${{ env.FC_V }}
path: modflow6/autotest/.failed
- name: Checkout usgslatex
if: runner.os == 'Linux'
uses: actions/checkout@v6
with:
repository: MODFLOW-ORG/usgslatex
path: usgslatex
- name: Install TeX Live
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install texlive-science \
texlive-latex-extra \
texlive-font-utils \
texlive-fonts-recommended \
texlive-fonts-extra
- name: Install USGS LaTeX style files and Univers font
if: runner.os == 'Linux'
working-directory: usgslatex/usgsLaTeX
run: sudo ./install.sh --all-users
- name: Test distribution scripts
working-directory: modflow6
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run test-dist-scripts
test_intel_fortran:
name: Test Intel fortran
needs:
- lint
- build
- smoke_test
runs-on: ${{ matrix.os }}
env:
FC: intel-classic
FC_V: "2021.6"
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022]
defaults:
run:
shell: bash
steps:
- name: Free disk space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout MF6
uses: actions/checkout@v6
with:
path: modflow6
- name: Checkout test models
uses: actions/checkout@v6
with:
repository: MODFLOW-ORG/modflow6-testmodels
path: modflow6-testmodels
- name: Checkout examples
uses: actions/checkout@v6
with:
repository: MODFLOW-ORG/modflow6-examples
path: modflow6-examples
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
manifest-path: "modflow6/pixi.toml"
- name: Custom pixi install
working-directory: modflow6
run: pixi run install
- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ env.FC }}
version: ${{ env.FC_V }}
- name: Update version files
working-directory: modflow6
run: pixi run update-version
- name: Build MF6
working-directory: modflow6
run: |
pixi run setup builddir
pixi run build builddir
pixi run setup-mf5to6 builddir
pixi run build-mf5to6 builddir
- name: Show build log
if: failure()
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt
- name: Unit test MF6
working-directory: modflow6
run: pixi run test builddir
- name: Update flopy
working-directory: modflow6
run: pixi run update-flopy
- name: Get executables
working-directory: modflow6
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run get-exes
- name: Set markers
id: set_markers
run: |
markers=""
if [[ "${{ github.ref_name }}" == "master" ]]; then
markers="not large and not developmode"
else
markers="not large"
fi
echo "markers=$markers" >> $GITHUB_OUTPUT
- name: Test MF6
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest -m "${{ steps.set_markers.outputs.markers }} and not external"
- name: Test MF6 models
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest -m "${{ steps.set_markers.outputs.markers }} and external" --models-path ../../modflow6-testmodels/mf6
- name: Test converter models
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest -m "${{ steps.set_markers.outputs.markers }} and external" --models-path ../../modflow6-testmodels/mf5to6 --namefile-pattern "*.nam"
# if on linux, test example models too
- name: Install executables
if: runner.os == 'Linux'
uses: modflowpy/install-modflow-action@v1
- name: Test MF6 examples
if: runner.os == 'Linux'
working-directory: modflow6
shell: pixi run bash -e {0}
run: |
cp -R bin/* ~/.local/bin/modflow/
cd ../modflow6-examples/autotest
pytest -v -n auto test_scripts.py
- name: Upload failed test output
if: failure()
uses: actions/upload-artifact@v7
with:
name: failed-${{ matrix.os }}-${{ env.FC }}-${{ env.FC_V }}
path: modflow6/autotest/.failed
- name: Test scripts
working-directory: modflow6
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run test-dist-scripts
extended_test:
name: Extended testing
needs:
- lint
- build
- smoke_test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
defaults:
run:
shell: bash
steps:
- name: Free disk space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout MF6
uses: actions/checkout@v6
with:
path: modflow6
- name: Setup gfortran
if: runner.os != 'Windows'
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: 13
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
manifest-path: "modflow6/pixi.toml"
- name: Custom pixi install
working-directory: modflow6
run: pixi run install
- name: Set LDFLAGS (macOS)
if: runner.os == 'macOS'
run: |
ldflags="$LDFLAGS -Wl,-ld_classic -static-libgcc"
echo "LDFLAGS=$ldflags" >> $GITHUB_ENV
- name: Set markers
id: set_markers
run: echo "markers=not large" >> $GITHUB_OUTPUT
- name: Set filters
id: set_filters
run: echo "filters=test_par or test_netcdf" >> $GITHUB_OUTPUT
- name: Test extended MF6
if: runner.os != 'Windows'
uses: ./modflow6/.github/actions/test-extended
env:
MARKERS: ${{ steps.set_markers.outputs.markers }}
FILTERS: ${{ steps.set_filters.outputs.filters }}
- name: Test extended MF6
if: runner.os == 'Windows'
uses: ./modflow6/.github/actions/test-extended-win
env:
MARKERS: ${{ steps.set_markers.outputs.markers }}
FILTERS: ${{ steps.set_filters.outputs.filters }}
- name: Upload failed test output
if: failure()
uses: actions/upload-artifact@v7
with:
name: failed-${{ matrix.os }}-ext
path: modflow6/autotest/.failed