Tests #356
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: 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: Run tests on ${{ matrix.os }} Py${{ matrix.python }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-12, windows-latest] | |
python-version: ["3.8", "3.11"] # 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: awvwgk/setup-fortran@main | |
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 }} |