-
Notifications
You must be signed in to change notification settings - Fork 171
102 lines (84 loc) · 3.85 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
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
cmake_flags: ["", " -DBUILD_CLOUD_CLIENT=OFF "]
include:
- name: ubuntu-20.04-gcc-5
os: ubuntu-20.04
compiler: gcc
version: 5
steps:
- uses: actions/checkout@v3
- name: Get cross-platform /dev/null for hidden output
run: echo "HIDDEN=$(python3 -c "import os; print(os.devnull)")" >> $GITHUB_ENV
- name: Install pybind11
run: |
git clone https://github.com/pybind/pybind11.git
cd pybind11
git checkout v2.11.1
- name: Set compiler version and patch C++11
if: matrix.name == 'ubuntu-20.04-gcc-5'
run: |
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/gcc-5-base_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/i/isl-0.18/libisl15_0.18-4_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/cpp-5_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/libasan2_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/libmpx0_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/libgcc-5-dev_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/gcc-5_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/libstdc++-5-dev_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/g++-5_5.5.0-12ubuntu1_amd64.deb
sudo apt install ./g++-5_5.5.0-12ubuntu1_amd64.deb ./gcc-5_5.5.0-12ubuntu1_amd64.deb ./gcc-5-base_5.5.0-12ubuntu1_amd64.deb ./cpp-5_5.5.0-12ubuntu1_amd64.deb ./libisl15_0.18-4_amd64.deb ./libgcc-5-dev_5.5.0-12ubuntu1_amd64.deb ./libasan2_5.5.0-12ubuntu1_amd64.deb ./libmpx0_5.5.0-12ubuntu1_amd64.deb ./libstdc++-5-dev_5.5.0-12ubuntu1_amd64.deb
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
bash scripts/patch-c++11.sh inplace
- name: Install valgrind
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y valgrind
- name: Configure and make
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_MODULE=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARK=ON ${{ matrix.cmake_flags }} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=.
cmake --build build --config Release -j2
- name: Run C++ Examples
working-directory: build
run: |
./example-01_position > "$HIDDEN"
./example-02_position_offline > "$HIDDEN"
./example-05_velocity > "$HIDDEN"
./example-06_stop > "$HIDDEN"
./example-07_minimum_duration > "$HIDDEN"
./example-09_dynamic_dofs > "$HIDDEN"
- name: Run Python Examples
if: matrix.name != 'ubuntu-20.04-gcc-5'
run: |
python3 ./examples/01_position.py > "$HIDDEN"
python3 ./examples/02_position_offline.py > "$HIDDEN"
python3 ./examples/05_velocity.py > "$HIDDEN"
python3 ./examples/06_stop.py > "$HIDDEN"
python3 ./examples/07_minimum_duration.py > "$HIDDEN"
env:
PYTHONPATH: build
- name: Test
if: matrix.os == 'ubuntu-latest'
run: |
./build/test-target 5000000
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Memory Test
if: matrix.os == 'ubuntu-latest'
run: |
ctest --test-dir ./build -T memcheck
lint-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint Python
run: |
python3 -m pip install ruff
ruff examples test