Skip to content

Commit

Permalink
ci: refactor pixi config and usages (MODFLOW-USGS#1703)
Browse files Browse the repository at this point in the history
* add version to pixi.toml
* include doc/Doxyfile and pixi.toml in update_version.py
* consolidate tasks
* refactor custom install as pypi dependencies
* remove branch filters from push trigger in commit.yml
* update dev docs: keep conda language, tidying
* ignore pixi beta feature warning in ci
* restore vscode config to avoid breaking contributor workflow — when vscode python * supports pixi I think we can update the tasks to use "command": "${command:python.interpreterPath}"
  • Loading branch information
wpbonelli authored Apr 4, 2024
1 parent 7bca1de commit f31f84f
Show file tree
Hide file tree
Showing 20 changed files with 565 additions and 251 deletions.
14 changes: 0 additions & 14 deletions .build_rtd_docs/update_doxyfile_version.py

This file was deleted.

8 changes: 4 additions & 4 deletions .github/actions/test-par/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ runs:
shell: bash
working-directory: modflow6
run: |
pixi run setup-release-parallel builddir
pixi run install-build builddir
pixi run test-build builddir
pixi run setup -Dparallel=true builddir
pixi run build builddir
pixi run test builddir
- name: Show Meson logs
if: failure()
Expand All @@ -78,4 +78,4 @@ runs:
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest-parallel
run: pixi run autotest --parallel -k "test_par"
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"
pixi run setup-release-parallel builddir
pixi run install-build builddir
pixi run test-build builddir
pixi run setup -Dparallel=true builddir
pixi run build builddir
pixi run test 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
pixi run autotest-parallel
pixi run autotest --parallel -k "test_par"
70 changes: 29 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: MODFLOW 6 continuous integration
on:
push:
branches: [master, develop, update/pixi-lock]
tags: ["*"]
paths-ignore:
- '**.md'
- '**.pdf'
Expand Down Expand Up @@ -40,6 +38,8 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PIXI_BETA_WARNING_OFF: true
jobs:
lint:
name: Check format
Expand Down Expand Up @@ -84,17 +84,17 @@ jobs:
pixi-version: "latest"

- name: Meson setup
run: pixi run setup-strict builddir
run: pixi run setup -Dwerror=true builddir

- name: Meson compile
run: pixi run compile-build builddir
run: pixi run build builddir

- name: Show build log
if: failure()
run: cat builddir/meson-logs/meson-log.txt

- name: Meson test
run: pixi run test-build builddir
run: pixi run test builddir

smoke_test:
name: Smoke test
Expand Down Expand Up @@ -123,14 +123,11 @@ jobs:
compiler: gcc
version: ${{ env.FC_V }}

- uses: prefix-dev/[email protected]
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
manifest-path: "modflow6/pixi.toml"

- name: Setup pixi
working-directory: modflow6
run: pixi run install

- name: Build test-drive
working-directory: test-drive
Expand All @@ -142,8 +139,8 @@ jobs:
- name: Build modflow6
working-directory: modflow6
run: |
pixi run setup-release builddir
pixi run install-build builddir
pixi run setup builddir
pixi run build builddir
- name: Show build log
if: failure()
Expand All @@ -152,7 +149,7 @@ jobs:

- name: Unit test programs
working-directory: modflow6
run: pixi run test-build builddir
run: pixi run test builddir

- name: Update flopy
working-directory: modflow6
Expand All @@ -168,7 +165,7 @@ jobs:
working-directory: modflow6
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
pixi run autotest-marker "not slow and not regression and not developmode"
pixi run autotest -m "not slow and not regression and not developmode"
else
pixi run autotest
fi
Expand Down Expand Up @@ -221,20 +218,17 @@ jobs:
compiler: gcc
version: ${{ env.FC_V }}

- uses: prefix-dev/[email protected]
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
manifest-path: "modflow6/pixi.toml"

- name: Setup pixi
working-directory: modflow6
run: pixi run install

- name: Build modflow6
working-directory: modflow6
run: |
pixi run setup-release builddir
pixi run install-build builddir
pixi run setup builddir
pixi run build builddir
- name: Show build log
if: failure()
Expand All @@ -243,7 +237,7 @@ jobs:

- name: Unit test programs
working-directory: modflow6
run: pixi run test-build builddir
run: pixi run test builddir

- name: Update flopy
working-directory: modflow6
Expand All @@ -261,9 +255,9 @@ jobs:
REPOS_PATH: ${{ github.workspace }}
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
pixi run autotest-marker "not large and not developmode"
pixi run autotest -m "not large and not developmode"
else
pixi run autotest-marker "not large"
pixi run autotest -m "not large"
fi
- name: Upload failed test output
Expand Down Expand Up @@ -299,7 +293,7 @@ jobs:
working-directory: modflow6
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run test-distribution
run: pixi run test-dist-scripts

test_intel_fortran:
name: Test intel fortran
Expand Down Expand Up @@ -337,14 +331,11 @@ jobs:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples

- uses: prefix-dev/[email protected]
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
manifest-path: "modflow6/pixi.toml"

- name: Setup pixi
working-directory: modflow6
run: pixi run install

- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
Expand All @@ -359,8 +350,8 @@ jobs:
- name: Build modflow6
working-directory: modflow6
run: |
pixi run setup-release builddir
pixi run install-build builddir
pixi run setup builddir
pixi run build builddir
- name: Show build log
if: failure()
Expand All @@ -369,7 +360,7 @@ jobs:

- name: Unit test programs
working-directory: modflow6
run: pixi run test-build builddir
run: pixi run test builddir

- name: Update flopy
working-directory: modflow6
Expand All @@ -387,9 +378,9 @@ jobs:
REPOS_PATH: ${{ github.workspace }}
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
pixi run autotest-marker "not large and not developmode"
pixi run autotest -m "not large and not developmode"
else
pixi run autotest-marker "not large"
pixi run autotest -m "not large"
fi
- name: Upload failed test output
Expand All @@ -403,7 +394,7 @@ jobs:
working-directory: modflow6
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run test-distribution
run: pixi run test-dist-scripts

parallel_test:
name: Parallel testing
Expand All @@ -427,14 +418,11 @@ jobs:
with:
path: modflow6

- uses: prefix-dev/[email protected]
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
manifest-path: "modflow6/pixi.toml"

- name: Setup pixi
working-directory: modflow6
run: pixi run install

- name: Test parallel MF6
if: runner.os != 'Windows'
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/compilers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
# workflow_dispatch trigger to start release via GitHub UI or CLI, see
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
env:
PIXI_BETA_WARNING_OFF: true
jobs:
test:
name: Test
Expand Down Expand Up @@ -157,20 +159,17 @@ jobs:
compiler: ${{ matrix.compiler}}
version: ${{ matrix.version }}

- uses: prefix-dev/[email protected]
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
manifest-path: "modflow6/pixi.toml"

- name: Setup pixi
working-directory: modflow6
run: pixi run install

- name: Build modflow6
working-directory: modflow6
run: |
pixi run setup-release builddir
pixi run install-build builddir
pixi run setup builddir
pixi run build builddir
- name: Show build log
if: failure()
Expand All @@ -187,7 +186,7 @@ jobs:
- name: Unit test programs
if: success()
working-directory: modflow6
run: pixi run test-build builddir
run: pixi run test builddir

- name: Create compile report
if: success() || failure()
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
paths-ignore:
- '.github/workflows/release.yml'
- '.hpc/**'
env:
PIXI_BETA_WARNING_OFF: true
jobs:
rtd_build:
name: Build ReadTheDocs
Expand Down Expand Up @@ -40,14 +42,11 @@ jobs:
repository: MODFLOW-USGS/usgslatex
path: usgslatex

- uses: prefix-dev/[email protected]
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
manifest-path: "modflow6/pixi.toml"

- name: Setup pixi
working-directory: modflow6
run: pixi run install

- name: Install additional packages for Sphinx using pip
working-directory: modflow6/.build_rtd_docs
Expand Down Expand Up @@ -185,22 +184,17 @@ jobs:
sudo apt-get update
sudo apt-get install doxygen graphviz
- uses: prefix-dev/[email protected]
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: "latest"

- name: Setup pixi
run: pixi run install

- name: Print python package versions
run: pixi run pip list

- name: update MODFLOW 6 version
run: pixi run update-version

- name: update MODFLOW 6 version in Doxyfile
run: pixi run update-doxyfile-version

- name: run doxygen
run: doxygen
working-directory: ${{env.working-directory}}
Expand Down
Loading

0 comments on commit f31f84f

Please sign in to comment.