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 CI #453

Merged
merged 7 commits into from
Nov 17, 2019
Merged
Changes from all commits
Commits
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
99 changes: 99 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: C++ CI Workflow

on:
push:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build at 2 AM UTC
- cron: '0 2 * * *'


jobs:
build:
name: '[${{ matrix.os }}@${{ matrix.build_type }}@yarp:${{ matrix.yarp_version }}@gazebo:${{ matrix.gazebo_version }}]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release, Debug]
os: [ubuntu-latest, macOS-latest]
gazebo_version: [gazebo9, gazebo10]
yarp_version: [devel]

steps:
- uses: actions/checkout@master

# Print environment variables to simplify development and debugging
- name: Environment Variables
shell: bash
run: env

# ============
# DEPENDENCIES
# ============

- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
shell: bash
run: |
brew cask install xquartz
brew install ace eigen opencv@3 osrf/simulation/${{ matrix.gazebo_version }}

- name: Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-latest.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install git build-essential cmake libace-dev libeigen3-dev libopencv-dev
sudo apt-get install lib${{ matrix.gazebo_version }}-dev

- name: Source-based Dependencies [Ubuntu/macOS]
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
shell: bash
run: |
# YCM
git clone https://github.com/robotology/ycm
cd ycm
git checkout devel
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
cmake --build . --config ${{ matrix.build_type }} --target install
# YARP
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/yarp
Copy link
Member

Choose a reason for hiding this comment

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

I would add cd ${GITHUB_WORKSPACE} here

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, fixed it in 3ec9d8b .

cd yarp
git checkout ${{ matrix.yarp_version }}
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
cmake --build . --config ${{ matrix.build_type }} --target install

# ===================
# CMAKE-BASED PROJECT
# ===================

- name: Configure [Ubuntu/macOS]
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
shell: bash
run: |
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..

- name: Build
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}

- name: Install [Ubuntu/macOS]
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target install