Skip to content

Merge pull request #42 from nobleo/feature/acceptable-return-codes #169

Merge pull request #42 from nobleo/feature/acceptable-return-codes

Merge pull request #42 from nobleo/feature/acceptable-return-codes #169

name: Python package
on: [push]
# NOTE: Keep this file in sync with the Dockerfile in the root directory
jobs:
build:
# We do not want to waste resources, and our tests are likely to deadlock once in a while when developing
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false # Tests may behave very different across these systems
matrix:
# We test on all supported LTS versions and the latest rolling release
container: ["ros:humble-ros-core", "ros:jazzy-ros-core", "ros:rolling-ros-core"]
container: ${{ matrix.container }}
defaults:
run:
shell: bash
steps:
-
name: Checkout repository
uses: actions/checkout@v3
-
name: Install dependencies
run: |
apt-get update -q
apt-get install -qy python3-pip python-is-python3 ros-dev-tools
rosdep init
# There seems to be no other way to install the PiPI extra dependencies:
export PIP_BREAK_SYSTEM_PACKAGES=1
pip install -e './ros2_easy_test[dev]'
- run: echo "ROS_DISTRO=$ROS_DISTRO" >> "$GITHUB_OUTPUT"
id: save_envs
-
uses: ros-tooling/[email protected]
with:
target-ros2-distro: ${{ steps.save_envs.outputs.ROS_DISTRO }}
package-name: ros2_easy_test
skip-tests: true
-
name: Format (with ruff)
run: |
ruff format --check
-
name: Lint (with ruff)
run: |
ruff check
-
name: Type check main code (with mypy)
run: |
mypy ros2_easy_test/ros2_easy_test
-
name: Type check tests (with mypy)
continue-on-error: true # We do not want to fail the build if the type checker fails on the tests
run: |
mypy ros2_easy_test/tests
-
name: Testing (with pytest)
run: |
source /opt/ros/$ROS_DISTRO/setup.bash # Activate ROS
python -m pytest