Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github actions #1

Merged
merged 18 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/macos-dep-brew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: MacOS-dep-brew

# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SUN'

jobs:
build-macos-dep-brew:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11.0]

steps:
# https://github.com/marketplace/actions/cancel-workflow-action
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Print system information
run: sysctl -a | grep machdep.cpu

- name: Print OS information
run: system_profiler SPSoftwareDataType

- name: Install dependencies
run: brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl visp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before brew install ..., I propose to add brew update; brew upgrade to test always with the most recent releases


- name: Configure CMake and build visp_sample
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2
60 changes: 60 additions & 0 deletions .github/workflows/macos-dep-src.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: MacOS-dep-sec

# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SUN'

jobs:
build-macos-dep-sec:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11.0]

steps:
# https://github.com/marketplace/actions/cancel-workflow-action
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Print system information
run: sysctl -a | grep machdep.cpu

- name: Print OS information
run: system_profiler SPSoftwareDataType

- name: Install dependencies
run: brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


# Openblas location is exported explicitly because openblas is keg-only,
# which means it was not symlinked into /usr/local/.
- name: Clone and configure ViSP
run: |
git clone --depth 1 https://github.com/lagadic/visp.git ${HOME}/visp
cd ${HOME}/visp
export LDFLAGS="-L/usr/local/opt/openblas/lib"
export CPPFLAGS="-I/usr/local/opt/openblas/include"
mkdir build && cd build
cmake .. -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
cat ViSP-third-party.txt

- name: Build and install ViSP
run: |
cd ${HOME}/visp/build
make -j2 install
echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $VISP_DIR

- name: Configure CMake and build visp_sample
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2
65 changes: 65 additions & 0 deletions .github/workflows/ubuntu-dep-src.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Ubuntu-dep-src

# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SUN'

jobs:
build-ubuntu-dep-src:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]

steps:
# https://github.com/marketplace/actions/cancel-workflow-action
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Print system information
run: lscpu

- name: Print OS information
run: lsb_release -a

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev
sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev

- name: Build librealsense2 from source
run: |
pwd
git clone --depth 1 https://github.com/IntelRealSense/librealsense.git ${HOME}/librealsense
cd ${HOME}/librealsense
mkdir build && cd build && mkdir install
cmake .. -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
make -j2 install
echo "REALSENSE2_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $REALSENSE2_DIR

- name: Build ViSP from source
run: |
git clone --depth 1 https://github.com/lagadic/visp.git ${HOME}/visp
cd ${HOME}/visp
mkdir build && cd build && mkdir install
cmake .. -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
cat ViSP-third-party.txt
make -j2 install
echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $VISP_DIR

- name: Configure CMake and build visp_sample
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2
6 changes: 5 additions & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
project(sample-core)

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 2.6)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid a warning with cmake 3.19 we should put cmake_minimum_required(VERSION 3.0)

# C++11 is needed for brace-enclosed initializer list in sample-vpVelocityTwistMatrix-3.cpp:9:37
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

file(GLOB src_cpp RELATIVE ${CMAKE_CURRENT_LIST_DIR} "*.cpp")

Expand Down