Skip to content

Commit 9093df9

Browse files
committed
ci: dependent workflows, caching and extension linting
1 parent 4e15bc2 commit 9093df9

3 files changed

Lines changed: 153 additions & 13 deletions

File tree

.github/workflows/cpp.yaml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
pull_request:
55
paths:
66
- "src/**"
7-
- ".github/workflows/**"
7+
- "include/**"
8+
- "extensions/**"
9+
- ".github/workflows/cpp.yaml"
810
push:
911
branches:
1012
- master
@@ -14,25 +16,42 @@ jobs:
1416
runs-on: ubuntu-latest
1517
steps:
1618
- uses: actions/checkout@v4
19+
- name: Cache apt packages
20+
uses: actions/cache@v4
21+
with:
22+
path: /var/cache/apt/archives
23+
key: ${{ runner.os }}-apt-${{ hashFiles('debian_deps.txt') }}
24+
restore-keys: |
25+
${{ runner.os }}-apt-
1726
- name: Install dependencies
1827
run: sudo apt install $(cat debian_deps.txt)
19-
- name: Check clang format
20-
run: make cppcheckformat
2128
- name: Set up Python 3.11
2229
id: setup-python
2330
uses: actions/setup-python@v5
2431
with:
2532
python-version: "3.11"
2633
cache: "pip"
27-
- name: Clang build
28-
run: make clangcompile PYTHON_EXECUTABLE=${{ steps.setup-python.outputs.python-path }}
34+
- name: Install Python dependencies
35+
run: |
36+
pip install -r requirements.txt
37+
- name: Check clang format
38+
run: make cppcheckformat
2939
- name: Clang Tidy
3040
run: make cpplint
41+
- name: Clang build
42+
run: make clangcompile PYTHON_EXECUTABLE=${{ steps.setup-python.outputs.python-path }}
3143

3244
build_gcc:
3345
runs-on: ubuntu-latest
3446
steps:
3547
- uses: actions/checkout@v4
48+
- name: Cache apt packages
49+
uses: actions/cache@v4
50+
with:
51+
path: /var/cache/apt/archives
52+
key: ${{ runner.os }}-apt-${{ hashFiles('debian_deps.txt') }}
53+
restore-keys: |
54+
${{ runner.os }}-apt-
3655
- name: Install dependencies
3756
run: sudo apt install $(cat debian_deps.txt)
3857
- name: Set up Python 3.11
@@ -41,5 +60,12 @@ jobs:
4160
with:
4261
python-version: "3.11"
4362
cache: "pip"
63+
- name: Install Python dependencies
64+
run: |
65+
pip install -r requirements.txt
4466
- name: GCC build
4567
run: make gcccompile PYTHON_EXECUTABLE=${{ steps.setup-python.outputs.python-path }}
68+
69+
build_extensions:
70+
needs: [build_clang, build_gcc]
71+
uses: ./.github/workflows/extensions.yaml

