Skip to content

Commit

Permalink
ci: move from mamba to pixi (#1696)
Browse files Browse the repository at this point in the history
* add pixi.toml environment file, equivalent to conda environment.yml
* pixi.toml also defines tasks: aliases for development commands
* checkin pixi lock file, add ci workflow to update it monthly
* use pixi tasks in ci actions, scripts, workflows
* update developer docs with pixi info
  • Loading branch information
Hofer-Julian authored Apr 3, 2024
1 parent 9721877 commit 7bca1de
Show file tree
Hide file tree
Showing 23 changed files with 9,915 additions and 316 deletions.
14 changes: 14 additions & 0 deletions .build_rtd_docs/update_doxyfile_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join("..", "doc")))
from version import __version__
print("Update the Doxyfile with the latest version number")
with open("Doxyfile", "r") as fp:
lines = fp.readlines()

tag = "PROJECT_NUMBER"
with open("Doxyfile", "w") as fp:
for line in lines:
if tag in line:
line = '{} = "version {}"\n'.format(tag, __version__)
fp.write(line)
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
*.inc linguist-language=Fortran
.build_rtd_docs/** linguist-documentation
.doc/** linguist-documentation
# GitHub syntax highlighting
pixi.lock linguist-language=YAML

8 changes: 4 additions & 4 deletions .github/actions/test-par-win/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ runs:
uses: ./modflow6/.github/actions/build-par-win

- name: Update flopy
working-directory: modflow6/autotest
working-directory: modflow6
shell: cmd
run: micromamba run -r "C:\Users\runneradmin\micromamba" -n modflow6 python update_flopy.py
run: pixi run update-flopy

- name: Get executables
working-directory: modflow6/autotest
shell: cmd
env:
GITHUB_TOKEN: ${{ github.token }}
run: micromamba run -r "C:\Users\runneradmin\micromamba" -n modflow6 pytest -v --durations 0 get_exes.py
run: pixi run get-exes

- name: Test programs
shell: cmd
env:
REPOS_PATH: ${{ github.workspace }}
run: |
unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\test_modflow6.bat" "%TEMP%\test_modflow6.bat"
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6.bat"
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6.bat"
26 changes: 13 additions & 13 deletions .github/actions/test-par/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ runs:
sudo make all
- name: Build modflow6
shell: bash -l {0}
shell: bash
working-directory: modflow6
run: |
meson setup builddir -Ddebug=false -Dparallel=true --prefix=$(pwd) --libdir=bin
meson install -C builddir
meson test --verbose --no-rebuild -C builddir
pixi run setup-release-parallel builddir
pixi run install-build builddir
pixi run test-build builddir
- name: Show Meson logs
if: failure()
Expand All @@ -62,20 +62,20 @@ runs:
run: cat builddir/meson-logs/meson-log.txt

- name: Update flopy
shell: bash -l {0}
working-directory: modflow6/autotest
run: python update_flopy.py
shell: bash
working-directory: modflow6
run: pixi run update-flopy

- name: Get executables
shell: bash -l {0}
working-directory: modflow6/autotest
shell: bash
working-directory: modflow6
env:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0 get_exes.py
run: pixi run get-exes

- name: Test programs
shell: bash -l {0}
working-directory: modflow6/autotest
shell: bash
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pytest -v -n auto --parallel --durations 0 -k "test_par" --keep-failed .failed
run: pixi run autotest-parallel
6 changes: 3 additions & 3 deletions .github/common/compile_modflow6.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set FC=ifort
cd "%GITHUB_WORKSPACE%\modflow6"
micromamba run -r "C:\Users\runneradmin\micromamba" -n modflow6 meson setup builddir -Ddebug=false -Dparallel=true --prefix=%CD% --libdir=bin
micromamba run -r "C:\Users\runneradmin\micromamba" -n modflow6 meson install -C builddir
micromamba run -r "C:\Users\runneradmin\micromamba" -n modflow6 meson test --verbose --no-rebuild -C builddir
pixi run setup-release-parallel builddir
pixi run install-build builddir
pixi run test-build builddir
2 changes: 1 addition & 1 deletion .github/common/test_modflow6.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd "%GITHUB_WORKSPACE%\modflow6\autotest"
where libpetsc.dll
ldd ..\bin\mf6
micromamba run -r "C:\Users\runneradmin\micromamba" -n modflow6 pytest -v -n auto --parallel -k "test_par" --durations 0 --keep-failed .failed
pixi run autotest-parallel
Loading

0 comments on commit 7bca1de

Please sign in to comment.