Skip to content

workflow fix and readme edit #2

workflow fix and readme edit

workflow fix and readme edit #2

name: CI Build & Test
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Load cache
uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
# ---------------------------
# 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 \
libcurl4-openssl-dev \
python3-dev \
python3-pip
- name: Build and install C++ tool
run: |
cd cpp
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release
sudo cmake \
--build build \
--target install
- name: Build and Run C++ tool unit tests
run: |
cd cpp
cmake \
-S test \
-B build/test \
-DTEST_INSTALLED_VERSION=1
cmake \
--build build/test \
--config Debug \
-j4
cmake \
--build build/test \
--target test
# -----------------------------
# Part 2: Python install & tests
# -----------------------------
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.13"
- 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
cd cli
pip install .
- name: Run Python unit tests
run: |
source venv/bin/activate
pytest -q