.github/workflows/extensions.yaml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Extensions
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build_extensions:
8+
strategy:
9+
matrix:
10+
extension:
11+
# Python extensions
12+
- rcs_xarm7
13+
- rcs_realsense
14+
- rcs_robotiq
15+
- rcs_tacto
16+
- rcs_usb_cam
17+
- rcs_zed
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Cache apt packages
22+
uses: actions/cache@v4
23+
with:
24+
path: /var/cache/apt/archives
25+
key: ${{ runner.os }}-apt-${{ hashFiles('debian_deps.txt') }}
26+
restore-keys: |
27+
${{ runner.os }}-apt-
28+
- name: Install dependencies
29+
run: sudo apt install $(cat debian_deps.txt)
30+
- name: Set up Python 3.11
31+
id: setup-python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.11"
35+
cache: "pip"
36+
37+
- name: Install build dependencies
38+
run: pip install -r requirements.txt
39+
40+
- name: Install rcs
41+
run: pip install -v --no-build-isolation .
42+
43+
- name: Install extension
44+
run: pip install -v --no-build-isolation extensions/${{ matrix.extension }}
45+
46+
build_cpp_extensions_clang:
47+
strategy:
48+
matrix:
49+
extension:
50+
- rcs_fr3
51+
- rcs_panda
52+
- rcs_robotics_library
53+
- rcs_so101
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: Cache apt packages
58+
uses: actions/cache@v4
59+
with:
60+
path: /var/cache/apt/archives
61+
key: ${{ runner.os }}-apt-${{ hashFiles('debian_deps.txt') }}
62+
restore-keys: |
63+
${{ runner.os }}-apt-
64+
- name: Install dependencies
65+
run: sudo apt install $(cat debian_deps.txt)
66+
- name: Set up Python 3.11
67+
id: setup-python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: "3.11"
71+
cache: "pip"
72+
- name: Install Python dependencies
73+
run: |
74+
pip install -r requirements.txt
75+
- name: Check clang format
76+
run: make -C extensions/${{ matrix.extension }} cppcheckformat
77+
- name: Clang Tidy
78+
run: make -C extensions/${{ matrix.extension }} cpplint
79+
- name: Clang build
80+
run: make -C extensions/${{ matrix.extension }} clangcompile PYTHON_EXECUTABLE=${{ steps.setup-python.outputs.python-path }}
81+
82+
build_cpp_extensions_gcc:
83+
strategy:
84+
matrix:
85+
extension:
86+
- rcs_fr3
87+
- rcs_panda
88+
- rcs_robotics_library
89+
- rcs_so101
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v4
93+
- name: Cache apt packages
94+
uses: actions/cache@v4
95+
with:
96+
path: /var/cache/apt/archives
97+
key: ${{ runner.os }}-apt-${{ hashFiles('debian_deps.txt') }}
98+
restore-keys: |
99+
${{ runner.os }}-apt-
100+
- name: Install dependencies
101+
run: sudo apt install $(cat debian_deps.txt)
102+
- name: Set up Python 3.11
103+
id: setup-python
104+
uses: actions/setup-python@v5
105+
with:
106+
python-version: "3.11"
107+
cache: "pip"
108+
- name: Install Python dependencies
109+
run: |
110+
pip install -r requirements.txt
111+
pip install -v --no-build-isolation .
112+
pip install -v --no-build-isolation extensions/${{ matrix.extension }}
113+
- name: GCC build
114+
run: make -C extensions/${{ matrix.extension }} gcccompile PYTHON_EXECUTABLE=${{ steps.setup-python.outputs.python-path }}
115+
- name: Check that stub files are up-to-date
116+
run: make -C extensions/${{ matrix.extension }} stubgen && git diff --exit-code
117+

.github/workflows/py.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
paths:
66
- "python/**"
77
- "src/pybind/**"
8-
- ".github/workflows/**"
8+
- ".github/workflows/py.yaml"
99
push:
1010
branches:
1111
- master
@@ -15,17 +15,18 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Set up Python 3.10
18+
- name: Set up Python 3.11
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: "3.10"
21+
python-version: "3.11"
2222
cache: "pip"
2323
- name: Install linting and formatting dependencies
2424
run: python -m pip install -r requirements.txt
2525
- name: Check formatting
2626
run: make pycheckformat
2727

2828
pythonpackage:
29+
needs: format
2930
runs-on: ubuntu-latest
3031
env:
3132
CC: clang
@@ -47,11 +48,7 @@ jobs:
4748
- name: Install wheel
4849
run: python -m pip install wheel
4950
- name: Install the package
50-
run: python -m pip install --no-build-isolation .
51-
- name: Install the fr3 extension
52-
run: python -m pip install --no-build-isolation extensions/rcs_fr3
53-
- name: Install the panda extension
54-
run: python -m pip install --no-build-isolation extensions/rcs_panda
51+
run: python -m pip install -v --no-build-isolation .
5552
- name: Code linting
5653
run: make pylint
5754
- name: Check that stub files are up-to-date

0 commit comments

Comments
 (0)