Skip to content

Commit 667b122

Browse files
committed
Added basic CI
1 parent 2a3ddf7 commit 667b122

1 file changed

Lines changed: 101 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: C++ CI Workflow
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
# * is a special character in YAML so you have to quote this string
8+
# Execute a "nightly" build at 2 AM UTC
9+
- cron: '0 2 * * *'
10+
11+
12+
jobs:
13+
build:
14+
name: '[${{ matrix.os }}@${{ matrix.build_type }}]'
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
build_type: [Release]
19+
os: [ubuntu-latest, windows-latest, macos-latest]
20+
fail-fast: false
21+
22+
23+
steps:
24+
- uses: actions/checkout@master
25+
26+
- uses: conda-incubator/setup-miniconda@v3
27+
with:
28+
miniforge-variant: Miniforge3
29+
miniforge-version: latest
30+
channel-priority: true
31+
conda-remove-defaults: true
32+
channels: conda-forge, robotology
33+
34+
# ============
35+
# DEPENDENCIES
36+
# ============
37+
38+
- name: Dependencies
39+
shell: bash -l {0}
40+
run: |
41+
conda install cmake cxx-compiler make ninja pkg-config yarp ycm-cmake-modules icub-main eigen "idyntree>=10.0.0" libunicycle-footstep-planner osqp-eigen "bipedal-locomotion-framework>=0.18.0" libtrintrin
42+
43+
- name: Print used environment
44+
shell: bash -l {0}
45+
run: |
46+
conda list
47+
env
48+
# ===================
49+
# CMAKE-BASED PROJECT
50+
# ===================
51+
- name: Install icub-contrib from source [Ubuntu/macOs]
52+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
53+
shell: bash -l {0}
54+
run: |
55+
git clone https://github.com/robotology/icub-contrib-common
56+
cd icub-contrib-common
57+
mkdir build
58+
cd build
59+
cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} ..
60+
cmake --build . --target install
61+
62+
- name: Install icub-contrib from source [Windows]
63+
if: matrix.os == 'windows-latest'
64+
shell: bash -l {0}
65+
run: |
66+
git clone https://github.com/robotology/icub-contrib-common
67+
cd icub-contrib-common
68+
mkdir build
69+
cd build
70+
cmake -G"Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library ..
71+
cmake --build . --target install
72+
73+
- name: Configure [Windows]
74+
# Use bash also on Windows (otherwise cd, mkdir, ... do not work)
75+
if: matrix.os == 'windows-latest'
76+
shell: bash -l {0}
77+
run: |
78+
mkdir -p build
79+
cd build
80+
cmake -G"Visual Studio 17 2022" \
81+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
82+
83+
- name: Configure [Ubuntu/macOS]
84+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
85+
shell: bash -l {0}
86+
run: |
87+
mkdir -p build
88+
cd build
89+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
90+
91+
- name: Build
92+
shell: bash -l {0}
93+
run: |
94+
cd build
95+
cmake --build . --config ${{ matrix.build_type }}
96+
97+
- name: Install
98+
shell: bash -l {0}
99+
run: |
100+
cd build
101+
cmake --build . --config ${{ matrix.build_type }} --target install

0 commit comments

Comments
 (0)