Skip to content

Commit 9ff3571

Browse files
committed
build: enforce frozen lockfile mode, enable user-specific Bazel configuration, and disable package manager caching in CI/PR workflows
1 parent 82c3fd6 commit 9ff3571

5 files changed

Lines changed: 48 additions & 19 deletions

File tree

‎.bazelrc‎

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
common --@aspect_rules_ts//ts:skipLibCheck=always
22
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
3-
common --enable_bzlmod
43
build --symlink_prefix=dist/
54

65
# Needed as otherwise `env` of TS actions would be ignored.
76
common --incompatible_merge_fixed_and_default_shell_env
87

9-
# For remote testing
10-
# -----
8+
# Frozen lockfile
9+
common --lockfile_mode=error
10+
11+
################################
12+
# Remote Execution Setup #
13+
################################
1114

1215
# The following --define=EXECUTOR=remote will be able to be removed
1316
# once https://github.com/bazelbuild/bazel/issues/7254 is fixed
@@ -27,14 +30,37 @@ build:remote --cpu=k8
2730
build:remote --host_cpu=k8
2831

2932
# Toolchain and platform related flags
30-
build:remote --host_platform=@devinfra//bazel/remote-execution:platform
31-
build:remote --platforms=@devinfra//bazel/remote-execution:platform
33+
# build:remote --host_platform=@devinfra//bazel/remote-execution:platform
34+
# build:remote --platforms=@devinfra//bazel/remote-execution:platform
3235

33-
# Remote instance and caching
36+
# Use the Angular team internal GCP instance for remote execution.
3437
build:remote --remote_instance_name=projects/internal-200822/instances/primary_instance
3538
build:remote --bes_instance_name=internal-200822
39+
40+
# Setup the remote build execution servers.
3641
build:remote --remote_cache=remotebuildexecution.googleapis.com
3742
build:remote --remote_executor=remotebuildexecution.googleapis.com
3843

44+
# Set up authentication mechanism for RBE
45+
build:remote --google_default_credentials
46+
47+
# Use HTTP remote cache
48+
# build:remote-cache --remote_cache=https://storage.googleapis.com/angular-team-cache
49+
# build:remote-cache --remote_accept_cached=true
50+
# build:remote-cache --remote_upload_local_results=false
51+
# build:remote-cache --google_default_credentials
52+
53+
# Additional flags added when running a "trusted build" with additional access
54+
# build:trusted-build --remote_upload_local_results=true
55+
3956
# Flag for validation/demonstration of partial compilation usage.
4057
build --flag_alias=partial_compilation=//src/ng_project/config:partial_compilation
58+
59+
####################################################
60+
# User bazel configuration
61+
# NOTE: This needs to be the *last* entry in the config.
62+
####################################################
63+
64+
# Load any settings which are specific to the current user. Needs to be *last* statement
65+
# in this config, as the user configuration should be able to overwrite flags from this file.
66+
try-import .bazelrc.user

‎.bazelversion‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.4.0
1+
8.6.0

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ jobs:
2121
steps:
2222
- name: Initialize environment
2323
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@c4344a4e20dbdf9cb8eeb7a7eb91431b98eabd99
24+
with:
25+
disable-package-manager-cache: true
2426
- name: Setup Bazel
2527
uses: angular/dev-infra/github-actions/bazel/setup@c4344a4e20dbdf9cb8eeb7a7eb91431b98eabd99
2628
- name: Setup Bazel Remote Caching
2729
uses: angular/dev-infra/github-actions/bazel/configure-remote@c4344a4e20dbdf9cb8eeb7a7eb91431b98eabd99
2830
with:
2931
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
30-
- name: Install node modules
32+
- name: Test
3133
run: pnpm bazel test --build_tests_only //...

‎.github/workflows/pr.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
steps:
3333
- name: Initialize environment
3434
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@c4344a4e20dbdf9cb8eeb7a7eb91431b98eabd99
35+
with:
36+
disable-package-manager-cache: true
3537
- name: Setup Bazel
3638
uses: angular/dev-infra/github-actions/bazel/setup@c4344a4e20dbdf9cb8eeb7a7eb91431b98eabd99
3739
- name: Setup Bazel Remote Caching
3840
uses: angular/dev-infra/github-actions/bazel/configure-remote@c4344a4e20dbdf9cb8eeb7a7eb91431b98eabd99
39-
with:
40-
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
41-
- name: Install node modules
41+
- name: Test
4242
run: pnpm bazel test --build_tests_only //...

‎MODULE.bazel.lock‎

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)