From 975802cc411aafaae5f2473cb1b88956a2baa8af Mon Sep 17 00:00:00 2001 From: Masaki Murooka Date: Wed, 20 Nov 2024 13:43:10 +0900 Subject: [PATCH] Add CI. --- .github/workflows/ci.yaml | 101 ++++++++++++++++++++++++++++ .github/workflows/clang-format.yaml | 24 +++++++ LICENSE | 2 +- README.md | 4 ++ 4 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/clang-format.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..a1282bc --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,101 @@ +name: CI of HumanRetargetingController + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + schedule: + - cron: '0 0 * * 0' + +jobs: + build-and-test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04] + catkin-build: [catkin, standalone] + build-type: [RelWithDebInfo, Debug] + mc-rtc-version: [head, stable] + motion-type: [SampleMotion] + exclude: + - build-type: Debug + mc-rtc-version: stable + # Some packages have not been released onto the stable mirror yet + - catkin-build: standalone + mc-rtc-version: stable + runs-on: ${{ matrix.os }} + env: + RESULTS_POSTFIX: ${{ matrix.motion-type }}-${{ matrix.catkin-build }} + steps: + - name: Setup environment variables + run: | + set -e + set -x + if [ "${{ matrix.os }}" == "ubuntu-20.04" ] && \ + [ "${{ matrix.build-type }}" == "RelWithDebInfo" ] && \ + [ "${{ matrix.mc-rtc-version }}" == "head" ] + then + echo "RUN_SIMULATION_STEPS=true" >> $GITHUB_ENV + else + echo "RUN_SIMULATION_STEPS=false" >> $GITHUB_ENV + fi + if [ "${{ matrix.os }}" == "ubuntu-20.04" ] && \ + [ "${{ matrix.catkin-build }}" == "catkin" ] && \ + [ "${{ matrix.build-type }}" == "RelWithDebInfo" ] && \ + [ "${{ matrix.mc-rtc-version }}" == "head" ] && \ + [ "${{ matrix.motion-type }}" == "MotionSampleField" ] && \ + [ "${{ github.repository_owner }}" == "isri-aist" ] && \ + [ "${{ github.ref }}" == "refs/heads/master" ] + then + echo "UPLOAD_DOCUMENTATION=true" >> $GITHUB_ENV + else + echo "UPLOAD_DOCUMENTATION=false" >> $GITHUB_ENV + fi + if [ "${{ matrix.catkin-build }}" == "catkin" ] + then + echo "CI_DIR=${GITHUB_WORKSPACE}/catkin_ws/src/${{ github.repository }}/.github/workflows" >> $GITHUB_ENV + else + echo "CI_DIR=${GITHUB_WORKSPACE}/.github/workflows" >> $GITHUB_ENV + fi + - name: Install dependencies + uses: jrl-umi3218/github-actions/install-dependencies@master + with: + ubuntu: | + apt-mirrors: + mc-rtc: + cloudsmith: mc-rtc/${{ matrix.mc-rtc-version }} + apt: libmc-rtc-dev mc-rtc-utils mc-state-observation doxygen graphviz jvrc-choreonoid choreonoid libcnoid-dev + ros: | + apt: ros-base mc-rtc-plugin eigen-conversions + - name: Install standalone dependencies + if: matrix.catkin-build == 'standalone' + uses: jrl-umi3218/github-actions/install-dependencies@master + with: + build-type: ${{ matrix.build-type }} + ubuntu: | + apt: libforcecontrolcollection-dev libtrajectorycollection-dev libcentroidalcontrolcollection-dev + github: | + - path: isri-aist/BaselineWalkingController + - path: isri-aist/CnoidRosUtils + - name: Checkout repository code + if: matrix.catkin-build == 'standalone' + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Standalone build + if: matrix.catkin-build == 'standalone' + uses: jrl-umi3218/github-actions/build-cmake-project@master + with: + build-type: ${{ matrix.build-type }} + - name: Catkin build + if: matrix.catkin-build == 'catkin' + uses: jrl-umi3218/github-actions/build-catkin-project@master + with: + build-type: ${{ matrix.build-type }} + cmake-args: -DINSTALL_DOCUMENTATION=${{ env.UPLOAD_DOCUMENTATION }} -DENABLE_QLD=ON + catkin-test-args: --no-deps + build-packages: human_retargeting_controller + test-packages: human_retargeting_controller diff --git a/.github/workflows/clang-format.yaml b/.github/workflows/clang-format.yaml new file mode 100644 index 0000000..0afeece --- /dev/null +++ b/.github/workflows/clang-format.yaml @@ -0,0 +1,24 @@ +name: Check clang-format + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + +jobs: + clang-format: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repository code + uses: actions/checkout@v3 + - name: Install clang-format-10 + run: | + sudo apt-get -y -qq update + sudo apt-get -y -qq install clang-format-10 + - name: Run clang-format-check + run: | + ./.clang-format-check.sh + diff --git a/LICENSE b/LICENSE index 7c08eb4..e26eeb4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2024, AIST-CNRS JRL +Copyright (c) 2024, CNRS-AIST JRL Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 9d20eb9..65ef82c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # [HumanRetargetingController](https://github.com/isri-aist/HumanRetargetingController) Controller for retargeting the motion from human to humanoid robot + +[![CI](https://github.com/isri-aist/HumanRetargetingController/actions/workflows/ci.yaml/badge.svg)](https://github.com/isri-aist/HumanRetargetingController/actions/workflows/ci.yaml) +[![Documentation](https://img.shields.io/badge/doxygen-online-brightgreen?logo=read-the-docs&style=flat)](https://isri-aist.github.io/HumanRetargetingController/) +[![LICENSE](https://img.shields.io/github/license/isri-aist/HumanRetargetingController)](https://github.com/isri-aist/HumanRetargetingController/blob/master/LICENSE)