Feat dsi_pyworker (#559) #2141
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: | |
workflow_dispatch: | |
jobs: | |
pyemuCI: | |
name: autotests | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 120 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] | |
run-type: [std] | |
test-path: ["."] | |
include: | |
- os: macos-latest | |
python-version: 3.11 | |
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 | |
cache-environment-key: environment-${{ steps.date.outputs.date }} | |
cache-downloads-key: downloads-${{ steps.date.outputs.date }} | |
- name: Checkout pypestutils | |
uses: actions/checkout@v4 | |
with: | |
repository: pypest/pypestutils | |
ref: develop | |
path: pypestutils | |
# - name: Install MinGW-w64 tools (Windows) | |
# if: runner.os == 'Windows' | |
# uses: msys2/setup-msys2@v2 | |
# with: | |
# msystem: MINGW64 | |
# path-type: inherit | |
## install: >- | |
## mingw-w64-x86_64-gcc-fortran | |
## mingw-w64-x86_64-lapack | |
## mingw-w64-x86_64-meson | |
## mingw-w64-x86_64-ninja | |
- name: Install meson and gfortran (for ppu) | |
shell: bash -l {0} | |
run: | | |
micromamba install meson gfortran | |
- name: Build pypestutils (Windows) | |
if: runner.os == 'Windows' | |
shell: bash -l {0} | |
working-directory: pypestutils | |
env: | |
LDFLAGS: -static-libgcc -static-libgfortran -static-libquadmath -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive | |
run: | | |
scripts/build_lib.sh | |
- name: Build pypestutils (non-Windows) | |
if: runner.os != 'Windows' | |
shell: bash -l {0} | |
working-directory: pypestutils | |
run: | | |
scripts/build_lib.sh | |
- name: Install pypestutils | |
shell: bash -l {0} | |
working-directory: pypestutils | |
run: | | |
pip install -e . | |
- 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 -rP -rx --capture=no -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.11 }} | |
shell: bash -l {0} | |
working-directory: ./examples | |
run: | | |
micromamba install --name pyemu jupyter jupytext | |
pytest -v -rP -rx --capture=no -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 |