-
Notifications
You must be signed in to change notification settings - Fork 52
166 lines (154 loc) · 5.26 KB
/
Copy pathbuild_and_test.yml
File metadata and controls
166 lines (154 loc) · 5.26 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
name: build_and_test
on:
# Run action on certain pull request events
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# Nightly job on default (main) branch
schedule:
- cron: '0 0 * * *'
# Whenever certain branches are pushed
push:
branches: [main]
# On demand from github.com for testing
workflow_dispatch:
# Ensures that only one workflow runs at a time for this branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ubuntu_build_and_test:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
ubuntu_version: [22.04, 24.04, 26.04]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: true
- name: Sanitize tag name
id: sanitize_tag
run: |
BRANCH="${{ github.head_ref || github.ref_name }}"
TAG="${BRANCH//\//-}"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: .docker/ubuntu/Dockerfile
tags: roboplan_ubuntu:${{ steps.sanitize_tag.outputs.tag }}
build-args: |
UBUNTU_VERSION=${{ matrix.ubuntu_version }}
push: false
load: true
cache-from: type=gha,scope=ubuntu-${{ matrix.ubuntu_version }}
cache-to: type=gha,mode=max,scope=ubuntu-${{ matrix.ubuntu_version }}
- name: Run tests
run: |
docker run --rm \
roboplan_ubuntu:${{ steps.sanitize_tag.outputs.tag }} \
/bin/bash -c './scripts/run_tests.bash'
# Build ROS docker images and run tests.
ros_build_and_test:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
ros_distro: [humble, jazzy, kilted, lyrical, rolling]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: true
- name: Sanitize tag name
id: sanitize_tag
run: |
BRANCH="${{ github.head_ref || github.ref_name }}"
TAG="${BRANCH//\//-}"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: .docker/ros/Dockerfile
tags: roboplan_ros:${{ steps.sanitize_tag.outputs.tag }}
build-args: |
ROS_DISTRO=${{ matrix.ros_distro }}
GENERATE_PYTHON_STUBS=${{ matrix.ros_distro == 'humble' && 'OFF' || 'ON' }}
push: false
load: true
cache-from: type=gha,scope=ros-${{ matrix.ros_distro }}
cache-to: type=gha,mode=max,scope=ros-${{ matrix.ros_distro }}
- name: Run tests
run: |
docker run --rm \
roboplan_ros:${{ steps.sanitize_tag.outputs.tag }} \
/bin/bash -c './src/roboplan/scripts/run_tests.bash'
pixi_build_and_test:
timeout-minutes: 30
env:
SCCACHE_DIR: ${{ github.workspace }}/.sccache
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
cache-key: ubuntu-22.04
- os: ubuntu-24.04
cache-key: ubuntu-24.04
- os: ubuntu-26.04
cache-key: ubuntu-26.04
- os: macos-14
cache-key: macos-arm64
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: true
- name: Cache sccache
uses: actions/cache@v4
with:
path: ${{ env.SCCACHE_DIR }}
key: ${{ matrix.cache-key }}-sccache-${{ github.head_ref || github.ref_name }}
restore-keys: |
${{ matrix.cache-key }}-sccache-main
${{ matrix.cache-key }}-sccache
- uses: prefix-dev/setup-pixi@v0.8.14
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
frozen: true
manifest-path: pixi.toml
- name: Build and test
run: |
pixi run -e ci install_all
pixi run -e ci build_tests
pixi run -e ci test_all
- name: Check bindings stub files
run: |
if ! git diff --exit-code --shortstat -- '*.pyi'; then
echo "::error::The .pyi stub files are out of sync with the source code. Make sure to rebuild the Python bindings without symlink builds using 'pixi run -e ci install_all' and commit the changes."
echo "Git Diff:"
git diff -- '*.pyi'
exit 1
fi
echo "✅ .pyi stub files look good!"
- name: Run clang-tidy
if: matrix.os == 'ubuntu-26.04'
run: |
pixi run -e ci clang-tidy
# TODO: Decide on a method for automated benchmark performance testing.
# TODO: These are currently running in debug mode due to `-e ci`. We should fix this.
- name: Run benchmarks
if: matrix.os != 'ubuntu-26.04' # Just to not share time with clang-tidy
run: |
pixi run -e ci test_benchmarks