-
Notifications
You must be signed in to change notification settings - Fork 53
130 lines (125 loc) · 4.51 KB
/
Copy pathmain.yml
File metadata and controls
130 lines (125 loc) · 4.51 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
name: drake-ros continuous integration
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}}
cancel-in-progress: true
jobs:
pre_commit:
name: Run linters and formatters
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure
if: "! contains(github.event.pull_request.labels.*.name, 'status: defer ci')"
build_container:
name: Build drake-ros container image
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Free up runner space
uses: ./.github/actions/free-disk-space
- name: Build container image
run: |
docker build -t drake-ros:ci-${{ github.sha }} -f .devcontainer/Dockerfile .
- name: Save container image
run: |
docker save drake-ros:ci-${{ github.sha }} | gzip > /tmp/drake-ros-image.tar.gz
- name: Upload container image artifact
uses: actions/upload-artifact@v4
with:
name: drake-ros-image
path: /tmp/drake-ros-image.tar.gz
retention-days: 1
if: "! contains(github.event.pull_request.labels.*.name, 'status: defer ci')"
bazel_ros2_rules_test:
name: Build and test bazel_ros2_rules modules with bazel
runs-on: ubuntu-24.04
needs: build_container
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Free up runner space
uses: ./.github/actions/free-disk-space
- name: Download container image artifact
uses: actions/download-artifact@v4
with:
name: drake-ros-image
path: /tmp
- name: Load container image
run: |
docker load < /tmp/drake-ros-image.tar.gz
- name: Configure AppArmor for ROS network isolation
uses: ./.github/actions/configure-apparmor
- name: Run bazel_ros2_rules tests
run: |
docker run --rm --privileged \
-v ${{ github.workspace }}:/drake-ros \
-u $(id -u):$(id -g) \
drake-ros:ci-${{ github.sha }} \
/drake-ros/.github/scripts/run_bazel_ros2_tests.sh
if: "! contains(github.event.pull_request.labels.*.name, 'status: defer ci')"
bazel_drake_ros_test:
name: Build and test drake_ros modules with bazel
runs-on: ubuntu-24.04
needs: build_container
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Free up runner space
uses: ./.github/actions/free-disk-space
- name: Download container image artifact
uses: actions/download-artifact@v4
with:
name: drake-ros-image
path: /tmp
- name: Load container image
run: |
docker load < /tmp/drake-ros-image.tar.gz
- name: Configure AppArmor for ROS network isolation
uses: ./.github/actions/configure-apparmor
- name: Run drake_ros bazel tests
run: |
docker run --rm --privileged \
-v ${{ github.workspace }}:/drake-ros \
-u $(id -u):$(id -g) \
drake-ros:ci-${{ github.sha }} \
/drake-ros/.github/scripts/run_bazel_drake_tests.sh
if: "! contains(github.event.pull_request.labels.*.name, 'status: defer ci')"
colcon_drake_ros_test:
name: Build and test drake_ros packages with colcon
runs-on: ubuntu-24.04
needs: build_container
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Free up runner space
uses: ./.github/actions/free-disk-space
- name: Download container image artifact
uses: actions/download-artifact@v4
with:
name: drake-ros-image
path: /tmp
- name: Load container image
run: |
docker load < /tmp/drake-ros-image.tar.gz
- name: Configure AppArmor for ROS network isolation
uses: ./.github/actions/configure-apparmor
- name: Run colcon tests
run: |
docker run --rm \
-v ${{ github.workspace }}:/drake-ros \
-u $(id -u):$(id -g) \
drake-ros:ci-${{ github.sha }} \
/drake-ros/.github/scripts/run_colcon_tests.sh
if: "! contains(github.event.pull_request.labels.*.name, 'status: defer ci')"