-
Notifications
You must be signed in to change notification settings - Fork 59
34 lines (34 loc) · 1.24 KB
/
bazel.yaml
File metadata and controls
34 lines (34 loc) · 1.24 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
name: Bazel
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {} # support manual runs
permissions:
contents: read
pull-requests: write
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
type: [legacy, bzlmod]
steps:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}-${{ matrix.type }}
repository-cache: true
- if: matrix.type == 'legacy'
name: Test Bazel targets with legacy WORKSPACE mode
run: bazel build --reuse_sandbox_directories --noenable_bzlmod --enable_workspace //... && bazel test --noenable_bzlmod --enable_workspace //...
- if: matrix.type == 'bzlmod'
name: Test Bazel targets with bzlmod-only mode
run: bazel build --reuse_sandbox_directories --enable_bzlmod --noenable_workspace //... && bazel test --enable_bzlmod --noenable_workspace //...
- if: matrix.type == 'bzlmod'
name: Test Bazel targets with defaults
# default behavior is hybrid: bzlmod and workspace enabled
run: bazel build --reuse_sandbox_directories //... && bazel test //...