-
Notifications
You must be signed in to change notification settings - Fork 35
134 lines (115 loc) · 3.9 KB
/
cxx-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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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-with-conda-dependencies:
name: '[conda:${{ matrix.os }}]'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release]
os: [ubuntu-20.04, macos-latest, windows-2019]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
channels: conda-forge
- name: Dependencies [Conda]
shell: bash -l {0}
run: |
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186
conda config --remove channels defaults
# Build and test dependencies (ROS packages to test that resouces are find correctly by ROS/ROS2)
# ros-noetic-catkin is required otherwised ROS_PACKAGE_PATH is not defined and rospack list does not return anything
mamba install -c conda-forge -c robostack -c robostack-humble cmake compilers make ninja pkg-config python ros-noetic-rospack ros-noetic-catkin ros-humble-ros2pkg
- name: Print used environment [Conda]
shell: bash -l {0}
run: |
mamba list
env
- name: Configure [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DICUB_MODELS_USES_PYTHON:BOOL=ON -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} ..
- name: Configure [Conda/Windows]
if: contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DICUB_MODELS_USES_PYTHON:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
- name: Build [Conda]
shell: bash -l {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}
- name: Install [Conda]
shell: bash -l {0}
run: |
cd build
cmake --install . --config ${{ matrix.build_type }}
- name: Test ROS Package can be found [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
# Test ROS
rospack find iCub
# Test ROS2
ros2 pkg prefix iCub
- name: Test ROS Package can be found [Conda/Windows]
if: contains(matrix.os, 'windows')
shell: cmd /C CALL {0}
run: |
rospack find iCub
ros2 pkg prefix iCub
build-with-apt-dependencies:
name: '[apt:${{ matrix.docker_image }}@${{ matrix.build_type }}]'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release]
os:
- ubuntu-latest
docker_image:
- "ubuntu:20.04"
- "ubuntu:22.04"
- "debian:sid"
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v3
# Print environment variables to simplify development and debugging
- name: Environment Variables
shell: bash
run: env
- name: Dependencies [apt]
run: |
# See https://stackoverflow.com/questions/44331836/apt-get-install-tzdata-noninteractive,
# only required by Ubuntu 20.04
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
apt-get -y install \
git build-essential cmake
- name: Configure [apt]
shell: bash
run: |
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
- name: Build
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}