From 9d61a306e582b105a5073206ec1226fa381f2e54 Mon Sep 17 00:00:00 2001 From: Connor McEntee Date: Sun, 29 Mar 2026 16:07:22 +0000 Subject: [PATCH] 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) --- .github/workflows/ci.yml | 133 ++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 24 ++++++ 2 files changed, 157 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..b96072d2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 //... diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..25f60779 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }}