Skip to content

Commit f3d5dfa

Browse files
committed
build: move ci to github actions
1 parent 7fd66f9 commit f3d5dfa

1 file changed

Lines changed: 157 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build_jammy:
9+
name: Build and Test (Jammy)
10+
runs-on: ubuntu-latest
11+
concurrency:
12+
group: jammy-${{ github.ref }}
13+
cancel-in-progress: true
14+
container:
15+
image: ghcr.io/dairlab/docker-dair/jammy-dair-base:v1.42.0-2
16+
credentials:
17+
username: ${{ github.actor }}
18+
password: ${{ secrets.GITHUB_TOKEN }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Restore Bazel cache
23+
id: cache-restore
24+
uses: actions/cache/restore@v4
25+
with:
26+
path: ~/.cache/bazel
27+
key: dairlib-bazel-jammy-${{ hashFiles('MODULE.bazel', '**/BUILD.bazel') }}
28+
restore-keys: |
29+
dairlib-bazel-jammy-
30+
31+
- name: Check clang format
32+
run: |
33+
apt-get update -qq && apt-get install -y clang-format
34+
./tools/scripts/check_format.sh
35+
36+
- name: Build
37+
run: |
38+
bazel build \
39+
--local_resources=ram=14000 \
40+
--local_resources=cpu=4 \
41+
--jobs=4 \
42+
//...
43+
44+
- name: Test
45+
run: |
46+
bazel test \
47+
--local_resources=ram=14000 \
48+
--local_resources=cpu=4 \
49+
--jobs=4 \
50+
--test_output=all \
51+
//...
52+
53+
- name: Upload test results
54+
uses: actions/upload-artifact@v4
55+
if: always()
56+
with:
57+
name: jammy-test-results
58+
path: bazel-testlogs/**/test.xml
59+
60+
- name: Save Bazel cache
61+
if: always() && !cancelled() && steps.cache-restore.outputs.cache-hit != 'true'
62+
uses: actions/cache/save@v4
63+
with:
64+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
65+
path: ~/.cache/bazel
66+
67+
build_noble:
68+
name: Build and Test (Noble)
69+
runs-on: ubuntu-latest
70+
concurrency:
71+
group: noble-${{ github.ref }}
72+
cancel-in-progress: true
73+
container:
74+
image: ghcr.io/dairlab/docker-dair/noble-dair-base:v1.42.0-2
75+
credentials:
76+
username: ${{ github.actor }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
78+
steps:
79+
- uses: actions/checkout@v4
80+
81+
- name: Restore Bazel cache
82+
id: cache-restore
83+
uses: actions/cache/restore@v4
84+
with:
85+
path: ~/.cache/bazel
86+
key: dairlib-bazel-noble-${{ hashFiles('MODULE.bazel', '**/BUILD.bazel') }}
87+
restore-keys: |
88+
dairlib-bazel-noble-
89+
90+
- name: Check clang format
91+
run: |
92+
apt-get update -qq && apt-get install -y clang-format
93+
./tools/scripts/check_format.sh
94+
95+
- name: Build
96+
run: |
97+
bazel build \
98+
--local_resources=ram=14000 \
99+
--local_resources=cpu=4 \
100+
--jobs=4 \
101+
//...
102+
103+
- name: Test
104+
run: |
105+
bazel test \
106+
--local_resources=ram=14000 \
107+
--local_resources=cpu=4 \
108+
--jobs=4 \
109+
--test_output=all \
110+
//...
111+
112+
- name: Upload test results
113+
uses: actions/upload-artifact@v4
114+
if: always()
115+
with:
116+
name: noble-test-results
117+
path: bazel-testlogs/**/test.xml
118+
119+
- name: Save Bazel cache
120+
if: always() && !cancelled() && steps.cache-restore.outputs.cache-hit != 'true'
121+
uses: actions/cache/save@v4
122+
with:
123+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
124+
path: ~/.cache/bazel
125+
126+
drake_master_build:
127+
name: Build against Drake master
128+
runs-on: ubuntu-latest
129+
continue-on-error: true
130+
container:
131+
image: ghcr.io/dairlab/docker-dair/jammy-dair-base:v1.42.0-2
132+
credentials:
133+
username: ${{ github.actor }}
134+
password: ${{ secrets.GITHUB_TOKEN }}
135+
steps:
136+
- uses: actions/checkout@v4
137+
138+
- name: Clone Drake master
139+
run: git clone https://github.com/RobotLocomotion/drake.git ../drake
140+
141+
- name: Build
142+
run: |
143+
bazel build \
144+
--override_module=drake=$PWD/../drake \
145+
--local_resources=ram=14000 \
146+
--local_resources=cpu=4 \
147+
--jobs=4 \
148+
//...
149+
150+
- name: Test
151+
run: |
152+
bazel test \
153+
--override_module=drake=$PWD/../drake \
154+
--local_resources=ram=14000 \
155+
--local_resources=cpu=4 \
156+
--jobs=4 \
157+
//...

0 commit comments

Comments
 (0)