Pin X-code version on mac/bazel tests to prevent flakiness.

See https://github.com/bazelbuild/rules_swift/issues/950 and https://www.smileykeith.com/2021/03/08/locking-xcode-in-bazel/ for more details.

PiperOrigin-RevId: 507609630
pull/11809/head
Mike Kruskal 2 years ago committed by Copybara-Service
parent b1109ff985
commit ae4c4ea6d4
  1. 27
      .github/BUILD.bazel
  2. 5
      .github/actions/internal/bazel-setup/action.yml

@ -0,0 +1,27 @@
# This information is extracted from the MacOS runner specs located at:
# https://github.com/actions/runner-images/blob/win19/20230129.2/images/macos/macos-12-Readme.md
xcode_version(
name = "version14_2_14C18",
version = "14.2.14C18",
aliases = ["14C18"],
default_ios_sdk_version = "16.2",
default_tvos_sdk_version = "16.1",
default_macos_sdk_version = "13.1",
default_watchos_sdk_version = "9.1",
)
xcode_version(
name = "version14_1_0_14B47b",
version = "14.1.0.14B47b",
aliases = ["14B47b"],
default_ios_sdk_version = "16.1",
default_tvos_sdk_version = "16.1",
default_macos_sdk_version = "13.0",
default_watchos_sdk_version = "9.1",
)
xcode_config(
name = "host_xcodes",
versions = [":version14_2_14C18", ":version14_1_0_14B47b"],
default = ":version14_1_0_14B47b",
)

@ -39,6 +39,11 @@ runs:
shell: bash
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --enable_runfiles" >> $GITHUB_ENV
- name: Initialize MacOS-specific Bazel flags
if: runner.os == 'macOS'
shell: bash
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --xcode_version_config=//.github:host_xcodes" >> $GITHUB_ENV
- name: Configure Bazel caching
# Skip bazel cache for local act runs due to issue with credential files
# and nested docker images

Loading…
Cancel
Save