-
Notifications
You must be signed in to change notification settings - Fork 74
112 lines (98 loc) · 3.34 KB
/
build-and-test.yml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build and Test
on:
push:
branches: [main]
paths-ignore:
- "**/website/**"
pull_request:
branches: [main]
paths-ignore:
- "**/website/**"
jobs:
build:
name: Build projectaria_tools on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14] # macos-14 is macSilicon
steps:
- name : Checkout
uses: actions/checkout@v4
- name: Install dependencies
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
# Update & upgrade package lists
sudo apt-get update -y
sudo apt-get upgrade
# Deal with Github CI limitation
# https://github.com/actions/runner-images/issues/6399#issuecomment-1285011525
sudo apt install -y libunwind-dev
# Generic dependencies
sudo apt-get install cmake
# Install VRS dependencies
sudo apt-get install -o Acquire::Retries=5 \
libgtest-dev libgmock-dev \
libfmt-dev \
libturbojpeg-dev libpng-dev \
liblz4-dev libzstd-dev libxxhash-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-system-dev
# Clean APT cache
sudo apt-get clean
elif [ "$RUNNER_OS" == "macOS" ]; then
# Install system deps with Homebrew
brew install cmake
# VRS dependencies
brew install boost fmt googletest glog lz4 zstd xxhash libpng jpeg-turbo
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Configure
shell: bash
run: |
mkdir build
cmake -DCMAKE_BUILD_TYPE=RELEASE -S . -B build \
-DBUILD_UNIT_TEST=ON
- name: C++ - Build and Test
shell: bash
run: |
cd build
make -j8
ctest -j
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Python - Build and Test Python bindings
shell: bash
run: |
# Build and install Python bindings
CMAKE_BUILD_PARALLEL_LEVEL=4 pip3 install .
# Run Python unit tests
export TEST_FOLDER="./data/"
python3 -m unittest core/python/test/corePyBindTest.py
python3 -m unittest core/python/test/mpsPyBindTest.py
python3 -m unittest core/python/sophus/test/sophusPybindTest.py
- name: Test Python Notebooks
shell: bash
run: |
cd core/examples
# Installing dependencies
pip3 install jupyter matplotlib tqdm pillow
# Running the notebooks
jupyter nbconvert --execute --inplace dataprovider_quickstart_tutorial.ipynb
# Install additional required dependencies
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y curl unzip
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install curl unzip
else
echo "$RUNNER_OS not supported"
exit 1
fi
pip3 install plotly
jupyter nbconvert --execute --inplace mps_quickstart_tutorial.ipynb