-
Notifications
You must be signed in to change notification settings - Fork 25
94 lines (90 loc) · 3.57 KB
/
ci_linux.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
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: CI Ubuntu
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
build:
if: github.event_name != 'workflow_dispatch'
name: OS:${{ matrix.os }}-Magnum:${{ matrix.magnum_gui }}-Build:${{ matrix.build_type }}-Python:${{ matrix.build_python }}-Compiler:${{ matrix.compiler }}-DART:${{ matrix.dart_tag }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
build_type: [Release]
build_python: [ON]
compiler: [gcc, clang]
magnum_gui: [ON, OFF]
dart_tag: ["v6.12.1"]
env:
COMPILER: ${{ matrix.compiler }}
BUILD_TYPE: ${{ matrix.build_type }}
BUILD_PYTHON: ${{ matrix.build_python }}
MAGNUM_GUI: ${{ matrix.magnum_gui }}
DART_TAG: ${{ matrix.dart_tag }}
LD_LIBRARY_PATH: "/home/runner/.dart_install/lib"
CI_HOME: ${{github.workspace}}
DART_DIR: "/home/runner/.dart_install/share/dart/cmake"
steps:
- uses: actions/checkout@v2
- name: Install Ubuntu packages
run: ${{github.workspace}}/ci/install_packages.sh
- name: Cache DART
id: cache-dart
uses: actions/cache@v2
with:
path: ~/.dart_install
key: dart-${{ matrix.dart_tag }}-${{ matrix.compiler }}-py3_${{ matrix.build_python }}-${{ matrix.os }}
- name: Build DART
if: steps.cache-dart.outputs.cache-hit != 'true'
run: ${{github.workspace}}/ci/install_dart_latest.sh
- name: Build pybind11
if: steps.cache-dart.outputs.cache-hit == 'true'
run: ${{github.workspace}}/ci/install_pybind11.sh
- name: Build Magnum
run: if [ "$MAGNUM_GUI" = "ON" ]; then ${{github.workspace}}/ci/install_magnum.sh ; fi
- name: Build robot_dart
run: |
python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
export PYTHONPATH=/home/runner/.dart_install/$python_dist_dir
if [ "$COMPILER" = "gcc" ]; then
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
fi
if [ "$COMPILER" = "clang" ]; then
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
fi
cd ${{github.workspace}}
if [ "$BUILD_PYTHON" = "ON" ]; then
./waf configure --python --prefix=/usr --dart=~/.dart_install ;
else
./waf configure --prefix=/usr --dart=~/.dart_install ;
fi
./waf
- name: Run tests
run: ./waf --tests
- name: Build examples
run: ./waf examples
- name: Install
run: sudo ./waf install
- name: Run CMake
run: |
if [ "$COMPILER" = "gcc" ]; then
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
fi
if [ "$COMPILER" = "clang" ]; then
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
fi
cd ${{github.workspace}}/cmake/example && mkdir -p build && cd build && cmake -DDART_DIR=$DART_DIR .. && make -j4
cd ${{github.workspace}}/cmake/example_utheque && mkdir -p build && cd build && cmake .. && make -j4
- name: Run Python
run: |
if [ "$BUILD_PYTHON" = "ON" ]; then
python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
export PYTHONPATH=/home/runner/.dart_install/$python_dist_dir
python ${{github.workspace}}/src/python/ci.py
fi