Skip to content

ci: add lint and package checks #1

ci: add lint and package checks

ci: add lint and package checks #1

Workflow file for this run

name: Checks
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
python:
name: Python lint and syntax
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install Python tooling
run: python -m pip install ruff==0.15.17
- name: Check Python syntax
run: |
python -m compileall -q rosidl_generator_rs/rosidl_generator_rs
python -m py_compile rosidl_generator_rs/bin/rosidl_generator_rs
- name: Lint Python sources
run: python -m ruff check rosidl_generator_rs/rosidl_generator_rs rosidl_generator_rs/bin/rosidl_generator_rs
ros:
name: ROS build and test (${{ matrix.ros_distro }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- ros_distro: humble
runner: ubuntu-22.04
- ros_distro: jazzy
runner: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up ROS
uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- name: Install package dependencies
run: |
rosdep update
rosdep install --from-paths . --ignore-src --rosdistro ${{ matrix.ros_distro }} -y
- name: Build package
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
colcon build --packages-up-to rosidl_generator_rs_tests --event-handlers console_direct+
- name: Test package
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
source install/setup.bash
colcon test --packages-select rosidl_generator_rs --event-handlers console_direct+
colcon test-result --verbose
- name: Check generated Rust package
shell: bash
run: |
tests_crate="$PWD/build/rosidl_generator_rs_tests/rosidl_generator_rs/rosidl_generator_rs_tests/rust"
cargo check --manifest-path "$tests_crate/Cargo.toml"