forked from robotology/robots-configuration
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (72 loc) · 2.99 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Continuous Integration
on:
push:
branches:
- 'master'
- 'devel'
pull_request:
workflow_dispatch:
jobs:
build:
name: '[${{ matrix.os }}@${{ matrix.build_type }}]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@main
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
# ============
# DEPENDENCIES
# ============
- name: Dependencies
run: |
sudo apt update
sudo apt install git build-essential pkg-config zip unzip zlib1g-dev cmake libace-dev libeigen3-dev libtinyxml-dev libgsl-dev
- name: Source-based Dependencies
shell: bash
run: |
# ycm
cd ${GITHUB_WORKSPACE}/..
git clone https://github.com/robotology/ycm.git --depth 1 --branch master
cd ycm && mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# yarp
cd ${GITHUB_WORKSPACE}/..
git clone https://github.com/robotology/yarp.git --depth 1 --branch master
cd yarp && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DYARP_COMPILE_DEVICE_PLUGINS:BOOL=OFF -DYARP_COMPILE_CARRIER_PLUGINS:BOOL=OFF -DYARP_COMPILE_PORTMONITOR_PLUGINS:BOOL=OFF -DYARP_COMPILE_EXECUTABLES:BOOL=OFF ..
cmake --build . --config ${{ matrix.build_type }} --target install
# icub-contrib-common
cd ${GITHUB_WORKSPACE}/..
git clone https://github.com/robotology/icub-contrib-common.git --depth 1
cd icub-contrib-common && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# ===================
# CMAKE-BASED PROJECT
# ===================
- name: Configure
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 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DINSTALL_ALL_ROBOTS:BOOL=ON ..
- name: Build
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}
- name: Install
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target install