Skip to content

Commit

Permalink
CI testing: remove Bazel 6, add Bazel 8 (#17)
Browse files Browse the repository at this point in the history
* feat: replace Bazel 6 testing with Bazel 8

* print the bazel version that was resolved

* Enable workspace explicitly

* Update bazel.yaml

* Update bazel.yaml

The RC just came out
  • Loading branch information
alexeagle authored Oct 9, 2024
1 parent 69b4764 commit 8889dd1
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/bazel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - .github/workflows/ci.bazelrc
# - .bazelrc
#
# This workflow uses https://github.com/p0deje/setup-bazel to prepare the cache folders.
# This workflow uses https://github.com/bazel-contrib/setup-bazel to prepare the cache folders.
# Caching may be disabled by setting `mount_bazel_caches` to false.

on:
Expand All @@ -25,7 +25,7 @@ on:
description: |
JSON-formatted array of exclusions to the generated matrix of tests.
By default, we don't test non-linux with Bazel 6 to minimize macOS and Windows minutes
By default, we don't test non-linux with Bazel 8 to minimize macOS and Windows minutes
since they are billed at 10X and 2X respectively:
https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
Expand All @@ -34,8 +34,8 @@ on:
type: string
default: |
[
{"bazelversion": "6.4.0", "os": "macos-latest"},
{"bazelversion": "6.4.0", "os": "windows-latest"}
{"bazelversion": "8.0.0rc1", "os": "macos-latest"},
{"bazelversion": "8.0.0rc1", "os": "windows-latest"}
]
exclude_windows:
description: Don't run any tests on Windows
Expand All @@ -51,7 +51,7 @@ on:
mount_bazel_caches:
default: true
description: |
Whether to enable caching in the p0deje/setup-bazel action.
Whether to enable caching in the bazel-contrib/setup-bazel action.
type: boolean

jobs:
Expand Down Expand Up @@ -86,8 +86,8 @@ jobs:
# NB: we assume this is Bazel 7
- id: bazel_from_bazelversion
run: echo "bazelversion=$(head -n 1 .bazelversion)" >> $GITHUB_OUTPUT
- id: bazel_6
run: echo "bazelversion=6.4.0" >> $GITHUB_OUTPUT
- id: bazel_8
run: echo "bazelversion=8.0.0rc1" >> $GITHUB_OUTPUT
outputs:
# Will look like ["<version from .bazelversion>", "x.y.z"]
bazelversions: ${{ toJSON(steps.*.outputs.bazelversion) }}
Expand Down Expand Up @@ -118,11 +118,13 @@ jobs:
- uses: bazel-contrib/setup-bazel@0.8.0
with:
repository-cache: ${{ inputs.mount_bazel_caches }}
bazelrc: common --announce_rc --color=yes --enable_bzlmod=${{ matrix.bzlmodEnabled }}
bazelrc: common --announce_rc --color=yes --enable_bzlmod=${{ matrix.bzlmodEnabled }} --enable_workspace=${{ ! matrix.bzlmodEnabled }}

- name: Configure Bazel version
working-directory: ${{ matrix.folder }}
run: echo "${{ matrix.bazelversion }}" > .bazelversion
run: |
echo "${{ matrix.bazelversion }}" > .bazelversion
bazel version
- name: Check for test.sh
# Checks for the existence of test.sh in the folder. Downstream steps can use
Expand Down

0 comments on commit 8889dd1

Please sign in to comment.