-
Notifications
You must be signed in to change notification settings - Fork 2
152 lines (119 loc) · 5.09 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Continuous Integration with tests on Ubuntu using apt dependencies
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 * * *'
env:
YCM_TAG: v0.14.0
YARP_TAG: v3.6.0
OPENXR_TAG: main
MONADO_TAG: main
jobs:
build:
name: '[${{ matrix.os }}@${{ matrix.build_type }}]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release, Debug]
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@master
- name: Display environment variables
shell: bash
run: env
# 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: System dependencies
run: |
sudo apt update
# Common dependencies
sudo apt install build-essential git cmake
# OpenXR dependencies
sudo apt install libgl1-mesa-dev libvulkan-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev mesa-common-dev
# Yarp dependencies
sudo apt install libace-dev
# yarp-device-openxrheadset dependencies
sudo apt install libeigen3-dev libglm-dev libglfw3-dev libglew-dev
# Monado additional dependencies (just for testing)
sudo apt install wget unzip ninja-build curl patch python3 pkg-config libx11-dev glslang-tools libglvnd-dev ca-certificates libusb-1.0-0-dev libudev-dev libhidapi-dev libwayland-dev libuvc-dev libavcodec-dev libopencv-dev libv4l-dev libcjson-dev libsdl2-dev libegl1-mesa-dev
#Xvfb, just to have a dummy screen
sudo apt install xvfb vulkan-tools mesa-vulkan-drivers
- name: Vulkan extensions
shell: bash -l {0}
run: |
LIBGL_ALWAYS_SOFTWARE=1 __GLX_VENDOR_LIBRARY_NAME=mesa VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.i686.json:/usr/share/vulkan/icd.d/lvp_icd.x86_64.json vulkaninfo
- name: Source-based OpenXR installation
shell: bash -l {0}
run: |
cd ${GITHUB_WORKSPACE}
git clone https://github.com/KhronosGroup/OpenXR-SDK.git --depth 1 --branch ${OPENXR_TAG}
cd OpenXR-SDK && mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=Release ..
make install
- name: Source-based monado installation
shell: bash -l {0}
run: |
cd ${GITHUB_WORKSPACE}
git clone https://gitlab.freedesktop.org/monado/monado.git --depth 1 --branch ${MONADO_TAG}
cd monado && mkdir -p build && cd build
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=Release -DXRT_FEATURE_SERVICE:BOOL=OFF -DXRT_OPENXR_INSTALL_ACTIVE_RUNTIME=OFF ..
ninja install
- name: Source-based YARP installation
shell: bash -l {0}
run: |
# YCM
cd ${GITHUB_WORKSPACE}
git clone -b ${YCM_TAG} https://github.com/robotology/ycm
cd ycm && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=Release ..
make install
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/yarp.git --depth 1 --branch ${YARP_TAG}
cd yarp && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=Release ..
make install
# ===================
# CMAKE-BASED PROJECT
# ===================
- name: Configure
shell: bash -l {0}
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 -DBUILD_TESTING:BOOL=ON ..
- name: Build
shell: bash -l {0}
run: |
cd build
make
- name: Install
shell: bash -l {0}
run: |
cd build
make install
- name: Test
shell: bash -l {0}
#if : false #Disabling until https://gitlab.freedesktop.org/monado/monado/-/issues/170 is fixed
run: |
export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin
yarpserver --write &
cd build
#lavapipe (software Vulkan) settings
export LIBGL_ALWAYS_SOFTWARE=1
export __GLX_VENDOR_LIBRARY_NAME=mesa
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.i686.json:/usr/share/vulkan/icd.d/lvp_icd.x86_64.json
#Monado settings
export XRT_COMPOSITOR_FORCE_XCB=1
export XR_RUNTIME_JSON=${GITHUB_WORKSPACE}/install/share/openxr/1/openxr_monado.json
#Run ctest on a virtual X server environment (xvfb-run)
xvfb-run ctest --output-on-failure -C ${{ matrix.build_type }} .