From 1f1838383b2c22e5b1afeea65ab2ba5a06d1c342 Mon Sep 17 00:00:00 2001 From: "Fernando J. Iglesias Garcia" Date: Sun, 19 May 2024 18:18:40 +0200 Subject: [PATCH] Add CI workflow (build nb ext., still misses run/test from Python). --- .github/workflows/nanobind.yml | 33 +++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nanobind.yml diff --git a/.github/workflows/nanobind.yml b/.github/workflows/nanobind.yml new file mode 100644 index 0000000..822197d --- /dev/null +++ b/.github/workflows/nanobind.yml @@ -0,0 +1,33 @@ +name: Nanobind + +on: + # TODO probably change/add main later. Ah, perhaps this wf can be part of linux.yml? + push: + branches: [ "nanobind" ] + # pull_request: + # branches: [ ] + +jobs: + build: + name: "Build Python interface" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Python setup + uses: actions/setup-python@v5 + with: + python-version: '3.11.9' + + - name: Install dependencies + run: | + sudo apt-get install -y libarpack2-dev libcxxopts-dev libeigen3-dev libfmt-dev python3.11-dev + python -m pip install nanobind + + - name: Configure + run: cmake -B ${{github.workspace}}/build -DBUILD_NANOBIND=ON + + - name: Build + # TODO there are A LOT of warnings in the logs from nanobind (-pedantic, -Wshadow). + run: cmake --build ${{github.workspace}}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index e2c4911..0d842e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,7 +177,7 @@ option(BUILD_NANOBIND "Build nanobind Python extension" OFF) # BUILD_CLI, or so, maybe if there's a CMake command to # configure not building tapkee inside the if BUILD_NANOBIND. if (BUILD_NANOBIND) - message(STATUS "Detecting and configuring nanobind") + message(STATUS "Detecting and configuring nanobind") find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) # Detect the installed nanobind package and import it into CMake execute_process(