Skip to content

Commit 05b292c

Browse files
authored
Merge pull request #278 from sombraSoft/fix/bazel-lint-errors
Fix: Bazel Lint Errors and CI Workflow
2 parents e38b0b2 + 52e7223 commit 05b292c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/buildifier.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Lint Bazel
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
buildifier:
13+
runs-on: 'ubuntu-latest'
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
check:
18+
- name: Run buildifier format
19+
run: ./buildifier -r -mode=check -lint=off .
20+
- name: Run buildifier lint
21+
run: ./buildifier -r -lint=warn .
22+
name: ${{ matrix.check.name }}
23+
env:
24+
BUILDIFIER_VERSION: v8.2.1
25+
26+
steps:
27+
- name: Checkout Code
28+
uses: actions/checkout@v5
29+
30+
- name: Cache buildifier
31+
id: cache-buildifier
32+
uses: actions/cache@v4
33+
with:
34+
path: ./buildifier
35+
key: ${{ runner.os }}-buildifier-${{ env.BUILDIFIER_VERSION }}
36+
37+
- name: Download buildifier
38+
if: steps.cache-buildifier.outputs.cache-hit != 'true'
39+
run: |
40+
wget https://github.com/bazelbuild/buildtools/releases/download/${BUILDIFIER_VERSION}/buildifier-linux-amd64 -O buildifier
41+
chmod +x buildifier
42+
43+
- name: ${{ matrix.check.name }}
44+
run: ${{ matrix.check.run }}

0 commit comments

Comments
 (0)