{Documentation} AEA Update #141
This file contains 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: Build and Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
name: Build Aria Data Tools on ${{ matrix.os }} / ${{ matrix.cmakeOptions }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest] | |
cmakeOptions: [BUILD_WITH_PANGOLIN=ON, BUILD_WITH_PANGOLIN=OFF] | |
steps: | |
- name : Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- 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 libcereal-dev \ | |
libturbojpeg-dev libpng-dev \ | |
liblz4-dev libzstd-dev libxxhash-dev \ | |
libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-date-time-dev | |
# Build Cereal (header only library) | |
cd /tmp; git clone https://github.com/USCiLab/cereal.git -b v1.3.2 \ | |
&& cd cereal \ | |
&& cmake -DSKIP_PORTABILITY_TEST=1 -DJUST_INSTALL_CEREAL=ON .; sudo make -j$thread install; rm -rf /tmp/cereal; | |
# 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 sophus cereal googletest glog lz4 zstd xxhash libpng jpeg-turbo | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi | |
- name: Install & build optional dependencies (Pangolin) | |
shell: bash | |
if: startsWith(matrix.cmakeOptions, 'BUILD_WITH_PANGOLIN=ON') | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt-get install \ | |
libeigen3-dev \ | |
libglew-dev libgl1-mesa-dev \ | |
libwayland-dev libxkbcommon-dev wayland-protocols | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
brew install eigen glew | |
fi | |
# Build and install Pangolin (optional) | |
cd /tmp; git clone https://github.com/stevenlovegrove/Pangolin.git -b v0.8 \ | |
&& mkdir Pangolin_Build && cd Pangolin_Build \ | |
&& cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TOOLS=OFF -DBUILD_PANGOLIN_PYTHON=OFF -DBUILD_EXAMPLES=OFF ../Pangolin/ \ | |
&& sudo make -j$thread install; | |
- name: Configure | |
shell: bash | |
run: | | |
mkdir build | |
cmake -DCMAKE_BUILD_TYPE=RELEASE -S ./src -B build -D${{ matrix.cmakeOptions }} | |
- name: Build and Test | |
shell: bash | |
run: | | |
cd build | |
make -j8 | |
ctest -j | |
- name: Build Python bindings | |
shell: bash | |
run: | | |
cd ./src | |
# Installing Python and dependencies | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt-get install libpython3-dev python3-pip | |
sudo pip3 install pybind11[global] numpy | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
pip3 install pybind11[global] numpy | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi | |
# Build and install Python bindings | |
pip3 install --global-option=build_ext --global-option="-j8" . |