fix #75
This file contains hidden or 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: CI Build & Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| # --------------------------- | |
| # Part 1: C++ Build & CTest | |
| # --------------------------- | |
| - name: Install C++ build dependencies | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y build-essential cmake git python3-dev python3-pip | |
| - name: Configure and build C++ code | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release | |
| cmake --build . --parallel $(nproc) | |
| - name: Run C++ unit tests with CTest | |
| run: | | |
| cd build | |
| ctest --output-on-failure | |
| # ----------------------------- | |
| # Part 2: Python install & tests | |
| # ----------------------------- | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Create & activate virtualenv | |
| run: | | |
| python -m venv venv | |
| source venv/bin/activate | |
| python -m pip install --upgrade pip setuptools scikit-build pytest | |
| - name: Install package (C++ + Python wrapper) via pip | |
| run: | | |
| source venv/bin/activate | |
| pip install . | |
| - name: Run Python unit tests | |
| run: | | |
| source venv/bin/activate | |
| pytest -q |