-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: refactor workflows, add tests, bump action versions, update docs (#…
…17) * refactor workflows * create code.json in build_executables.py * move scripts from .github/common to /scripts * add job for modflow6 integration testing * use GITHUB_TOKEN to avoid rate limits * update paths to use pathlib * unpin/upgrade actions * update dev docs
- Loading branch information
Showing
6 changed files
with
264 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: Integration testing | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop* | ||
- ci-diagnose* | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
paths-ignore: | ||
- '**.md' | ||
schedule: | ||
- cron: '0 6 * * *' # run at 6 AM UTC every day | ||
jobs: | ||
test_modflow: | ||
name: MODFLOW 6 integration tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-20.04, macos-latest, windows-2019 ] | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
|
||
- name: Checkout action | ||
uses: actions/checkout@v3 | ||
with: | ||
path: executables | ||
|
||
- name: Checkout modflow6 | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: MODFLOW-USGS/modflow6 | ||
path: modflow6 | ||
|
||
- name: Setup Micromamba | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
environment-file: modflow6/environment.yml | ||
|
||
- name: Setup ifort | ||
uses: modflowpy/install-intelfortran-action@v1 | ||
# with: | ||
# path: ${{ runner.os != 'Windows' && 'bin' || 'C:\Program Files (x86)\Intel\oneAPI' }} | ||
|
||
- name: Fix Micromamba path (Windows) | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
run: | | ||
# https://github.com/modflowpy/install-intelfortran-action#conda-scripts | ||
$mamba_bin = "C:\Users\runneradmin\micromamba-root\envs\modflow6\Scripts" | ||
echo $mamba_bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Build modflow6 (Linux & Mac) | ||
working-directory: modflow6 | ||
run: | | ||
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin | ||
meson compile -v -C builddir | ||
meson install -C builddir | ||
# - name: Show meson build log | ||
# run: cat modflow6/builddir/meson-logs/meson-log.txt | ||
|
||
- name: Update FloPy | ||
working-directory: modflow6/autotest | ||
run: python update_flopy.py | ||
|
||
- name: Get executables | ||
if: runner.os != 'Windows' | ||
working-directory: modflow6/autotest | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
pytest -v -s get_exes.py | ||
sudo rm -rf ../bin/downloaded/* | ||
- name: Get executables | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
working-directory: modflow6/autotest | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
pytest -v -s get_exes.py | ||
rm -Force ../bin/downloaded/* | ||
- name: Show pymake version | ||
run: | | ||
pip show mfpymake | ||
python -c "import pymake; print(pymake.__version__)" | ||
- name: Build executables | ||
if: runner.os != 'Windows' | ||
working-directory: executables/scripts | ||
run: python build_executables.py -p ../../modflow6/bin/downloaded | ||
|
||
- name: Build executables | ||
if: runner.os == 'Windows' | ||
shell: cmd | ||
working-directory: executables/scripts | ||
run: python build_executables.py -p ../../modflow6/bin/downloaded | ||
|
||
# - name: Build executables | ||
# uses: nick-fields/retry@v2 | ||
# with: | ||
# timeout_minutes: 40 | ||
# max_attempts: 5 | ||
# command: | | ||
# cd modflow6/bin/downloaded | ||
# python ../../../scripts/build_executables.py | ||
|
||
- name: Set executable permission | ||
if: runner.os != 'Windows' | ||
working-directory: modflow6/bin/downloaded | ||
run: sudo chmod +x * | ||
|
||
- name: Test modflow6 | ||
working-directory: modflow6/autotest | ||
run: pytest -v -n auto --durations 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.