Skip to content

Commit

Permalink
add build-and-test-pysophus.yml to run pysophus unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng Peng committed Sep 13, 2023
1 parent 7cbf16c commit 5a038da
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 21 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build-and-test-pysophus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
name: Build pysophus on ${{ matrix.os }} / ${{ matrix.cmakeOptions }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-10.15]
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
# Clean APT cache
sudo apt-get clean
elif [ "$RUNNER_OS" == "macOS" ]; then
# Install system deps with Homebrew
brew install cmake
# VRS dependencies
brew install fmt lz4 zstd xxhash
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Install pysophus
shell: bash
run: |
# Installing Python and dependencies
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libpython3-dev python3-pip
sudo pip3 install numpy pytest
elif [ "$RUNNER_OS" == "macOS" ]; then
pip3 install numpy pytest
else
echo "$RUNNER_OS not supported"
exit 1
fi
# Build and install Python bindings
pip3 install .
- name: Run pysophus tests
shell: bash
run: python3 -m pytest pysophus/tests/sophusPybindTests.py
21 changes: 0 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,3 @@ jobs:

- name: Run tests
run: ./scripts/run_cpp_tests.sh

- name: Install pysophus
shell: bash
run: |
# Installing Python and dependencies
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libpython3-dev python3-pip
sudo pip3 install numpy pytest
elif [ "$RUNNER_OS" == "macOS" ]; then
pip3 install numpy pytest
else
echo "$RUNNER_OS not supported"
exit 1
fi
# Build and install Python bindings
pip3 install .
- name: Run pysophus tests
shell: bash
run: pytest pysophus/tests/sophusPybindTests.py
1 change: 1 addition & 0 deletions pysophus/SO3PyBind.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <fmt/format.h>
#include <sophus/common.hpp>
#include <sophus/so3.hpp>

Expand Down

0 comments on commit 5a038da

Please sign in to comment.