-
Notifications
You must be signed in to change notification settings - Fork 29
109 lines (93 loc) · 3.42 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
name: C++ CI Workflow with dependencies installed via conda
on:
push:
pull_request:
workflow_dispatch:
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 }}@conda]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release]
os: [ubuntu-latest, windows-2019, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci_env.yml
- name: Configure VS Toolchain (Windows)
if: contains(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.12.1
- name: Setup compilation env variables (not Windows)
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
shell: bash -l {0}
run: |
echo "CMAKE_INSTALL_PREFIX=${CONDA_PREFIX}" >> $GITHUB_ENV
- name: Setup compilation env variables (Windows)
if: contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
bash_vc_install=${VCToolsInstallDir//\\//}
compiler_path=${bash_vc_install}bin/Hostx64/x64/cl.exe
echo "CC=${compiler_path}" >> $GITHUB_ENV
echo "CXX=${compiler_path}" >> $GITHUB_ENV
echo "CMAKE_INSTALL_PREFIX=${CONDA_PREFIX}\Library" >> $GITHUB_ENV
- name: Configure
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_TESTING:BOOL=ON \
-DHDE_COMPILE_PYTHON_BINDINGS:BOOL=ON -DHUMANSTATEPROVIDER_ENABLE_VISUALIZER:BOOL=ON \
-DHUMANSTATEPROVIDER_ENABLE_LOGGER:BOOL=ON -DHDE_DETECT_ACTIVE_PYTHON_SITEPACKAGES:BOOL=ON ..
- name: Build
shell: bash -l {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}
- name: Test
shell: bash -l {0}
run: |
cd build
ctest --output-on-failure -C ${{ matrix.build_type }} .
- name: Install
shell: bash -l {0}
run: |
cd build
cmake --install . --config ${{ matrix.build_type }}
- name: Check install
shell: bash -l {0}
run: |
# Test CMake packages
cmake-package-check IWear --targets IWear::IWear
cmake-package-check WearableData --targets WearableData::WearableData
cmake-package-check WearableActuators --targets WearableActuators::WearableActuators
cmake-package-check HumanDynamicsEstimation --targets HumanDynamicsEstimation::HumanStateMsg
# Test python packages
python -c "import wearables"
python -c "import hde"
- name: Test standalone build of bindings
shell: bash -l {0}
run: |
cd bindings
mkdir -p build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_TESTING:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON \
-DHDE_DETECT_ACTIVE_PYTHON_SITEPACKAGES:BOOL=ON ..
cmake --build . --config ${{ matrix.build_type }}
ctest --output-on-failure -C ${{ matrix.build_type }} .
cmake --install . --config ${{ matrix.build_type }}
- name: Check install of standalone build of bindings
shell: bash -l {0}
run: |
# Test python packages
python -c "import wearables"
python -c "import hde"