Skip to content

Commit

Permalink
Update Ubuntu18.04-build.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhefan-Xu authored Mar 23, 2024
1 parent b1405c8 commit 4554f74
Showing 1 changed file with 25 additions and 38 deletions.
63 changes: 25 additions & 38 deletions .github/workflows/Ubuntu18.04-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,43 @@ on:
paths-ignore:
- '**/README.md'


jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:18.04
options: --privileged # Allow privileged mode to use sudo

container: ubuntu:18.04
env:
ROS_CI_DESKTOP: "`lsb_release -cs`"
ROS_DISTRO: melodic

steps:
- name: Install sudo
- uses: actions/checkout@v2
with:
submodule: recursive
- name: Install sudo and software-properties-common
run: |
apt-get update
apt-get install -y sudo
apt-get install -y sudo software-properties-common
- name: Install ROS Melodic
run: |
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install ros-melodic-desktop-full
source /opt/ros/${ROS_DISTRO}/setup.bash
- name: Install ROS packages with rosdep
run: |
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo apt install python-rosdep
sudo rosdep init
rosdep update
- name: Install dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
build-essential \
&& sudo rm -rf /var/lib/apt/lists/*
- name: Add ROS repository
run: echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/ros-latest.list

- name: Install ROS key
run: curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

- name: Update package index
run: sudo apt-get update

- name: Install ROS Melodic
run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ros-melodic-desktop-full

- name: Initialize rosdep
run: yes | sudo rosdep init && sudo rosdep update

- name: Install additional ROS packages
run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ros-${ROS_DISTRO}-octomap* ros-${ROS_DISTRO}-mavros* ros-${ROS_DISTRO}-vision-msgs

- name: Set up catkin workspace
sudo apt install -y ros-${ROS_DISTRO}-octomap* ros-${ROS_DISTRO}-mavros* ros-${ROS_DISTRO}-vision-msgs
- name: catkin make
run: |
sudo mkdir -p ~/catkin_ws/src
sudo ln -s $GITHUB_WORKSPACE ~/catkin_ws/src/
mkdir -p ~/catkin_ws/src
ln -s $GITHUB_WORKSPACE ~/catkin_ws/src/
cd ~/catkin_ws
source /opt/ros/${ROS_DISTRO}/setup.bash
catkin_make

0 comments on commit 4554f74

Please sign in to comment.