Skip to content

Commit c5aa3e8

Browse files
authored
Merge pull request #141 from resibots/new_ci
CI via GitHub Actions
2 parents b078fe5 + d3d63c2 commit c5aa3e8

11 files changed

+216
-299
lines changed

.github/workflows/ci_linux.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
2+
3+
name: CI Ubuntu
4+
5+
on:
6+
push:
7+
branches:
8+
- "**"
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
jobs:
14+
build:
15+
if: github.event_name != 'workflow_dispatch'
16+
name: OS:${{ matrix.os }}-Magnum:${{ matrix.magnum_gui }}-Build:${{ matrix.build_type }}-Python:${{ matrix.build_python }}-Compiler:${{ matrix.compiler }}-DART:${{ matrix.dart_tag }}
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-20.04]
22+
build_type: [Release]
23+
build_python: [ON]
24+
compiler: [gcc, clang]
25+
magnum_gui: [ON, OFF]
26+
dart_tag: ["v6.11.1"]
27+
env:
28+
COMPILER: ${{ matrix.compiler }}
29+
BUILD_TYPE: ${{ matrix.build_type }}
30+
BUILD_PYTHON: ${{ matrix.build_python }}
31+
MAGNUM_GUI: ${{ matrix.magnum_gui }}
32+
DART_TAG: ${{ matrix.dart_tag }}
33+
LD_LIBRARY_PATH: "/home/runner/.dart_install/lib"
34+
CI_HOME: ${{github.workspace}}
35+
DART_DIR: "/home/runner/.dart_install/share/dart/cmake"
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Install Ubuntu packages
39+
run: ${{github.workspace}}/ci/install_packages.sh
40+
- name: Cache DART
41+
id: cache-dart
42+
uses: actions/cache@v2
43+
with:
44+
path: ~/.dart_install
45+
key: dart-${{ matrix.dart_tag }}-${{ matrix.compiler }}-py3_${{ matrix.build_python }}-${{ matrix.os }}
46+
- name: Build DART
47+
if: steps.cache-dart.outputs.cache-hit != 'true'
48+
run: ${{github.workspace}}/ci/install_dart_latest.sh
49+
- name: Build Magnum
50+
run: if [ "$MAGNUM_GUI" = "ON" ]; then ${{github.workspace}}/ci/install_magnum.sh ; fi
51+
- name: Build robot_dart
52+
run: |
53+
python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
54+
export PYTHONPATH=/home/runner/.dart_install/$python_dist_dir
55+
if [ "$COMPILER" = "gcc" ]; then
56+
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
57+
fi
58+
if [ "$COMPILER" = "clang" ]; then
59+
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
60+
fi
61+
cd ${{github.workspace}}
62+
if [ "$BUILD_PYTHON" = "ON" ]; then
63+
./waf configure --python --prefix=/usr --dart=~/.dart_install ;
64+
else
65+
./waf configure --prefix=/usr --dart=~/.dart_install ;
66+
fi
67+
./waf
68+
- name: Run tests
69+
run: ./waf --tests
70+
- name: Build examples
71+
run: ./waf examples
72+
- name: Install
73+
run: sudo ./waf install
74+
- name: Run CMake
75+
run: |
76+
if [ "$COMPILER" = "gcc" ]; then
77+
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
78+
fi
79+
if [ "$COMPILER" = "clang" ]; then
80+
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
81+
fi
82+
cd ${{github.workspace}}/cmake/example && mkdir -p build && cd build && cmake -DDART_DIR=$DART_DIR .. && make -j4
83+
- name: Run Python
84+
run: |
85+
if [ "$BUILD_PYTHON" = "ON" ]; then
86+
python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
87+
export PYTHONPATH=/home/runner/.dart_install/$python_dist_dir
88+
python ${{github.workspace}}/src/python/ci.py
89+
fi
90+

