Skip to content

Fix BCR publishing #777

Fix BCR publishing

Fix BCR publishing #777

Workflow file for this run

name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [master]
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
# Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pre_commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.1
test:
name: Test (Bazel ${{ matrix.bazel }}, Detekt ${{ matrix.detekt-strategy }})
runs-on: ubuntu-latest
env:
USE_BAZEL_VERSION: ${{ matrix.bazel }}
strategy:
fail-fast: false
matrix:
bazel: ["8.x", "9.x", "rolling"]
detekt-strategy: [local, worker]
steps:
- name: "Checkout the sources"
uses: actions/checkout@v7
- name: "Setup Bazel"
uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
disk-cache: true
repository-cache: true
- name: "Unit tests"
run: bazel test --strategy=Detekt=${{ matrix.detekt-strategy }} //...
- name: Verify MODULE.bazel.lock is unchanged
if: ${{ always() && matrix.bazel == '9.x' && matrix.detekt-strategy == 'local' }}
shell: bash
run: |
if [[ -n "$(git status --porcelain -- MODULE.bazel.lock)" ]]; then
git diff -- MODULE.bazel.lock
git diff --cached -- MODULE.bazel.lock
echo "::error file=MODULE.bazel.lock::MODULE.bazel.lock changed during CI. Run Bazel locally and commit the updated lockfile."
exit 1
fi