Skip to content

Continuous integration #1022

Continuous integration

Continuous integration #1022

Workflow file for this run

name: Continuous integration
on:
push:
branches: master
pull_request:
branches: master
workflow_dispatch: # allows manual triggering
schedule:
- cron: '1 11 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build-and-test:
name: Build & Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
bazel_mode: [workspace, module]
version: ["6.5.0", "7.4.1", "8.0.0"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: tweag/configure-bazel-remote-cache-auth@144b0b915f13a418f5eafe2f68d19564ec136c62 # v0.1.1
with:
buildbuddy_api_key: ${{ secrets.BUILDBUDDY_API_KEY }}
bazelrc_path: .bazelrc.auth
- uses: extractions/netrc@f6f1722d05ce2890aa86fd9654565b1214ac53a4 # v2.0.1
with:
machine: api.github.com
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure for CI
uses: tweag/write-bazelrc@b1f117f25f2042ecdc708026eadd23bf825bc98a # v0.1.1
with:
content: build --config=ci
- name: Disable stardoc
# Windows: Stardoc complains about docstring quote indentation on Windows.
# bzlmod: Stardoc does not work with bzlmod.
if: ${{ runner.os == 'Windows' || matrix.bazel_mode == 'module' }}
uses: tweag/write-bazelrc@b1f117f25f2042ecdc708026eadd23bf825bc98a # v0.1.1
with:
content: build --config=no-stardoc
- name: Enable bzlmod
uses: tweag/write-bazelrc@b1f117f25f2042ecdc708026eadd23bf825bc98a # v0.1.1
if: ${{ matrix.bazel_mode == 'module' }}
with:
content: build --enable_bzlmod
- name: Configure the Bazel version
run: |
echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc
echo "USE_BAZEL_VERSION=${{ matrix.version }}" > tests/.bazeliskrc
- name: Run Bazel test at the root
if: ${{ matrix.bazel_mode == 'workspace' && runner.os != 'Windows' }}
uses: ./.github/actions/run_bazel_test
- name: Run Bazel test under the tests directory
uses: ./.github/actions/run_bazel_test
with:
working-directory: tests
all_ci_tests:
runs-on: ubuntu-latest
needs:
- build-and-test
if: ${{ always() }}
steps:
- uses: cgrindel/gha_join_jobs@8a9736c29a7e5ebd9f3af2870f59cb6d563b6659 # v1.4.0
env:
USE_BAZEL_VERSION: '7.x'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}