Skip to content

Commit 9b90419

Browse files
committed
ci(bazel): add cross-platform branch checks
Signed-off-by: Simon Scatton <[email protected]>
1 parent 71ab13a commit 9b90419

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎.bazelversion‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9.1.0

‎.github/workflows/branch-checks.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,31 @@ jobs:
139139
fi
140140
exit 0
141141
142+
bazel:
143+
name: Bazel (${{ matrix.runner }})
144+
needs: pr_metadata
145+
if: needs.pr_metadata.outputs.should_run == 'true'
146+
strategy:
147+
fail-fast: false
148+
matrix:
149+
runner: [linux-amd64-cpu8, linux-arm64-cpu8, macos-latest-xlarge]
150+
runs-on: ${{ matrix.runner }}
151+
steps:
152+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
153+
154+
- name: Set up Bazel
155+
uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # v0.19.0
156+
with:
157+
bazelisk-cache: true
158+
disk-cache: ${{ github.workflow }}-${{ matrix.runner }}
159+
repository-cache: true
160+
161+
- name: Build
162+
run: bazel build //...
163+
164+
- name: Test
165+
run: bazel test //...
166+
142167
python:
143168
name: Python (${{ matrix.runner }})
144169
needs: pr_metadata

‎MODULE.bazel‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ crate.from_cargo(
3333
cargo_lock = "//:Cargo.lock",
3434
cargo_toml = "//:Cargo.toml",
3535
platform_triples = [
36+
"aarch64-apple-darwin",
37+
"aarch64-unknown-linux-gnu",
3638
"x86_64-unknown-linux-gnu",
3739
],
3840
)

‎crates/openshell-vfio/BUILD.bazel‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ rust_library(
77
name = "openshell_vfio",
88
srcs = glob(["src/**/*.rs"]),
99
aliases = aliases(),
10+
target_compatible_with = ["@platforms//os:linux"],
1011
deps = all_crate_deps(normal = True),
1112
)
1213

1314
rust_test(
1415
name = "openshell_vfio_test",
1516
crate = ":openshell_vfio",
17+
target_compatible_with = ["@platforms//os:linux"],
1618
deps = all_crate_deps(normal_dev = True),
1719
)

0 commit comments

Comments
 (0)