bazel: add tidy and check

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-03-13 18:33:31 +01:00
parent 9b3af5af76
commit 02c97fac03
12 changed files with 267 additions and 111 deletions

View file

@ -1,37 +0,0 @@
name: Bazel unit tests and linting
on:
workflow_dispatch:
push:
branches:
- main
- "release/**"
paths:
- "**.bzl"
- "**.bazel"
- ".github/workflows/test-bazel.yml"
pull_request:
paths:
- "**.bzl"
- "**.bazel"
- ".github/workflows/test-bazel.yml"
jobs:
bazel-test:
name: Bazel tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
- name: Run buildifier
shell: bash
run: |
bazelisk test //:buildifier-check
# TODO(malt3): Find workflows to run bazel unit tests
# - name: Run unit tests
# shell: bash
# run: bazelisk test --test_output=all ...

View file

@ -1,4 +1,4 @@
name: Go mod tidy check
name: tidy-and-check
on:
workflow_dispatch:
@ -19,8 +19,8 @@ on:
- ".github/workflows/test-tidy.yml"
jobs:
gotidycheck:
name: Go mod tidy check
tidycheck:
name: tidy and check
runs-on: ubuntu-22.04
steps:
- name: Checkout
@ -32,9 +32,11 @@ jobs:
- name: Run Bazel tidy
shell: bash
run: |
bazelisk run //bazel/ci:tidy
bazelisk run //:gazelle-check
run: bazelisk run //:tidy
- name: Run Bazel check
shell: bash
run: bazelisk run //:check
- name: Check if tidy made modifications
id: tidycheck