From 2ecd83a122e20fc21dcc25a6d73018a1b51d6900 Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Tue, 21 Nov 2023 07:49:56 -0600 Subject: [PATCH] fixup --- .github/workflows/clang_format.yml | 54 +++--------- .github/workflows/cmake_format.yml | 13 ++- .github/workflows/ubuntu.yml | 39 +++++++++ .github/workflows/ubunut.yml | 90 -------------------- .github/workflows/unstable.yml | 46 ++++++++++ .github/workflows/unstable_build.yml | 57 ------------- .github/workflows/windows.yml | 54 +++++------- .github/workflows/windows_dependencies.repos | 16 ++++ dependencies.repos | 20 ----- dependencies_unstable.repos | 20 ----- 10 files changed, 144 insertions(+), 265 deletions(-) create mode 100644 .github/workflows/ubuntu.yml delete mode 100644 .github/workflows/ubunut.yml create mode 100644 .github/workflows/unstable.yml delete mode 100644 .github/workflows/unstable_build.yml create mode 100644 .github/workflows/windows_dependencies.repos diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 311f2a23..3e5fd97d 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -3,50 +3,24 @@ name: Clang-Format on: push: branches: - - master + - main pull_request: - schedule: - - cron: '0 5 * * *' + + # allow manually starting this workflow + workflow_dispatch: jobs: - industrial_ci: - name: Format - runs-on: ubuntu-latest - env: - CI_NAME: Clang-Format - OS_NAME: ubuntu - OS_CODE_NAME: bionic - ROS_DISTRO: melodic - ROS_REPO: main - ROSDEP_SKIP_KEYS: "bullet bullet-extras opw_kinematics ros_industrial_cmake_boilerplate fcl ifopt benchmark" - CLANG_FORMAT_CHECK: file - CLANG_FORMAT_VERSION: 8 - DOCKER_IMAGE: "rosindustrial/tesseract:melodic" + clang_format: + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - - name: Free Disk Space - run: | - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - docker rmi $(docker image ls -aq) - df -h - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} + - name: Run clang format run: | - string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) - message("::set-output name=timestamp::${current_date}") - - - name: ccache cache files - uses: actions/cache@v1.1.0 - with: - path: ${{ env.CI_NAME }}/.ccache - key: ${{ env.CI_NAME }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} - restore-keys: | - ${{ env.CI_NAME }}-ccache- - - - uses: 'ros-industrial/industrial_ci@master' - env: ${{env}} + sudo apt update + sudo apt install -y git clang-format-8 + if [ $? -ge 1 ]; then return 1; fi + ./.run-clang-format + if [ $? -ge 1 ]; then return 1; fi + output=$(git diff) + if [ -n "$output" ]; then exit 1; else exit 0; fi diff --git a/.github/workflows/cmake_format.yml b/.github/workflows/cmake_format.yml index 6f6c611e..0bcd9ca2 100644 --- a/.github/workflows/cmake_format.yml +++ b/.github/workflows/cmake_format.yml @@ -3,21 +3,26 @@ name: CMake-Format on: push: branches: - - master + - main pull_request: - schedule: - - cron: '0 5 * * *' + + # allow manually starting this workflow + workflow_dispatch: jobs: cmake_lang: name: Format runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Run CMake Lang Format Check run: | sudo pip3 install cmakelang + RED='\033[0;31m' + NC='\033[0m' # No Color ./.run-cmake-format output=$(git diff) + if [ -n "$output" ]; then printf "${RED}CMake format error: run script './.run-cmake-formate'${NC}\n"; fi + if [ -n "$output" ]; then printf "${RED}${output}${NC}\n"; fi if [ -n "$output" ]; then exit 1; else exit 0; fi diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 00000000..373d540d --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,39 @@ +name: Ubuntu + +on: + push: + branches: + - master + pull_request: + schedule: + - cron: '0 5 * * *' + +jobs: + ci: + name: ${{ matrix.distro }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + distro: [focal, jammy] + container: + image: ghcr.io/tesseract-robotics/tesseract:${{ matrix.distro }}-0.21 + env: + CCACHE_DIR: "$GITHUB_WORKSPACE/${{ matrix.distro }}/.ccache" + DEBIAN_FRONTEND: noninteractive + TZ: Etc/UTC + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: target_ws/src + + - name: Build and Tests + uses: tesseract-robotics/colcon-action@v2 + with: + before-script: source /opt/tesseract/install/setup.bash + ccache-prefix: ${{ matrix.distro }} + vcs-file: dependencies.repos + upstream-args: --cmake-args -DCMAKE_BUILD_TYPE=Release + target-path: target_ws/src + target-args: --cmake-args -DCMAKE_BUILD_TYPE=Debug -DTRAJOPT_ENABLE_TESTING=ON diff --git a/.github/workflows/ubunut.yml b/.github/workflows/ubunut.yml deleted file mode 100644 index 24f80639..00000000 --- a/.github/workflows/ubunut.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Ubuntu - -on: - push: - branches: - - master - pull_request: - schedule: - - cron: '0 5 * * *' - -jobs: - ci: - name: ${{ matrix.distro }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - distro: [focal, jammy] - container: - image: ubuntu:${{ matrix.distro }} - env: - CCACHE_DIR: "$GITHUB_WORKSPACE/${{ matrix.distro }}/.ccache" - DEBIAN_FRONTEND: noninteractive - TZ: Etc/UTC - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - path: target_ws/src - - - name: Install Depends - shell: bash - run: | - apt update - apt upgrade -y - apt install -y cmake curl lsb-release ca-certificates gnupg python3 python3-distutils python3-pip ccache git clang-tidy liboctomap-dev - python3 -m pip install vcstool -q - python3 -m pip install colcon-common-extensions -q - python3 -m pip install rosdep -q - rosdep init - rosdep update - cd $GITHUB_WORKSPACE/target_ws/src - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - apt update -qq - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) - message("::set-output name=timestamp::${current_date}") - - - name: ccache cache files - continue-on-error: true - uses: actions/cache@v1.1.0 - with: - path: ${{ matrix.distro }}/.ccache - key: ${{ matrix.distro }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} - restore-keys: | - ${{ matrix.distro }}-ccache- - - - name: Build Upstream Workspace - shell: bash - run: | - mkdir -p $GITHUB_WORKSPACE/upstream_ws/src - vcs import --input "$GITHUB_WORKSPACE/target_ws/src/dependencies.repos" $GITHUB_WORKSPACE/upstream_ws/src/ - cd $GITHUB_WORKSPACE/upstream_ws - rosdep install --from-paths src --ignore-src -r -y - colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release - if [ $? -ge 1 ]; then return 1; fi - - - name: Build Target Workspace - shell: bash - run: | - source $GITHUB_WORKSPACE/upstream_ws/install/setup.bash - cd $GITHUB_WORKSPACE/target_ws - rosdep install --from-paths src --ignore-src -r -y - colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DTRAJOPT_ENABLE_TESTING=ON -DTRAJOPT_ENABLE_CLANG_TIDY=ON - if [ $? -ge 1 ]; then return 1; fi - - - name: Run Tests - shell: bash - run: | - cd $GITHUB_WORKSPACE/target_ws - source $GITHUB_WORKSPACE/target_ws/install/setup.bash - colcon test --event-handlers console_direct+ --return-code-on-test-failure - if [ $? -ge 1 ]; then return 1; fi - colcon test-result --verbose - if [ $? -ge 1 ]; then return 1; fi diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml new file mode 100644 index 00000000..190c214a --- /dev/null +++ b/.github/workflows/unstable.yml @@ -0,0 +1,46 @@ +name: Ubuntu + +on: + push: + branches: + - master + pull_request: + schedule: + - cron: '0 5 * * *' + +jobs: + ci: + name: ${{ matrix.distro }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + distro: [focal, jammy] + container: + image: ghcr.io/tesseract-robotics/tesseract:${{ matrix.distro }}-master + env: + CCACHE_DIR: "$GITHUB_WORKSPACE/${{ matrix.distro }}/.ccache" + DEBIAN_FRONTEND: noninteractive + TZ: Etc/UTC + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: target_ws/sr + + - name: Install Depends + shell: bash + run: | + apt update + apt upgrade -y + apt install -y clang-tidy + + - name: Build and Tests + uses: tesseract-robotics/colcon-action@v2 + with: + before-script: source /opt/tesseract/install/setup.bash + ccache-prefix: ${{ matrix.distro }} + vcs-file: dependencies.repos + upstream-args: --cmake-args -DCMAKE_BUILD_TYPE=Release + target-path: target_ws/src + target-args: --cmake-args -DCMAKE_BUILD_TYPE=Debug -DTRAJOPT_ENABLE_TESTING=ON -DTRAJOPT_ENABLE_CLANG_TIDY=ON diff --git a/.github/workflows/unstable_build.yml b/.github/workflows/unstable_build.yml deleted file mode 100644 index a7983231..00000000 --- a/.github/workflows/unstable_build.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Unstable-Build - -on: - push: - branches: - - master - pull_request: - schedule: - - cron: '0 5 * * *' - -jobs: - industrial_ci: - name: Noetic - runs-on: ubuntu-latest - env: - CI_NAME: Focal-Build - OS_NAME: ubuntu - OS_CODE_NAME: focal - ROS_DISTRO: noetic - ROS_REPO: main - UPSTREAM_WORKSPACE: "dependencies_unstable.repos" - ROSDEP_SKIP_KEYS: "bullet bullet-extras opw_kinematics ros_industrial_cmake_boilerplate fcl ifopt" - DOCKER_IMAGE: "rosindustrial/tesseract:noetic" - PARALLEL_TESTS: false - CCACHE_DIR: "/home/runner/work/trajopt_ros/trajopt_ros/Focal-Build/.ccache" - UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release" - TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug -DTRAJOPT_ENABLE_TESTING=ON -DTRAJOPT_ENABLE_CLANG_TIDY=ON" - AFTER_SCRIPT: 'catkin build -w $target_ws --no-deps --verbose trajopt trajopt_ifopt trajopt_sco trajopt_sqp --make-args test' - ADDITIONAL_DEBS: clang-tidy - steps: - - uses: actions/checkout@v1 - - - name: Free Disk Space - run: | - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - docker rmi $(docker image ls -aq) - df -h - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) - message("::set-output name=timestamp::${current_date}") - - - name: ccache cache files - uses: actions/cache@v1.1.0 - with: - path: ${{ env.CI_NAME }}/.ccache - key: ${{ env.CI_NAME }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} - restore-keys: | - ${{ env.CI_NAME }}-ccache- - - - uses: 'ros-industrial/industrial_ci@master' - env: ${{env}} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7b0c4cf8..5c7f90d8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -8,7 +8,7 @@ on: paths: - 'trajopt**' - '.github/workflows/windows.yml' - - '.github/workflows/dependencies.repos' + - '.github/workflows/windows_dependencies.repos' schedule: - cron: '0 5 * * *' @@ -21,14 +21,9 @@ jobs: matrix: os: [windows-2019,windows-2022] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 with: - path: workspace/src/trajopt - - - name: configure-msvc - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 + path: target_ws/src - name: vcpkg build uses: johnwason/vcpkg-action@v4 @@ -41,33 +36,24 @@ jobs: extra-args: --clean-after-build token: ${{ github.token }} cache-key: ci-${{ matrix.os }} - revision: master + revision: 2023.08.09 - - name: install-depends - shell: cmd - run: | - python -m pip install vcstool -q - python -m pip install colcon-common-extensions -q - python -m pip install ninja -q + - name: configure-msvc + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 - - name: build-workspace - working-directory: workspace - shell: cmd + - name: update environment + shell: bash run: | - set PATH=%PATH%;%GITHUB_WORKSPACE%\vcpkg\installed\x64-windows-release\bin - set CMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\vcpkg\installed\x64-windows-release - vcs import --input "${{ github.workspace }}/workspace/src/trajopt/dependencies.repos" src/ - if %ERRORLEVEL% GEQ 1 exit 1 - colcon build --event-handlers console_direct+ --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DTRAJOPT_ENABLE_TESTING=ON -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF - if %ERRORLEVEL% GEQ 1 exit 1 + echo "PATH=${{ env.PATH }};$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release\bin" >> "$GITHUB_ENV" + echo "CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release" >> "$GITHUB_ENV" - - name: run-test - working-directory: workspace - shell: cmd - run: | - call ./install/setup.bat - set PATH=%PATH%;%GITHUB_WORKSPACE%\vcpkg\installed\x64-windows-release\bin - colcon test --event-handlers console_direct+ --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp --return-code-on-test-failure - if %ERRORLEVEL% GEQ 1 exit 1 - colcon test-result --verbose - if %ERRORLEVEL% GEQ 1 exit 1 + - name: Build and Tests + uses: tesseract-robotics/colcon-action@v2 + with: + ccache-prefix: ${{ matrix.distro }} + vcs-file: .github/workflows/windows_dependencies.repos + upstream-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF + target-path: target_ws/src + target-args: --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DTRAJOPT_ENABLE_TESTING=ON diff --git a/.github/workflows/windows_dependencies.repos b/.github/workflows/windows_dependencies.repos new file mode 100644 index 00000000..5021efbd --- /dev/null +++ b/.github/workflows/windows_dependencies.repos @@ -0,0 +1,16 @@ +- git: + local-name: ros_industrial_cmake_boilerplate + uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git + version: master +- git: + local-name: tesseract + uri: https://github.com/ros-industrial-consortium/tesseract.git + version: master +- git: + local-name: opw_kinematics + uri: https://github.com/Jmeyer1292/opw_kinematics.git + version: master +- git: + local-name: ifopt + uri: https://github.com/ethz-adrl/ifopt.git + version: master diff --git a/dependencies.repos b/dependencies.repos index 3c036010..c0fbf3be 100644 --- a/dependencies.repos +++ b/dependencies.repos @@ -1,24 +1,4 @@ -- git: - local-name: ros_industrial_cmake_boilerplate - uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git - version: 0.5.4 -- git: - local-name: tesseract - uri: https://github.com/ros-industrial-consortium/tesseract.git - version: 0.21.2 -- git: - local-name: opw_kinematics - uri: https://github.com/Jmeyer1292/opw_kinematics.git - version: 0.5.0 - git: local-name: ifopt uri: https://github.com/ethz-adrl/ifopt.git version: 2.1.3 -- git: - local-name: fcl - uri: https://github.com/flexible-collision-library/fcl.git - version: 0.6.1 -- git: - local-name: octomap - uri: https://github.com/OctoMap/octomap.git - version: v1.9.8 diff --git a/dependencies_unstable.repos b/dependencies_unstable.repos index 6ac76cd4..3d077fac 100644 --- a/dependencies_unstable.repos +++ b/dependencies_unstable.repos @@ -1,24 +1,4 @@ -- git: - local-name: ros_industrial_cmake_boilerplate - uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git - version: master -- git: - local-name: tesseract - uri: https://github.com/ros-industrial-consortium/tesseract.git - version: master -- git: - local-name: opw_kinematics - uri: https://github.com/Jmeyer1292/opw_kinematics.git - version: master - git: local-name: ifopt uri: https://github.com/ethz-adrl/ifopt.git version: master -- git: - local-name: fcl - uri: https://github.com/flexible-collision-library/fcl.git - version: 0.6.1 -- git: - local-name: octomap - uri: https://github.com/OctoMap/octomap.git - version: v1.9.8