-
Notifications
You must be signed in to change notification settings - Fork 7
171 lines (163 loc) · 5.53 KB
/
ci.yaml
File metadata and controls
171 lines (163 loc) · 5.53 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Python
on:
workflow_call:
pull_request:
paths:
- "python/**"
- "src/pybind/**"
- ".github/workflows/py.yaml"
- "extensions/**"
push:
branches:
- master
jobs:
pythonpackage:
runs-on: ubuntu-latest
env:
CC: clang
CXX: clang++
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Cache build directory
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-build-py-${{ hashFiles('src/**', 'include/**', 'CMakeLists.txt', 'pyproject.toml') }}
restore-keys: |
${{ runner.os }}-build-py-
- name: Install CPP dependencies
run: sudo apt install $(cat debian_deps.txt)
- name: Install virtual frame buffer tool
run: sudo apt install xvfb
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install building dependencies
run: python -m pip install -r requirements.txt
- name: Install wheel
run: python -m pip install wheel
- name: Install the package
run: python -m pip install -v --no-build-isolation '.[dev]'
- name: Check formatting
run: make pycheckformat
- name: Code linting
run: make pylint
- name: Check that stub files are up-to-date
run: make stubgen && git diff --exit-code
- name: Ensure all unittests(pytest) are passing
run: xvfb-run make pytest
check-paths:
runs-on: ubuntu-latest
outputs:
extensions_changed: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files for extensions
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
extensions/**
build_extensions:
needs: [pythonpackage, check-paths]
if: needs.check-paths.outputs.extensions_changed == 'true'
strategy:
matrix:
extension:
# Python extensions
- rcs_xarm7
- rcs_realsense
# - rcs_robotiq
- rcs_tacto
- rcs_usb_cam
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache apt packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('debian_deps.txt') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Cache rcs build directory
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-build-py-${{ hashFiles('src/**', 'include/**', 'CMakeLists.txt', 'pyproject.toml') }}
restore-keys: |
${{ runner.os }}-build-py-
- name: Install dependencies
run: sudo apt install $(cat debian_deps.txt)
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install build dependencies
run: pip install -r requirements.txt
- name: Install rcs
run: pip install -v --no-build-isolation '.[dev]'
- name: Install extension
run: pip install -v --no-build-isolation extensions/${{ matrix.extension }}
build_cpp_extensions:
needs: [pythonpackage, check-paths]
if: needs.check-paths.outputs.extensions_changed == 'true'
strategy:
matrix:
extension:
- rcs_fr3
- rcs_panda
- rcs_robotics_library
- rcs_so101
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache apt packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('debian_deps.txt') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Cache rcs build directory
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-build-py-${{ hashFiles('src/**', 'include/**', 'CMakeLists.txt', 'pyproject.toml') }}
restore-keys: |
${{ runner.os }}-build-py-
- name: Cache extension build directory
uses: actions/cache@v4
with:
path: extensions/${{ matrix.extension }}/build
key: ${{ runner.os }}-build-ext-${{ matrix.extension }}-${{ hashFiles('extensions/${{ matrix.extension }}/**') }}
restore-keys: |
${{ runner.os }}-build-ext-${{ matrix.extension }}-
- name: Install dependencies
run: sudo apt install $(cat debian_deps.txt)
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install Python dependencies
run: |
pip install -r requirements.txt
pip install -v --no-build-isolation '.[dev]'
pip install -v --no-build-isolation extensions/${{ matrix.extension }}
- name: Check that stub files are up-to-date
run: make -C extensions/${{ matrix.extension }} stubgen && git diff --exit-code
- name: Clang build
run: make -C extensions/${{ matrix.extension }} clangcompile PYTHON_EXECUTABLE=${{ steps.setup-python.outputs.python-path }}
- name: Check clang format
run: make -C extensions/${{ matrix.extension }} cppcheckformat
# - name: Clang Tidy
# run: make -C extensions/${{ matrix.extension }} cpplint