current commit
261105.13 · Stagger GitHub Actions ci.yml hourly schedule to :30 (30 * * * *).
# Copyright 2026 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Tests

on:
  # continuous runs
  schedule:
    # Run every hour (staggered to avoid top-of-the-hour runner queue spikes)
    - cron: "30 * * * *"

  # postsubmit runs
  push:
    branches:
      - master
      - lts_*

  # presubmit runs
  pull_request:
    branches:
      - master
      - lts_*

  # manual runs
  workflow_dispatch:

permissions:
  contents: read

# Avoid running twice at the same time over the same changes.
concurrency:
  group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: ${{ contains(fromJSON('["pull_request", "workflow_dispatch", "schedule"]'), github.event_name) }}

jobs:
  linux:
    name: Linux ${{ matrix.config.name }} Bazel
    strategy:
      fail-fast: false  # Don't cancel all jobs if one fails.
      matrix:
        config:
          # linux_clang-latest_libcxx_bazel.cfg
          - name: Clang/libc++
            toolchain: clang
          # linux_clang-latest_libcxx_exceptions_bazel.cfg (fastbuild only)
          - name: Clang/libc++ -fexceptions
            toolchain: clang-exceptions
            compilation_modes: '["fastbuild"]'
          # linux_clang-latest_libcxx_alternate_options_bazel.cfg
          - name: Clang/libc++ alternate options
            toolchain: clang
            alternate_options: true
          # linux_clang-latest_libcxx_asan_bazel.cfg (fastbuild only)
          - name: Clang/libc++ ASAN
            toolchain: asan
            compilation_modes: '["fastbuild"]'
          # linux_clang-latest_libcxx_tsan_bazel.cfg (fastbuild only)
          - name: Clang/libc++ TSAN
            toolchain: tsan
            compilation_modes: '["fastbuild"]'
          # linux_clang-latest_libstdcxx_bazel.cfg
          - name: Clang/libstdc++
            toolchain: libstdc++
          # linux_gcc-latest_libstdcxx_bazel.cfg
          - name: GCC/libstdc++
            toolchain: gcc
          # linux_gcc-latest_libstdcxx_exceptions_bazel.cfg (fastbuild only)
          - name: GCC/libstdc++ -fexceptions
            toolchain: gcc-exceptions
            compilation_modes: '["fastbuild"]'
          # linux_gcc-latest_libstdcxx_alternate_options_bazel.cfg
          - name: GCC/libstdc++ alternate options
            toolchain: gcc
            alternate_options: true
          # linux_gcc-floor_libstdcxx_bazel.cfg (c++17 only)
          - name: GCC/libstdc++ (floor)
            toolchain: gcc
            remote_config: remote-floor
            container_image: gcr.io/google.com/absl-177019/oss-linux-toolchain-floor@sha256:9027d0b4cae51d764cebafecbf9e390a14f97cf977ca24d02cc533998614acd2
            stds: '["c++17"]'
          # linux_arm_clang-latest_libcxx_bazel.cfg (c++17 and c++20 only)
          - name: ARM64 Clang/libc++
            os: ubuntu-24.04-arm
            toolchain: clang-arm
            remote_config: remote-arm
            stds: '["c++17", "c++20"]'
    uses: ./.github/workflows/bazel.yml
    secrets: inherit
    with:
      os: ${{ matrix.config.os || 'ubuntu-24.04' }}
      toolchain: ${{ matrix.config.toolchain }}
      remote_config: ${{ matrix.config.remote_config || 'remote' }}
      container_image: ${{ matrix.config.container_image || 'gcr.io/google.com/absl-177019/oss-linux-toolchain-latest@sha256:81009eeb5523ae59cfbea8dc0847d41572ed100f79e3c976c64378a0c30d353c' }}
      alternate_options: ${{ matrix.config.alternate_options || false }}
      stds: ${{ matrix.config.stds || '["c++17", "c++20", "c++23"]' }}
      compilation_modes: ${{ matrix.config.compilation_modes || '["opt", "fastbuild"]' }}

  cmake:
    name: ${{ matrix.config.name }} CMake
    strategy:
      fail-fast: false  # Don't cancel all jobs if one fails.
      matrix:
        config:
          # linux_gcc-latest_libstdcxx_cxx17_cmake.cfg
          - name: Linux GCC/libstdc++
            os: ubuntu-24.04
            container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58
          # linux_gcc_alpine_cmake.cfg
          - name: Alpine Linux GCC (musl)
            os: ubuntu-24.04
            container_image: gcr.io/google.com/absl-177019/alpine@sha256:52945833fc7b7b93f73ec865eb82390aa46d4e3acd1af87d253cd4a05f95d241
            build_types: '["Debug"]'
            link_modes: '["static"]'
          # cmake-install.cfg
          - name: Linux Install
            os: ubuntu-24.04
            container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58
            build_types: '["Release"]'
            link_modes: '["static", "shared"]'
            install_test: true
          # macos_xcode_cmake.cfg
          - name: macOS Xcode
            os: macos-latest
            build_types: '["Debug"]'
          # windows-msvc-2022-cxx17-dbg-cmake.cfg
          # windows-msvc-2022-cxx17-dbg-dll-cmake.cfg
          - name: Windows MSVC 2022
            os: windows-2022-8-core
            build_types: '["Debug"]'
            link_modes: '["static", "shared"]'
    uses: ./.github/workflows/cmake.yml
    secrets: inherit
    with:
      os: ${{ matrix.config.os }}
      container_image: ${{ matrix.config.container_image || '' }}
      build_types: ${{ matrix.config.build_types || '["Debug", "Release"]' }}
      link_modes: ${{ matrix.config.link_modes || '["static", "shared", "monolithic-shared"]' }}
      install_test: ${{ matrix.config.install_test || false }}

  windows:
    name: Windows ${{ matrix.config.name }} Bazel
    strategy:
      fail-fast: false  # Don't cancel all jobs if one fails.
      matrix:
        config:
          # windows-msvc-2022-cxx{17,20}-{dbg,opt}-bazel.cfg
          - name: MSVC 2022
            toolchain: windows-msvc
          # windows-msvc-2022-alternate-options-cxx{17,20}-dbg-bazel.cfg (dbg only)
          - name: MSVC 2022 Alternate Options
            toolchain: windows-msvc
            alternate_options: true
            compilation_modes: '["dbg"]'
          # windows-clangcl-cxx17-fastbuild-bazel.cfg
          - name: ClangCL
            toolchain: windows-clangcl
            stds: '["c++17"]'
            compilation_modes: '["fastbuild"]'
    uses: ./.github/workflows/bazel.yml
    secrets: inherit
    with:
      os: windows-2022-8-core
      toolchain: ${{ matrix.config.toolchain }}
      remote_config: remote-cache
      alternate_options: ${{ matrix.config.alternate_options || false }}
      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, macos]
    runs-on: ubuntu-24.04
    steps:
      - name: Check for cancellations
        if: ${{ contains(join(needs.*.result, ' '), 'cancelled') }}
        run: echo "One or more tests were cancelled.  If this was a presubmit job cancelled by a submit job, you can ignore this." && exit 1
      - name: Check for failures
        if: ${{ contains(join(needs.*.result, ' '), 'failure') }}
        run: echo "One or more tests failed.  Please check the logs above and fix the issues." && exit 1
    # This workflow must run even if one or more of the dependent workflows
    # failed.
    if: always()