Skip to content

Update examples

Update examples #388

Workflow file for this run

name: Test
on:
workflow_dispatch:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
# Install and run pre-commit
- run: |
pip install pre-commit
pre-commit install
pre-commit run --all-files
working-directory: .
pytest:
name: Pytest ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
config:
- { name: "Linux", os: ubuntu-latest }
- { name: "MacOSX", os: macos-latest }
- { name: "Windows", os: windows-latest }
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Conditionally install pykdtree from source for MacOS only
- name: Install pykdtree from source on macOS
if: matrix.config.os == 'macos-latest'
run: |
export USE_OMP=0
pip install --no-binary pykdtree pykdtree>=1.3.13
- name: Install OSMesa for Linux
if: matrix.config.os == 'ubuntu-latest'
run: sudo apt-get install -y libosmesa6-dev
- name: Install and Run Tests (without viewer)
if: matrix.config.os == 'windows-latest'
run: |
pip install .
pip install -r tests/requirements.txt
pytest -s ./tests/test_xarray.py
pytest -s ./tests/test_builder.py
working-directory: .
- name: Install and Run Tests (with viewer)
if: matrix.config.os != 'windows-latest'
run: |
pip install .
pip install -r tests/requirements.txt
pytest -s ./tests/test_xarray.py
pytest -s ./tests/test_builder.py
pip install .[viewer]
pytest -s ./tests/test_viewer.py
working-directory: .