Integration testing #191
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
name: Integration testing | |
on: | |
push: | |
branches: | |
- master | |
- develop* | |
- ci-diagnose* | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: | |
- master | |
- 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/setup-micromamba@v1 | |
with: | |
micromamba-root-path: ${{ runner.temp }}/micromamba-root | |
environment-file: modflow6/environment.yml | |
cache-environment: true | |
cache-downloads: true | |
init-shell: >- | |
bash | |
powershell | |
- name: Setup ifort | |
uses: modflowpy/install-intelfortran-action@v1 | |
- name: Fix Micromamba path (Windows) | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: | | |
# https://github.com/modflowpy/install-intelfortran-action#conda-scripts | |
$mamba_bin = "${{ runner.temp }}\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 |