Skip to content

Commit

Permalink
Consolidate into one CI action, update gitignore, comment out moveit …
Browse files Browse the repository at this point in the history
…for now, fix dockerfile, add ci catkin profile, format package.xml, misc stuff
  • Loading branch information
qhdwight committed Sep 18, 2023
1 parent e2a4fdc commit 5dfb43e
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 235 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/catkin.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
ci:
name: CI
runs-on: ubuntu-latest
container:
image: umrover1/ros:latest
steps:
- uses: actions/checkout@v4
with:
lfs: "true"
# This makes sure that $GITHUB_WORKSPACE is the catkin workspace path
path: "src/mrover"
- name: Ensure Python Requirements
run: . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && pip install -e "$GITHUB_WORKSPACE/src/mrover[dev]"
- name: Style Check
run: . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && cd $GITHUB_WORKSPACE/src/mrover/ && ./style.sh
- name: Ensure APT Requirements
if: github.event.pull_request.draft == false
run: rosdep update && rosdep install --from-paths "$GITHUB_WORKSPACE/src" --ignore-src -r -y --rosdistro noetic
- name: Copy Catkin Profiles
if: github.event.pull_request.draft == false
run: rsync -r $GITHUB_WORKSPACE/src/mrover/ansible/roles/build/files/profiles $GITHUB_WORKSPACE/.catkin_tools
- name: Initialize
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && catkin init && catkin profile set ci
- name: Build
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && catkin build
- name: Test
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && . $GITHUB_WORKSPACE/devel/setup.sh && catkin test -j1
19 changes: 0 additions & 19 deletions .github/workflows/style.yml

This file was deleted.

28 changes: 13 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,28 @@ __pycache__/
*.py[cod]
*$py.class
.mypy_cache/
*.egg-info/

# Common IDE's, ideally this should be in global gitignore per user
**/.vscode/
**/.idea/
cmake-build*/
.vscode/
.idea/
/cmake-build*/

#GUI Files
node_modules/
/src/teleop/gui/dist/
/src/teleop/gui/node_modules/
/src/teleop/gui/src/static/map
**/keys.json*
**/yarn.lock*
**/yarn-error.log*
keys.json*
yarn.lock*
yarn-error.log*

# Bag Files
bags/

# Bag Files
bags/
/bags/

# Catkin
build/
devel/
logs/
/build/
/devel/
/logs/

# Moteus
moteus-cal*
Expand All @@ -35,4 +33,4 @@ moteus-cal*
*.csv

# Virtual Environment
venv/
/venv/
24 changes: 2 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(mrover VERSION 2024.0 LANGUAGES CXX)
project(mrover VERSION 2024.0.0 LANGUAGES CXX)

## Compile as C++17, supported in ROS Kinetic and newer, enable some static analysis
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -199,26 +199,6 @@ else ()
rosbridge_server
teleop_twist_joy
gazebo_ros
moveit_commander
moveit_core
moveit_fake_controller_manager
moveit_kinematics
moveit_msgs
moveit_planners_chomp
moveit_planners_ompl
moveit_ros_benchmarks
moveit_ros_control_interface
moveit_ros_manipulation
moveit_ros_move_group
moveit_ros_occupancy_map_monitor
moveit_ros_perception
moveit_ros_planning
moveit_ros_planning_interface
moveit_ros_robot_interaction
moveit_ros_visualization
moveit_ros_warehouse
moveit_setup_assistant
moveit_simple_controller_manager
)

# append subdirectories
Expand All @@ -235,7 +215,7 @@ else ()
find_package(OpenCV REQUIRED COMPONENTS core aruco)
find_package(gazebo REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(ZED 2)
find_package(ZED 2 QUIET)
if (ZED_FOUND)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_CUDA_STANDARD 17)
Expand Down
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM ros:noetic

RUN apt-get update -y && apt-get upgrade -y && apt-get install software-properties-common -y
# DEBIAN_FRONTEND=noninteractive and keyboard-configuration are needed to prevent stdin prompting later on
# This was super annoying to figure out because otherwise the build would hang
# software-properties-common is needed for apt-add-repository
RUN apt-get update -y && apt-get upgrade -y && DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common keyboard-configuration -y
RUN apt-add-repository ppa:ansible/ansible -y
RUN apt-add-repository ppa:git-core/ppa -y
RUN apt install -y ansible git git-lfs
RUN apt-get install -y ansible git git-lfs

RUN useradd --create-home --groups sudo --shell /bin/zsh mrover
# Give mrover user sudo access with no password
Expand All @@ -12,8 +15,13 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER mrover
RUN mkdir -p /home/mrover/catkin_ws/src/mrover
WORKDIR /home/mrover/catkin_ws/src/mrover
# Defines the APT packages that need to be installed
# rosdep is called from Ansible to install them
ADD ./package.xml .
# Defines the Python packages that need to be installed
# pip is called from Ansible to install them
ADD ./pyproject.toml .
# Copy over all Ansible files
ADD ./ansible ./ansible
ADD ./ansible.sh .
RUN ./ansible.sh build.yml
Expand Down
4 changes: 2 additions & 2 deletions ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ fi

sudo -v # Ensure Ansible has sudo permission

MROVER_PATH=$(dirname "$0")
CATKIN_WORKSPACE_PATH=$(realpath "${MROVER_PATH}"/../..)
readonly MROVER_PATH=$(dirname "$0")
readonly CATKIN_WORKSPACE_PATH=$(realpath "${MROVER_PATH}"/../..)
ansible-playbook -i "localhost," -c local "${MROVER_PATH}"/ansible/"$1" --extra-vars "catkin_workspace=${CATKIN_WORKSPACE_PATH}"
27 changes: 27 additions & 0 deletions ansible/roles/build/files/profiles/ci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
authors: [ ]
blacklist: [ ]
build_space: build
catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_CLANG_TIDY=clang-tidy-16
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: [ ]
licenses:
- TODO
log_space: logs
maintainers: [ ]
make_args: [ ]
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: [ ]
28 changes: 14 additions & 14 deletions ansible/roles/build/files/profiles/debug/config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
authors: []
blacklist: []
authors: [ ]
blacklist: [ ]
build_space: build
catkin_make_args: []
catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Debug
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
- -DCMAKE_BUILD_TYPE=Debug
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: []
jobs_args: [ ]
licenses:
- TODO
- TODO
log_space: logs
maintainers: []
make_args: []
maintainers: [ ]
make_args: [ ]
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: []
whitelist: [ ]
28 changes: 14 additions & 14 deletions ansible/roles/build/files/profiles/release/config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
authors: []
blacklist: []
authors: [ ]
blacklist: [ ]
build_space: build
catkin_make_args: []
catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_CXX_FLAGS=-march=native -pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_CXX_FLAGS=-march=native -pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: []
jobs_args: [ ]
licenses:
- TODO
- TODO
log_space: logs
maintainers: []
make_args: []
maintainers: [ ]
make_args: [ ]
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: []
whitelist: [ ]
2 changes: 2 additions & 0 deletions ansible/roles/build/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@
- python3-virtualenvwrapper
- clang-16
- clangd-16
- clang-tidy-16
- clang-format-16
- lld-16
- lldb-16
- g++-11
- python3.10
- python3.10-dev
- python3.10-venv
- ros-{{ ros_distro }}-rosbash

Expand Down
Loading

0 comments on commit 5dfb43e

Please sign in to comment.