chore: add CI and BCR publish workflows

Add GitHub Actions CI that mirrors the BCR presubmit matrix (default,
prof-libunwind, prof-libgcc, prof-gcc, examples) across 4 platforms and
Bazel 7/8/9/latest. Add publish-to-bcr workflow triggered by GitHub
releases to automate BCR PR submission.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Connor McEntee 2026-03-29 16:07:22 +00:00
parent fa76b18861
commit 9d61a306e5
2 changed files with 157 additions and 0 deletions

133
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,133 @@
name: CI
on:
push:
branches: [bcr-5.3.0]
pull_request:
branches: [bcr-5.3.0]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (${{ matrix.os }}, Bazel ${{ matrix.bazel_version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
bazel_version: ["7.x", "8.x", "9.x", "latest"]
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
repository-cache: true
- name: Build
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
run: bazel build //...
- name: Test
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
run: bazel test //...
prof-libunwind:
name: Prof libunwind (${{ matrix.os }}, Bazel ${{ matrix.bazel_version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
bazel_version: ["7.x", "8.x", "9.x", "latest"]
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
repository-cache: true
- name: Build
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
run: bazel build //... --config=prof-libunwind
- name: Test
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
run: bazel test //... --config=prof-libunwind
prof-libgcc:
name: Prof libgcc (${{ matrix.os }}, Bazel ${{ matrix.bazel_version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
bazel_version: ["7.x", "8.x", "9.x", "latest"]
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
repository-cache: true
- name: Build
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
run: bazel build //... --config=prof-libgcc
- name: Test
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
run: bazel test //... --config=prof-libgcc ${{ startsWith(matrix.os, 'macos') && '-- -//test/unit:prof_gdump' || '' }}
prof-gcc:
name: Prof gcc (${{ matrix.os }}, Bazel ${{ matrix.bazel_version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
bazel_version: ["7.x", "8.x", "9.x", "latest"]
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
repository-cache: true
- name: Build
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
run: bazel build //... --config=prof-gcc
- name: Test
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
run: bazel test //... --config=prof-gcc ${{ startsWith(matrix.os, 'macos') && '-- -//test/unit:prof_gdump' || '' }}
examples:
name: Examples (${{ matrix.os }}, Bazel ${{ matrix.bazel_version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
bazel_version: ["7.x", "8.x", "9.x", "latest"]
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
repository-cache: true
- name: Build
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
working-directory: examples
run: bazel build //...
- name: Test
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
working-directory: examples
run: bazel test //...

24
.github/workflows/publish.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Publish to BCR
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: "Git tag to publish (e.g. 5.3.0-bcr.1)"
required: true
type: string
jobs:
publish:
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v2
with:
tag_name: ${{ inputs.tag_name || github.ref_name }}
registry_fork: sallustfire/bazel-central-registry
draft: true
attest: false
permissions:
contents: read
secrets:
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}