Add Healpix grid #374
Workflow file for this run
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
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
name: Tests | |
jobs: | |
test_cpp: | |
name: Test C++ (${{ matrix.cfg.label }}) | |
runs-on: ${{ matrix.cfg.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
cfg: | |
- {os: ubuntu-latest, gcc: 9, label: "linux / gcc 9"} | |
- {os: ubuntu-latest, gcc: 11, label: "linux / gcc 11"} | |
- {os: macos-12, label: "macos 12"} | |
- {os: macos-14, label: "macos 14"} | |
- {os: windows-latest, label: "windows"} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up GCC (Linux) | |
uses: egor-tensin/setup-gcc@v1 | |
with: | |
version: ${{ matrix.cfg.gcc }} | |
platform: x64 | |
if: runner.os == 'Linux' | |
- name: Setup micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment-dev.yml | |
cache-environment: true | |
cache-downloads: false | |
- name: Install Healpix (Linux and MacOS) | |
if: matrix.cfg.os != 'windows-latest' | |
run: | | |
micromamba install healpix_cxx | |
- name: Configure Fastscapelib (CMake) | |
run: | | |
cmake -S . -B build \ | |
-DFS_DOWNLOAD_GTEST=ON \ | |
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX | |
- name: Build Fastscapelib | |
run: cmake --build build | |
- name: Run tests | |
run: | | |
cd build | |
ctest -T test --output-on-failure . | |
test_py: | |
name: Test Python (${{ matrix.os }} / ${{ matrix.python-version }}) | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-20.04", "ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment-python-dev.yml | |
cache-environment: true | |
cache-downloads: false | |
create-args: >- | |
python=${{ matrix.python-version }} | |
- name: Install Healpix (Linux and MacOS) | |
if: matrix.os != 'windows-latest' | |
run: | | |
micromamba install healpix_cxx | |
- name: Build and install Fastscapelib Python | |
run: | | |
python -m pip install . -v --no-build-isolation | |
- name: Run tests | |
run: | | |
pytest python/fastscapelib/tests -vv --color=yes | |
test_npy: | |
name: Test Python (Numpy 1.xx compat) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Build and install Fastscapelib Python (Numpy 2.x) | |
run: | | |
python -m pip install . --config-settings=cmake.define.FS_DOWNLOAD_XTENSOR_PYTHON=ON | |
- name: Run tests (Numpy 1.xx) | |
run: | | |
python -m pip install numpy==1.26.4 pytest | |
pytest python/fastscapelib/tests -vv --color=yes |