Skip to content

Install Tests

Install Tests #364

Workflow file for this run

name: Install Tests
on:
schedule:
- cron: '0 15 * * *'
workflow_dispatch:
jobs:
test:
name: Test ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [20.04, 22.04, 24.04]
container:
image: ubuntu:${{ matrix.os }}
options: --privileged
steps:
- uses: actions/checkout@v4
- name: List files
run: ls -la
- name: Set ROS_DISTRO
shell: bash
run: |
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo "TZ=Etc/UTC" >> $GITHUB_ENV
echo "PIP_NO_INPUT=1" >> $GITHUB_ENV
if [[ "${{ matrix.os }}" == "20.04" ]]; then
echo "ROS_DISTRO=foxy" >> $GITHUB_ENV
elif [[ "${{ matrix.os }}" == "22.04" ]]; then
echo "ROS_DISTRO=humble" >> $GITHUB_ENV
elif [[ "${{ matrix.os }}" == "24.04" ]]; then
echo "ROS_DISTRO=jazzy" >> $GITHUB_ENV
fi
- name: Set up environment
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update -y # update container
apt-get install -y sudo curl git tzdata
locale # check for UTF-8
sudo apt update -y && sudo apt install locales -y
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
locale # verify settings
sudo apt install -y software-properties-common
sudo add-apt-repository universe
sudo apt update -y && sudo apt install curl -y
sudo 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" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
- name: Change ownership of /github/home
run: sudo chown -R $(whoami) /github/home
- name: Updating environement
run: |
sudo apt update -y
sudo apt upgrade -y
- name: Set timezone manually to avoid fallback UI
shell: bash
run: |
echo "Etc/UTC" > /etc/timezone
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
dpkg-reconfigure -f noninteractive tzdata
- name: Installing Ros2
shell: bash
run: |
sudo apt install -y ros-$ROS_DISTRO-ros-base python3-argcomplete ros-dev-tools python3-colcon-common-extensions
- name: Installing doit
shell: bash
run: |
sudo apt install -y python3-doit python3-pip
- name: Pip installing dependencies
shell: bash
run: |
echo 'y' | doit pydep pip_args="--ignore-installed" # <- ignore is specific to containers
- name: Rosdep installing dependencies
shell: bash
run: |
doit rosdep
- name: Colcon Build
shell: bash
run: |
doit build
- name: Colcon Test
shell: bash
run: |
doit -n 8 test