-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (88 loc) · 2.86 KB
/
ci.yml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CI
on:
workflow_dispatch:
push:
branches:
- "*"
tags:
- "*"
jobs:
install_with_pip3:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install with pip3
run: |
pip3 install .
pip3 show slamcore_utils
- name: Install with pip3 + extras
run: |
pip3 install .[ros2]
pip3 show slamcore_utils
unittests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: "ubuntu-22.04"
python-version: "3.10.4"
steps:
- name: Set Env Variables
run: |
echo "APT_PACKAGES=ros-humble-ros2bag ros-humble-rosbag2 ros-humble-rosbag2-compression ros-humble-rosbag2-compression-zstd ros-humble-rosbag2-cpp ros-humble-rosbag2-interfaces ros-humble-rosbag2-py ros-humble-rosbag2-storage ros-humble-rosbag2-storage-default-plugins ros-humble-rosbag2-storage-mcap ros-humble-rosbag2-transport ros-humble-gps-msgs" >> "$GITHUB_ENV"
- uses: actions/checkout@v2
- name: Setup ROS
uses: ros-tooling/setup-ros@v0.6
with:
use-ros2-testing: false
required-ros-distributions: humble
- name: Install extras
run: "sudo apt-get update && sudo apt-get install $APT_PACKAGES"
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Python Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: "1.6.1"
- name: Install prerequisites
run: "poetry version && poetry install --extras ros2"
- name: Run tests
run: "source /opt/ros/humble/setup.bash && poetry run pytest"
style_and_linters:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Setup ROS
uses: ros-tooling/setup-ros@v0.6
with:
use-ros2-testing: false
required-ros-distributions: humble
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Setup Python Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: "1.6.1"
- name: Install prerequisites
run: poetry install --extras ros2
- name: Run style checkers and linters
run: poetry run pre-commit run --all-files
publish_package:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Publish package to pypi
uses: JRubics/poetry-publish@v1.16
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
plugins: "poetry-dynamic-versioning[plugin]"