Skip to content

wip: adopt bzlmod

wip: adopt bzlmod #154

Workflow file for this run

name: "build and test"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
# Cancel previous actions from the same PR or branch except 'main' branch.
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info.
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Keep a disk-cache
disk-cache: true
# Share repository cache between workflows.
repository-cache: true
# enable some flags for CI
bazelrc: |
import %workspace%/.github/workflows/ci.bazelrc
# keep a cache for MODULE.bazel repos
external-cache: true
- run: bazel build //... && bazel test //...
e2e-workspace-matrix:
strategy:
matrix:
version: [
5.x, # TODO: deprecate by Jan 2025 https://bazel.build/release
6.x,
7.x,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Keep a disk-cache
disk-cache: true
# Share repository cache between workflows.
repository-cache: true
# enable some flags for CI
bazelrc: |
import %workspace%/../../.aspect/workflows/ci.bazelrc
- run: cd e2e/bazel-workspace && USE_BAZEL_VERSION=${{ matrix.version }} bazel build //...
e2e-bzlmod-matrix:
strategy:
matrix:
version: [
6.x,
7.x,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Keep a disk-cache
disk-cache: true
# Share repository cache between workflows.
repository-cache: true
# enable some flags for CI
bazelrc: |
import %workspace%/../../.aspect/workflows/ci.bazelrc
# keep a cache for MODULE.bazel repos
external-cache: true
- run: cd e2e/bazel-bzlmod && USE_BAZEL_VERSION=${{ matrix.version }} bazel build //...