.github/workflows/ci_linux_dart.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
2+
3+
name: CI Ubuntu (DART Building)
4+
5+
on:
6+
schedule:
7+
- cron: 22 6 * * 1
8+
9+
jobs:
10+
build:
11+
if: github.event_name != 'workflow_dispatch'
12+
name: OS:${{ matrix.os }}-Build:${{ matrix.build_type }}-Python:${{ matrix.build_python }}-Compiler:${{ matrix.compiler }}-DART:${{ matrix.dart_tag }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-20.04]
18+
build_type: [Release]
19+
build_python: [ON]
20+
compiler: [gcc, clang]
21+
dart_tag: ["v6.11.1"]
22+
env:
23+
COMPILER: ${{ matrix.compiler }}
24+
BUILD_TYPE: ${{ matrix.build_type }}
25+
BUILD_PYTHON: ${{ matrix.build_python }}
26+
DART_TAG: ${{ matrix.dart_tag }}
27+
LD_LIBRARY_PATH: "/home/runner/.dart_install/lib"
28+
CI_HOME: ${{github.workspace}}
29+
DART_DIR: "/home/runner/.dart_install/share/dart/cmake"
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Install Ubuntu packages
33+
run: ${{github.workspace}}/ci/install_packages.sh
34+
- name: Cache DART
35+
id: cache-dart
36+
uses: actions/cache@v2
37+
with:
38+
path: ~/.dart_install
39+
key: dart-${{ matrix.dart_tag }}-${{ matrix.compiler }}-py3_${{ matrix.build_python }}-${{ matrix.os }}
40+
- name: Build DART
41+
run: ${{github.workspace}}/ci/install_dart_latest.sh

.travis.yml

Lines changed: 0 additions & 188 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
robot_dart [![Build Status](https://travis-ci.org/resibots/robot_dart.svg?branch=master)](https://travis-ci.org/resibots/robot_dart)
2-
=====================================================================================================================================
1+
robot_dart [![Build Status](https://github.com/resibots/robot_dart/actions/workflows/ci_linux.yml/badge.svg?branch=master)](https://github.com/resibots/robot_dart/actions/workflows/ci_linux.yml)
2+
=====================================================================================================================================================================================================
33

44
### CAUTION: The library is under-going a serious re-structure and development. Expect breaking of API/ABI, and out-of-date guides. We will soon provide a new release with many new features and a proper documentation.
55

ci/install_dart_extra_deps.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

ci/install_dart_latest.sh

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
1-
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
2-
sudo apt-get -qq update
3-
sudo apt-get -y install software-properties-common
4-
sudo apt-add-repository -y ppa:dartsim/ppa
5-
sudo apt-get -qq update
1+
mkdir -p ~/.deps
2+
cd ~/.deps
63

7-
sudo apt-get install -y --no-install-recommends libassimp-dev libccd-dev libfcl-dev
8-
else
9-
HOMEBREW_NO_AUTO_UPDATE=1 brew install dartsim --only-dependencies
10-
fi
4+
python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
5+
mkdir -p ~/.dart_install/$python_dist_dir
116

127
git clone git://github.com/dartsim/dart.git
138
cd dart
14-
git checkout v6.10.1
9+
git checkout $DART_TAG
1510
mkdir build
1611
cd build
17-
if [ "$PYTHON_TESTS" = "ON" ]; then
18-
cmake -DDART_BUILD_DARTPY=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
12+
# Select Compiler
13+
if [ "$COMPILER" = "gcc" ]; then
14+
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
15+
fi
16+
if [ "$COMPILER" = "clang" ]; then
17+
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
18+
fi
19+
# Build DART
20+
if [ "$BUILD_PYTHON" = "ON" ]; then
21+
cmake -DDART_BUILD_DARTPY=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/home/runner/.dart_install ..
1922
else
20-
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
23+
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/home/runner/.dart_install ..
2124
fi
2225
make -j4
2326
sudo make install
24-
if [ "$PYTHON_TESTS" = "ON" ]; then
27+
if [ "$BUILD_PYTHON" = "ON" ]; then
2528
sudo make install-dartpy
2629
fi
2730
sudo ldconfig
2831
cd $CI_HOME
32+
33+
# Hack for dartpy installation
34+
python_file=/usr/lib/python3/dist-packages/dartpy.cpython-38-x86_64-linux-gnu.so
35+
if [ -f "$python_file" ]; then
36+
cp $python_file ~/.dart_install/$python_dist_dir
37+
fi

0 commit comments

Comments
 (0)