blob: 0e9e9b9276b1956c121ce97df6563245fc45bef6 [file]
# 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
- cron: "0 * * * *"
# 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:
# Mirrors the 11 Linux Bazel Kokoro jobs (parallelized to 1 job per Bazel
# invocation). Not yet covered here:
# - macOS Bazel and Windows Bazel Kokoro 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:5a5d17e588e14d5f0d993ea828b7ba844c72b02980bcf731ccf5a4cddf8db599
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:5a19067585ce5e5ee45640fd0287f05038d6b3f9574d6a5cdf08241e022d0f4a' }}
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:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6
# linux_gcc_alpine_cmake.cfg
- name: Alpine Linux GCC (musl)
os: ubuntu-24.04
container_image: gcr.io/google.com/absl-177019/alpine@sha256:ae26b80601cebb14595056a94e070f0f865d24baaf3ce19bcd52f53be9f99c80
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:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6
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
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 }}
# Provide a single predictably-named job for copybara to look for
all-blocking-tests:
name: All Blocking Tests
needs: [linux, cmake]
runs-on: ubuntu-latest
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()