Merge pull request #11 from eduidl/delete-subscription #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: Install Dependencies | |
run: poetry install --no-interaction | |
- name: Check Lint and Format | |
run: poetry run task check | |
test-ros1: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup ROS environment | |
run: | | |
sudo apt update -q | |
sudo apt install -yqq curl gnupg2 | |
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - | |
echo "deb http://packages.ros.org/ros/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/ros-latest.list > /dev/null | |
sudo apt update -q | |
sudo apt install -yqq \ | |
ros-noetic-ros-base \ | |
ros-noetic-rospy | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: Install Dependencies | |
run: poetry install --no-interaction | |
- name: Unit Test | |
run: | | |
source /opt/ros/noetic/setup.bash | |
roscore & | |
poetry run task test | |
test-ros2: | |
strategy: | |
fail-fast: false | |
matrix: | |
ros: | |
- { distro: humble, os: ubuntu-22.04 } | |
- { distro: iron, os: ubuntu-22.04 } | |
- { distro: rolling, os: ubuntu-22.04 } | |
runs-on: ${{ matrix.ros.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup ROS environment | |
run: | | |
sudo apt update -q | |
sudo apt install -yqq curl | |
keyring=/usr/share/keyrings/ros-archive-keyring.gpg | |
codename=$(. /etc/os-release && echo $UBUNTU_CODENAME) | |
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o ${keyring} | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=${keyring}] http://packages.ros.org/ros2/ubuntu ${codename} main" | | |
sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null | |
sudo apt update -q | |
sudo apt install -yqq \ | |
ros-${{ matrix.ros.distro }}-ros-base \ | |
ros-${{ matrix.ros.distro }}-rclpy | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: Install Dependencies | |
run: poetry install --no-interaction | |
- name: Unit Test | |
run: | | |
source /opt/ros/${{ matrix.ros.distro }}/setup.bash | |
poetry run task test |