Skip to content

Conversation

boomanaiden154
Copy link
Contributor

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.

@boomanaiden154 boomanaiden154 force-pushed the basic-bazel-checks branch 6 times, most recently from f89e04e to 266c477 Compare August 15, 2025 04:22
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.
@boomanaiden154
Copy link
Contributor Author

https://github.com/llvm/llvm-project/actions/runs/16983068481/job/48146846926?pr=153740 caught some issues fixed in 4f15deb, so it appears like this does work.

@boomanaiden154 boomanaiden154 marked this pull request as ready for review August 15, 2025 04:46
@llvmbot
Copy link
Member

llvmbot commented Aug 15, 2025

@llvm/pr-subscribers-github-workflow

Author: Aiden Grossman (boomanaiden154)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/153740.diff

1 Files Affected:

  • (added) .github/workflows/bazel-checks.yml (+32)
diff --git a/.github/workflows/bazel-checks.yml b/.github/workflows/bazel-checks.yml
new file mode 100644
index 0000000000000..65d51649dd9e7
--- /dev/null
+++ b/.github/workflows/bazel-checks.yml
@@ -0,0 +1,32 @@
+name: Bazel Checks
+
+permissions:
+  contents: read
+
+on:
+  push:
+    paths:
+      - '.github/workflows/bazel-checks.yml'
+      - 'utils/bazel/**'
+    branches:
+      - main
+  pull_request:
+    paths:
+      - '.github/workflows/bazel-checks.yml'
+      - 'utils/bazel/**'
+
+jobs:
+  buildifier:
+    name: "Buildifier"
+    runs-on: ubuntu-24.04
+    if: github.repository == 'llvm/llvm-project'
+    steps:
+      - name: Fetch LLVM sources
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+      - name: Setup Buildifier
+        run: |
+          sudo curl -L https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-linux-amd64 -o /usr/bin/buildifier
+          sudo chmod +x /usr/bin/buildifier
+      - name: Run Buildifier
+        run: |
+          buildifier --mode=check $(find ./utils/bazel -name *BUILD*)

Copy link
Collaborator

@rupprecht rupprecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rupprecht rupprecht added the bazel "Peripheral" support tier build system: utils/bazel label Aug 15, 2025
@boomanaiden154 boomanaiden154 merged commit 0b04168 into llvm:main Aug 15, 2025
14 checks passed
@boomanaiden154 boomanaiden154 deleted the basic-bazel-checks branch August 15, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bazel "Peripheral" support tier build system: utils/bazel github:workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants