Improve(bazel) Add buildifier lint and format github actions
Signed-off-by: Sombrio <sombrio@sombrasoft.dev>
This commit is contained in:
parent
6d65cb6f84
commit
52e7223eb4
|
|
@ -0,0 +1,44 @@
|
|||
name: Lint Bazel
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
buildifier:
|
||||
runs-on: 'ubuntu-latest'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
check:
|
||||
- name: Run buildifier format
|
||||
run: ./buildifier -r -mode=check -lint=off .
|
||||
- name: Run buildifier lint
|
||||
run: ./buildifier -r -lint=warn .
|
||||
name: ${{ matrix.check.name }}
|
||||
env:
|
||||
BUILDIFIER_VERSION: v8.2.1
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Cache buildifier
|
||||
id: cache-buildifier
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./buildifier
|
||||
key: ${{ runner.os }}-buildifier-${{ env.BUILDIFIER_VERSION }}
|
||||
|
||||
- name: Download buildifier
|
||||
if: steps.cache-buildifier.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget https://github.com/bazelbuild/buildtools/releases/download/${BUILDIFIER_VERSION}/buildifier-linux-amd64 -O buildifier
|
||||
chmod +x buildifier
|
||||
|
||||
- name: ${{ matrix.check.name }}
|
||||
run: ${{ matrix.check.run }}
|
||||
Loading…
Reference in New Issue