Skip to content

Tests

Tests #396

Workflow file for this run

name: Tests
on:
schedule:
- cron: '42 8 2-30/2 * *' # At 08:42 UTC on every 2nd day-of-month
push:
pull_request:
jobs:
tests:
name: Tests on ${{ matrix.os }} Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
python-version: ["3.9", "3.13"] # run lower and upper versions
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- 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 GCC Fortran (macOS)
if: runner.os == 'macOS'
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: 11
- name: Install build dependencies (macOS)
if: runner.os == 'macOS'
run: |
pip install meson ninja pandas numpy matplotlib pyemu flopy jupyter notebook nbconvert
- name: Install build dependencies (macOS)
if: runner.os == 'Windows'
run: |
pip install meson ninja pandas numpy matplotlib pyemu flopy jupyter notebook nbconvert
- name: Install build dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gfortran
pip install meson ninja pandas numpy matplotlib pyemu flopy jupyter notebook nbconvert
- name: Build pestutils (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
env:
LDFLAGS: -static-libgcc -static-libgfortran -static-libquadmath -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive
run: bash scripts/build_lib.sh
- name: Build pestutils (non-Windows)
if: runner.os != 'Windows'
run: bash scripts/build_lib.sh
- name: Install package
run: pip install .[test,optional]
- name: Run tests
run: pytest -v
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}