Skip to content

Commit

Permalink
chore: update to Bazel 6.0.0rc1 (aspect-build#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored Oct 26, 2022
1 parent dd49ddb commit c6c257a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
5.3.2
6.0.0rc1
# The first line of this file is used by Bazelisk and Bazel to be sure
# the right version of Bazel is used to build and test this repo.
# This also defines which version is used on CI.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:local --disk_cache=~/.cache/bazel

# Generic remote cache
build --remote_local_fallback
build --remote_download_toplevel
# build --remote_download_toplevel # BREAKS BUILD in Bazel 6.0.0rc1
build --remote_timeout=3600
build --remote_upload_local_results
## Fixes builds hanging on CI that get the TCP connection closed without sending RST packets.
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,25 @@ jobs:
run: echo "::set-output name=config::local"
- id: rbe
run: echo "::set-output name=config::rbe"
# Don't run RBE if there is now EngFlow creds which is the case on forks.
# Don't run RBE if there are no EngFlow creds which is the case on forks
if: ${{ env.ENGFLOW_PRIVATE_KEY != '' }}
outputs:
# Will look like '["local", "rbe"]'
configs: ${{ toJSON(steps.*.outputs.config) }}

matrix-prep-bazelversion:
# Prepares the 'bazelversion' axis of the test matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: bazel_6
run: echo "::set-output name=bazelversion::$(head -n 1 .bazelversion)"
- id: bazel_5
run: echo "::set-output name=bazelversion::5.3.2"
outputs:
# Will look like '["6.0.0rc1", "5.3.2"]'
bazelversions: ${{ toJSON(steps.*.outputs.bazelversion) }}

matrix-prep-folder:
# Prepares the 'folder' axis of the test matrix
runs-on: ubuntu-latest
Expand Down Expand Up @@ -79,12 +92,22 @@ jobs:

needs:
- matrix-prep-config
- matrix-prep-bazelversion
- matrix-prep-folder

strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.matrix-prep-config.outputs.configs) }}
bazelversion: ${{ fromJSON(needs.matrix-prep-bazelversion.outputs.bazelversions) }}
folder: ${{ fromJSON(needs.matrix-prep-folder.outputs.folders) }}
exclude:
# Don't test RBE with Bazel 5 (not supported)
- config: rbe
bazelversion: 5.3.2
# Don't test bzlmod with Bazel 5 (not supported)
- bazelversion: 5.3.2
folder: e2e/bzlmod

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -100,6 +123,10 @@ jobs:
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', '**/*.js') }}
restore-keys: bazel-cache-

- name: Configure Bazel version
working-directory: ${{ matrix.folder }}
run: echo "USE_BAZEL_VERSION=${{ matrix.bazelversion }}" >> $GITHUB_ENV

- name: Write EngFlow credentials
# Writes EngFlow credential files for RBE configurations
if: matrix.config == 'rbe'
Expand All @@ -109,7 +136,6 @@ jobs:
chmod 0600 engflow.crt engflow.key
echo "$ENGFLOW_CLIENT_CRT" > engflow.crt
echo "$ENGFLOW_PRIVATE_KEY" > engflow.key
echo "USE_BAZEL_VERSION=6.0.0-pre.20220922.1" >> $GITHUB_ENV
env:
ENGFLOW_CLIENT_CRT: ${{ secrets.ENGFLOW_CLIENT_CRT }}
ENGFLOW_PRIVATE_KEY: ${{ secrets.ENGFLOW_PRIVATE_KEY }}
Expand Down Expand Up @@ -148,6 +174,7 @@ jobs:
- name: bazel coverage //...
# Don't run if there is a test.sh file in the folder.
# Don't run on RBE. Coverage does not work properly with RBE. See: bazelbuild/bazel#4685.
# Don't run coverage on e2e/bzlmod. It fails evaluating js/private/coverage/BUILD.bazel because write_source_files is not yet bzlmod compatible.
if: steps.has_test_sh.outputs.files_exists != 'true' && matrix.config == 'local'
working-directory: ${{ matrix.folder }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module(
compatibility_level = 1,
)

bazel_dep(name = "aspect_bazel_lib", version = "1.13.1")
bazel_dep(name = "aspect_bazel_lib", version = "1.14.0")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "rules_nodejs", version = "5.5.3")
bazel_dep(name = "platforms", version = "0.0.4")
2 changes: 0 additions & 2 deletions e2e/bzlmod/.bazelversion

This file was deleted.

1 change: 1 addition & 0 deletions e2e/bzlmod/.bazelversion
6 changes: 3 additions & 3 deletions js/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def rules_js_dependencies():

http_archive(
name = "aspect_bazel_lib",
sha256 = "c15e3bdb626973728c375ef78c58fdee27c9b9affea5c9db57c78eafda8395bf",
strip_prefix = "bazel-lib-1.13.1",
url = "https://github.com/aspect-build/bazel-lib/archive/refs/tags/v1.13.1.tar.gz",
sha256 = "9305799c6d9e425e6b73270a0f9eb0aa1082050823a7eefad95edcece545e77b",
strip_prefix = "bazel-lib-1.14.0",
url = "https://github.com/aspect-build/bazel-lib/archive/refs/tags/v1.14.0.tar.gz",
)

0 comments on commit c6c257a

Please sign in to comment.