Add CI (#4)
This commit is contained in:
parent
556ddba8d6
commit
df87fade0e
77
.github/workflows/test.yaml
vendored
Normal file
77
.github/workflows/test.yaml
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
# Copyright 2025 Enactic, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
- '!dependabot/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
concurrency:
|
||||
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
timeout-minutes: 5
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
runs-on:
|
||||
- ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y -V \
|
||||
cmake \
|
||||
libkdl-parser-dev \
|
||||
liborocos-kdl-dev \
|
||||
liburdfdom-headers-dev \
|
||||
libyaml-cpp-dev \
|
||||
ninja-build
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
path: openarm_can
|
||||
repository: enactic/openarm_can
|
||||
- name: "OpenArm CAN: CMake"
|
||||
run: |
|
||||
cmake \
|
||||
-B openarm_can.build \
|
||||
-S openarm_can \
|
||||
-GNinja \
|
||||
-DCMAKE_INSTALL_PREFIX=$PWD/install \
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
- name: "OpenArm CAN: Build"
|
||||
run: |
|
||||
ninja -C openarm_can.build
|
||||
- name: "OpenArm CAN: Install"
|
||||
run: |
|
||||
ninja -C openarm_can.build install
|
||||
- name: CMake
|
||||
run: |
|
||||
cmake \
|
||||
-B build \
|
||||
-S . \
|
||||
-GNinja \
|
||||
-DCMAKE_INSTALL_PREFIX=$PWD/install \
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
- name: Build
|
||||
run: |
|
||||
ninja -C build
|
||||
@ -33,6 +33,9 @@ find_package(Eigen3 REQUIRED)
|
||||
find_package(urdfdom REQUIRED)
|
||||
find_package(urdfdom_headers REQUIRED)
|
||||
find_package(yaml-cpp REQUIRED)
|
||||
if(NOT TARGET yaml-cpp::yaml-cpp AND TARGET yaml-cpp)
|
||||
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
|
||||
endif()
|
||||
|
||||
# -----------------------------
|
||||
# Create static library
|
||||
@ -45,18 +48,19 @@ add_library(openarm_teleop_lib STATIC
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
openarm_teleop_lib PUBLIC
|
||||
${EIGEN3_INCLUDE_DIRS}
|
||||
openarm_teleop_lib
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
target_link_libraries(openarm_teleop_lib
|
||||
PUBLIC
|
||||
OpenArmCAN::openarm_can
|
||||
${EIGEN3_LIBRARIES}
|
||||
Eigen3::Eigen
|
||||
${orocos_kdl_LIBRARIES}
|
||||
kdl_parser
|
||||
urdfdom_model
|
||||
yaml-cpp
|
||||
${kdl_parser_LIBRARIES}
|
||||
urdfdom::urdfdom_model
|
||||
yaml-cpp::yaml-cpp
|
||||
)
|
||||
|
||||
# -----------------------------
|
||||
@ -67,11 +71,7 @@ add_executable(comm_test control/openarm_communication_test.cpp)
|
||||
add_executable(unilateral_control control/openarm_unilateral_control.cpp)
|
||||
add_executable(bilateral_control control/openarm_bilateral_control.cpp)
|
||||
|
||||
target_link_libraries(gravity_comp openarm_teleop_lib)
|
||||
target_link_libraries(comm_test openarm_teleop_lib)
|
||||
target_link_libraries(unilateral_control openarm_teleop_lib)
|
||||
target_link_libraries(bilateral_control openarm_teleop_lib)
|
||||
|
||||
target_include_directories(gravity_comp PRIVATE ${EIGEN3_INCLUDE_DIRS})
|
||||
target_include_directories(unilateral_control PRIVATE ${EIGEN3_INCLUDE_DIRS})
|
||||
target_include_directories(bilateral_control PRIVATE ${EIGEN3_INCLUDE_DIRS})
|
||||
target_link_libraries(gravity_comp PRIVATE openarm_teleop_lib)
|
||||
target_link_libraries(comm_test PRIVATE openarm_teleop_lib)
|
||||
target_link_libraries(unilateral_control PRIVATE openarm_teleop_lib)
|
||||
target_link_libraries(bilateral_control PRIVATE openarm_teleop_lib)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user