Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Integration testing #294

Integration testing

Integration testing #294

Workflow file for this run

name: Integration testing
on:
push:
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: Test modflow6 integration
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
env: [ pip, miniconda, micromamba ]
defaults:
run:
shell:
# necessary for miniconda and micromamba
# https://github.com/mamba-org/provision-with-micromamba#important
bash -l {0}
steps:
- name: Checkout action
uses: actions/checkout@v3
- name: Checkout modflow6
uses: actions/checkout@v3
with:
repository: MODFLOW-USGS/modflow6
path: modflow6
- name: Setup Python
if: matrix.env == 'pip'
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
- name: Install Python dependencies
if: matrix.env == 'pip'
shell: bash
run: pip install -r test/requirements.txt
- name: Install miniconda environment
if: matrix.env == 'miniconda'
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: modflow6/environment.yml
- name: Install micromamba environment
if: matrix.env == 'micromamba'
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: modflow6/environment.yml
cache-downloads: true
cache-env: true
- name: Install ifort
uses: ./
with:
path: ${{ runner.os != 'Windows' && 'bin' || 'C:\Program Files (x86)\Intel\oneAPI' }}
- name: Build modflow6 (Linux & Mac)
if: runner.os != 'Windows' && matrix.env == 'pip'
working-directory: modflow6
shell: bash
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson compile -v -C builddir
meson install -C builddir
- name: Build modflow6 (Linux & Mac)
if: runner.os != 'Windows' && matrix.env != 'pip'
working-directory: modflow6
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson compile -v -C builddir
meson install -C builddir
- name: Add micromamba Scripts dir to path (Windows)
if: runner.os == 'Windows' && matrix.env == 'micromamba'
shell: pwsh
run: |
# adding micromamba scripts dir to system path
$mamba_bin = "C:\Users\runneradmin\micromamba-root\envs\modflow6\Scripts"
if (Test-Path $mamba_bin) {
echo "adding micromamba scripts dir to path: $mamba_bin"
echo $mamba_bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
- name: Build modflow6 (Windows bash)
if: runner.os == 'Windows'
continue-on-error: true
working-directory: modflow6
shell: bash -l {0}
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: Build modflow6 (Windows pwsh)
if: runner.os == 'Windows'
continue-on-error: true
working-directory: modflow6
shell: pwsh
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin --wipe
meson compile -v -C builddir
meson install -C builddir
- name: Build modflow6 (Windows cmd)
if: runner.os == 'Windows'
working-directory: modflow6
shell: cmd /C call {0}
run: |
meson setup builddir -Ddebug=false --prefix=%CD% --libdir=bin --wipe
meson compile -v -C builddir
meson install -C builddir
test_pymake:
name: Test pymake integration
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
# windows-2022 runners have Visual Studio 17.4.*, which oneapi toolchain doesn't support yet
os: [ ubuntu-latest, macos-latest, windows-2019 ]
defaults:
run:
shell: bash
steps:
- name: Checkout action
uses: actions/checkout@v3
- name: Checkout pymake
uses: actions/checkout@v3
with:
repository: modflowpy/pymake
path: pymake
- name: Setup Graphviz
if: runner.os == 'Linux'
uses: ts-graphviz/setup-graphviz@v1
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.9
- name: Install Python packages
working-directory: pymake
run: .github/common/install-python.sh
- name: Setup oneAPI compilers
uses: ./
with:
path: ${{ runner.os != 'Windows' && 'bin' || 'C:\Program Files (x86)\Intel\oneAPI' }}
- name: Download examples
working-directory: pymake
run: .github/common/download-examples.sh
- name: Test (Linux)
if: runner.os == 'Linux'
working-directory: pymake
run: pytest -v -n=auto --dist=loadfile -m="base or regression" --durations=0 --cov=pymake --cov-report=xml autotest/
- name: Test (MacOS)
if: runner.os == 'macOS'
working-directory: pymake
run: pytest -v -n=auto --dist=loadfile -m="base" --durations=0 --cov=pymake --cov-report=xml autotest/
- name: Test (Windows)
if: runner.os == 'Windows'
working-directory: pymake
shell: cmd
run: pytest -v -m="base" --durations=0 --cov=pymake --cov-report=xml autotest/