diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 0000000..8ceb8b4 --- /dev/null +++ b/.bazelignore @@ -0,0 +1 @@ +test/bazel diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml new file mode 100644 index 0000000..3a20da6 --- /dev/null +++ b/.github/workflows/bazel.yml @@ -0,0 +1,21 @@ +name: Bazel CI +on: [push, pull_request, workflow_dispatch] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v7 + with: + folders: | + [ + ".", + "test/bazel", + ] + exclude: | + [ + {"folder": ".", "bzlmodEnabled": false}, + {"folder": "test/bazel", "bzlmodEnabled": false}, + ] diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc new file mode 100644 index 0000000..cb2a9b3 --- /dev/null +++ b/.github/workflows/ci.bazelrc @@ -0,0 +1,18 @@ +# This file contains Bazel settings to apply on CI only. +# It is referenced with a --bazelrc option in the call to bazel in ci.yaml + +# Debug where options came from +build --announce_rc + +# This directory is configured in GitHub actions to be persisted between runs. +# We do not enable the repository cache to cache downloaded external artifacts +# as these are generally faster to download again than to fetch them from the +# GitHub actions cache. +build --disk_cache=~/.cache/bazel + +# Don't rely on test logs being easily accessible from the test runner, +# though it makes the log noisier. +test --test_output=errors + +# Allows tests to run bazelisk-in-bazel, since this is the cache folder used +test --test_env=XDG_CACHE_HOME diff --git a/test/bazel/BUILD.bazel b/test/bazel/BUILD.bazel new file mode 100644 index 0000000..a586d84 --- /dev/null +++ b/test/bazel/BUILD.bazel @@ -0,0 +1 @@ +load("@xacro//:build_defs.bzl", "xacro") diff --git a/test/bazel/MODULE.bazel b/test/bazel/MODULE.bazel new file mode 100644 index 0000000..0646ffc --- /dev/null +++ b/test/bazel/MODULE.bazel @@ -0,0 +1,5 @@ +bazel_dep(name = "xacro") +local_path_override( + module_name = "xacro", + path = "../..", +)