-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.48 KB
/
ci.yml
File metadata and controls
63 lines (51 loc) · 1.48 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
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