-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (82 loc) · 2.21 KB
/
cpp_wrapper_ci.yml
File metadata and controls
96 lines (82 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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