add comments to pendulum.py example #212 #549
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://help.github.com/en/articles/workflow-syntax-for-github-actions | |
name: CI Ubuntu | |
on: | |
push: | |
branches: | |
- "**" | |
paths: | |
- 'cmake/**' | |
- 'src/examples/**' | |
- 'src/python/**' | |
- 'src/robot_dart/**' | |
- 'src/tests/**' | |
- 'src/utheque/**' | |
- 'utheque/**' | |
- 'ci/**' | |
- 'waf_tools/**' | |
- 'wscript' | |
- 'waf' | |
- '.github/workflows/ci_linux.yml' | |
pull_request: | |
branches: | |
- "**" | |
paths: | |
- 'cmake/**' | |
- 'src/examples/**' | |
- 'src/python/**' | |
- 'src/robot_dart/**' | |
- 'src/tests/**' | |
- 'src/utheque/**' | |
- 'utheque/**' | |
- 'ci/**' | |
- 'waf_tools/**' | |
- 'wscript' | |
- 'waf' | |
- '.github/workflows/ci_linux.yml' | |
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-22.04] | |
build_type: [Release] | |
build_python: [ON] | |
compiler: [gcc, clang] | |
magnum_gui: [ON, OFF] | |
dart_tag: ["v6.13.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@v4 | |
- name: Install Ubuntu packages | |
run: ${{github.workspace}}/ci/install_packages.sh | |
- name: Cache DART | |
id: cache-dart | |
uses: actions/cache@v4 | |
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 /home/runner/.dart_install ~/.deps $DART_TAG | |
- 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 --tests --python --prefix=/usr --dart=~/.dart_install ; | |
else | |
./waf configure --tests --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/examples/python/ci.py | |
fi | |