nanobind #56
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: nanobind | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '.github/workflows/nanobind.yml' | |
schedule: | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
- cron: "0 2 * * 0" | |
jobs: | |
# This is the "main" test suite, which tests a large number of different | |
# versions of default compilers and Python versions in GitHub Actions. | |
standard: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest'] | |
python: ['pypy-3.11-nightly', 'pypy-3.10-nightly'] | |
name: "${{ matrix.python }} / ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: wjakob/nanobind | |
submodules: true | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
- name: Install the latest CMake | |
uses: lukka/get-cmake@latest | |
- name: Install Eigen | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get -y install libeigen3-dev | |
- name: Install PyTest | |
run: | | |
python -m pip install pytest pytest-github-actions-annotate-failures typing_extensions | |
- name: Install NumPy | |
if: ${{ !startsWith(matrix.python, 'pypy') && !contains(matrix.python, 'alpha') }} | |
run: | | |
python -m pip install numpy scipy | |
- name: Configure | |
run: > | |
cmake -S . -B build -DNB_TEST_STABLE_ABI=ON -DNB_TEST_SHARED_BUILD="$(python3 -c 'import sys; print(int(sys.version_info.minor>=11))')" | |
- name: Build C++ | |
run: cmake --build build -j 2 | |
- name: Run tests | |
run: > | |
cd build; | |
python -m pytest |