Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
agents:
queue: "openmowernext-ci"

env:
ROS_DISTRO: "jazzy"

steps:
- label: "Unit"
key: "unit"
command: ".buildkite/scripts/ci-unit.sh"
timeout_in_minutes: 120
artifact_paths:
- "build/open_mower_next/test_results/**/*"
- "log/**/*"

- label: "Docs"
key: "docs"
command: ".buildkite/scripts/docs-build.sh"
timeout_in_minutes: 30
if_changed:
- "docs/**"
- ".buildkite/**"
artifact_paths:
- "docs/.vitepress/dist/**/*"

- label: "Runtime image"
key: "runtime-image"
command: ".buildkite/scripts/docker-build.sh runtime"
timeout_in_minutes: 180
if_changed:
- "Dockerfile"
- "Makefile"
- "package.xml"
- "custom_deps.yaml"
- "cmake/**"
- "config/**"
- "description/**"
- "launch/**"
- "maps/**"
- "protos/**"
- "src/**"
- "utils/**"
- "worlds/**"

- label: "Devcontainer image"
key: "devcontainer-image"
command: ".buildkite/scripts/docker-build.sh devcontainer"
timeout_in_minutes: 60
if_changed:
- ".devcontainer/**"

- label: "Integration"
key: "integration"
command: ".buildkite/scripts/ci-integration.sh"
agents:
queue: "openmowernext-webots"
timeout_in_minutes: 180
concurrency: 1
concurrency_group: "openmowernext/webots"
if: |
build.source == "ui" ||
build.source == "api" ||
build.source == "schedule" ||
build.pull_request.labels includes "integration"
artifact_paths:
- "build/open_mower_next/test_results/**/*"
- "log/**/*"
64 changes: 64 additions & 0 deletions .buildkite/scripts/ci-integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bash

set -euo pipefail

docker run --rm \
--volume "$PWD:/workspace" \
--workdir /workspace \
--env ROS_DISTRO=jazzy \
--env DEBIAN_FRONTEND=noninteractive \
--env WEBOTS_OFFSCREEN=1 \
ros:jazzy \
bash -lc '
set -eo pipefail

apt-get update
apt-get install -y --no-install-recommends \
build-essential \
bzip2 \
ca-certificates \
cmake \
curl \
git \
libxcb-cursor0 \
python3-colcon-common-extensions \
python3-rosdep \
python3-vcstool \
xvfb

rosdep init >/dev/null 2>&1 || true
rosdep update

webots_root="${HOME}/.ros/webotsR2025a"
webots_home="${webots_root}/webots"
if [ ! -x "${webots_home}/webots" ]; then
rm -rf "${webots_root}"
mkdir -p "${webots_root}"
curl -L -o /tmp/webots-R2025a-x86-64.tar.bz2 \
https://github.com/cyberbotics/webots/releases/download/R2025a/webots-R2025a-x86-64.tar.bz2
tar -xjf /tmp/webots-R2025a-x86-64.tar.bz2 -C "${webots_root}"
fi
test -x "${webots_home}/webots"

export WEBOTS_HOME="${webots_home}"
export WEBOTS_OFFSCREEN=1

source /opt/ros/${ROS_DISTRO}/setup.bash
make custom-deps deps

make build-libs
source install/setup.bash
colcon build \
--symlink-install \
--packages-select open_mower_next \
--cmake-args -DOPEN_MOWER_NEXT_ENABLE_INTEGRATION_TESTS=ON

source install/setup.bash
colcon test \
--packages-select open_mower_next \
--event-handlers console_direct+ \
--ctest-args -L integration --output-on-failure
colcon test-result \
--test-result-base build/open_mower_next/test_results \
--verbose
'
44 changes: 44 additions & 0 deletions .buildkite/scripts/ci-unit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

set -euo pipefail

docker run --rm \
--volume "$PWD:/workspace" \
--workdir /workspace \
--env ROS_DISTRO=jazzy \
--env DEBIAN_FRONTEND=noninteractive \
ros:jazzy \
bash -lc '
set -eo pipefail

apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
git \
python3-colcon-common-extensions \
python3-rosdep \
python3-vcstool

rosdep init >/dev/null 2>&1 || true
rosdep update

source /opt/ros/${ROS_DISTRO}/setup.bash
make custom-deps deps

make build-libs

source install/setup.bash
colcon build --symlink-install --packages-select open_mower_next

source install/setup.bash
colcon test \
--packages-select open_mower_next \
--event-handlers console_direct+ \
--ctest-args -LE integration --output-on-failure
colcon test-result \
--test-result-base build/open_mower_next/test_results \
--verbose
'
30 changes: 30 additions & 0 deletions .buildkite/scripts/docker-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -euo pipefail

target="${1:-runtime}"
commit="${BUILDKITE_COMMIT:-local}"
tag="${commit:0:12}"

case "$target" in
runtime)
image="openmowernext"
dockerfile="Dockerfile"
context="."
;;
devcontainer)
image="openmowernext-devcontainer"
dockerfile=".devcontainer/Dockerfile"
context=".devcontainer"
;;
*)
echo "unknown docker build target: $target" >&2
exit 2
;;
esac

docker build \
--pull \
--file "$dockerfile" \
--tag "${image}:buildkite-${tag}" \
"$context"
14 changes: 14 additions & 0 deletions .buildkite/scripts/docs-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

docker run --rm \
--volume "$PWD:/workspace" \
--workdir /workspace/docs \
node:18-bookworm \
bash -lc '
set -euo pipefail
npm ci
npm run docs:build
touch .vitepress/dist/.nojekyll
'
15 changes: 15 additions & 0 deletions .buildkite/scripts/terraform-validate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -euo pipefail

docker run --rm \
--volume "$PWD:/workspace" \
--workdir /workspace \
--entrypoint sh \
hashicorp/terraform:1.9.8 \
-lc '
set -eu
terraform -chdir=infra/buildkite fmt -check
terraform -chdir=infra/buildkite init -backend=false -input=false
terraform -chdir=infra/buildkite validate
'
3 changes: 2 additions & 1 deletion .devcontainer/default.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export ROS_AUTOMATIC_DISCOVERY_RANGE=${ROS_AUTOMATIC_DISCOVERY_RANGE:-LOCALHOST}
export OM_DATUM_LAT=-22.9
export OM_DATUM_LONG=-43.2
export OM_MAP_PATH=.devcontainer/home/map.geojson
export OM_MAP_PATH=maps/realistic_garden.geojson
55 changes: 0 additions & 55 deletions .github/workflows/build.yml

This file was deleted.

Loading