pyemu continuous integration #1609
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: pyemu continuous integration | |
on: | |
schedule: | |
- cron: '0 8 * * *' # run at 8 AM UTC (12 AM PST, 8 PM NZST) | |
push: | |
pull_request: | |
jobs: | |
pyemuCI: | |
name: autotests | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 120 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] # , macos-latest] | |
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] | |
run-type: [std] | |
test-path: ["."] | |
include: | |
- os: macos-latest | |
python-version: 3.9 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 # checksout this repo | |
- name: Set Windows ENV | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
# Setup conda env | |
- name: Install Conda environment using micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: etc/environment.yml | |
environment-name: pyemu | |
create-args: >- | |
python=${{ matrix.python-version }} | |
cache-downloads: true | |
cache-environment: true | |
- name: Install pyemu | |
shell: bash -l {0} | |
run: | | |
pip install -e . | |
micromamba list | |
- name: Install Modflow executables | |
uses: modflowpy/install-modflow-action@v1 | |
- name: Add executables directory to path | |
shell: bash | |
run: | | |
echo "$MODFLOW_BIN_PATH" >> $GITHUB_PATH | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
echo $GITHUB_PATH | |
# order matters for this step - after setting path to executables | |
- name: Install PEST++ suite using get-pestpp | |
shell: bash -l {0} | |
run: | | |
get-pestpp :home | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.test-path }} | |
shell: bash -l {0} | |
working-directory: ./autotest | |
run: | | |
pytest -v -n=auto --tb=native --cov=pyemu --cov-report=lcov ${{ matrix.test-path }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test Notebooks | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 }} | |
shell: bash -l {0} | |
working-directory: ./examples | |
run: | | |
micromamba install --name pyemu jupyter jupytext | |
pytest -v -n=auto --nbmake --cov=pyemu --cov-report=lcov:../autotest/coverage.lcov \ | |
--cov-config=../autotest/.coveragerc *.ipynb | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
flag-name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.test-path }} | |
parallel: true | |
path-to-lcov: autotest/coverage.lcov | |
coveralls_finish: | |
needs: pyemuCI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true | |
path-to-lcov: autotest/coverage.lcov |