Skip to content

Commit 0b04168

Browse files
[CI] Add Basic Bazel Checks (#153740)
Having basic checks (like running buildifier) on the upstream bazel files would be helpful for contributors maintaining the bazel build. Add basic checks (currently just buildifier) to a workflow that runs whenever the bazel build files change.
1 parent 6d3ad9d commit 0b04168

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/bazel-checks.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Bazel Checks
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
paths:
9+
- '.github/workflows/bazel-checks.yml'
10+
- 'utils/bazel/**'
11+
branches:
12+
- main
13+
pull_request:
14+
paths:
15+
- '.github/workflows/bazel-checks.yml'
16+
- 'utils/bazel/**'
17+
18+
jobs:
19+
buildifier:
20+
name: "Buildifier"
21+
runs-on: ubuntu-24.04
22+
if: github.repository == 'llvm/llvm-project'
23+
steps:
24+
- name: Fetch LLVM sources
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
- name: Setup Buildifier
27+
run: |
28+
sudo curl -L https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-linux-amd64 -o /usr/bin/buildifier
29+
sudo chmod +x /usr/bin/buildifier
30+
- name: Run Buildifier
31+
run: |
32+
buildifier --mode=check $(find ./utils/bazel -name *BUILD*)

0 commit comments

Comments
 (0)