Port macOS Xcode Bazel tests to GitHub Actions. This adds the `macos` job matrix to `.github/workflows/ci.yml` and `build:macos` flags to `.bazelrc` to mirror the `macOS Xcode Bazel` and `macOS Xcode Alternate Options Bazel` Kokoro jobs. PiperOrigin-RevId: 999051111
diff --git a/.bazelrc b/.bazelrc index 91d4da9..fd7c3ef 100644 --- a/.bazelrc +++ b/.bazelrc
@@ -50,6 +50,14 @@ build:windows-clangcl --extra_execution_platforms=//:x64_windows-clang-cl build:windows-clangcl --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl +# Configure our macOS Xcode setup. +build:macos --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 +build:macos --copt=-Werror +build:macos --copt=-DGTEST_REMOVE_LEGACY_TEST_CASEAPI_=1 +build:macos --features=external_include_paths +build:macos --per_file_copt=external/.*@-w +build:macos --host_per_file_copt=external/.*@-w + build:gcc --config=linux --platforms=//ci:linux_gcc build:gcc-exceptions --config=gcc --copt=-fexceptions build:clang --config=linux --platforms=//ci:linux_clang --conlyopt=-Wno-unused-command-line-argument
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4de4e8f..bf9774f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml
@@ -44,9 +44,6 @@ cancel-in-progress: ${{ contains(fromJSON('["pull_request", "workflow_dispatch", "schedule"]'), github.event_name) }} jobs: - # Mirrors the 11 Linux Bazel Kokoro jobs (parallelized to 1 job per Bazel - # invocation). Not yet covered here: - # - macOS Kokoro jobs linux: name: Linux ${{ matrix.config.name }} Bazel strategy: @@ -180,10 +177,31 @@ stds: ${{ matrix.config.stds || '["c++17", "c++20"]' }} compilation_modes: ${{ matrix.config.compilation_modes || '["dbg", "opt"]' }} + macos: + name: macOS ${{ matrix.config.name }} Bazel + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + config: + # macos_xcode_bazel.cfg + - name: Xcode + # macos_xcode_alternate_options_bazel.cfg + - name: Xcode Alternate Options + alternate_options: true + uses: ./.github/workflows/bazel.yml + secrets: inherit + with: + os: macos-latest + toolchain: macos + remote_config: remote-cache + alternate_options: ${{ matrix.config.alternate_options || false }} + stds: ${{ matrix.config.stds || '["c++17"]' }} + compilation_modes: ${{ matrix.config.compilation_modes || '["fastbuild"]' }} + # Provide a single predictably-named job for copybara to look for all-blocking-tests: name: All Blocking Tests - needs: [linux, cmake, windows] + needs: [linux, cmake, windows, macos] runs-on: ubuntu-latest steps: - name: Check for cancellations