-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (57 loc) · 1.88 KB
/
python-package.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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 do not test on ros:foxy-ros-core, since it causes many problems in the CI pipeline
# TODO: add ros:iron-ros-core when it is available
container: ["ros:humble-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 python3-colcon-ros ros-$ROS_DISTRO-example-interfaces
# pip install --upgrade pip setuptools
# python -m pip install -e './ros2_easy_test[dev]'
-
uses: ros-tooling/[email protected]
with:
target-ros2-distro: "humble"
package-name: ros2_easy_test
skip-tests: true
-
name: Format (with black)
run: |
black --check ros2_easy_test/
-
name: Lint (with ruff)
run: |
ruff check ros2_easy_test/
-
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