Skip to content

Commit

Permalink
[CI] Verify bazel buildifier is run and changes committed (llvm#1700)
Browse files Browse the repository at this point in the history
Ensures the buildifier (linter for bazel build files) is run and changes are pushed.
  • Loading branch information
sjain-stanford authored Dec 8, 2022
1 parent 804f9f1 commit 109c91a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/bazelBuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ jobs:
torch-mlir:ci \
bazel test @torch-mlir//test/...
- name: Verify buildifier was run (bazel lint)
run: |
docker run --rm \
-v "$(pwd)":"/opt/src/torch-mlir" \
-v "${HOME}/.cache/bazel":"/root/.cache/bazel" \
torch-mlir:ci \
bazel run @torch-mlir//:buildifier
if [ -n "$(git status --porcelain)" ]; then
echo "Please 'bazel run @torch-mlir//:buildifier' and commit changes."
exit 1
fi
# Switch back bazel cache directory to user ownership
# to allow GHA post-cache step to save cache without
# permissions issue.
Expand Down
6 changes: 3 additions & 3 deletions utils/bazel/torch-mlir-overlay/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,13 @@ cc_library(
],
strip_include_prefix = "include",
deps = [
":TorchMLIRTorchConversionToMLProgram",
":TorchMLIRTorchToArith",
":TorchMLIRTorchToLinalg",
":TorchMLIRTorchToMhlo",
":TorchMLIRTorchToSCF",
":TorchMLIRTorchToTMTensor",
":TorchMLIRTorchToTosa",
":TorchMLIRTorchConversionToMLProgram",
],
)

Expand All @@ -487,6 +487,7 @@ cc_library(
":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRTorchConversionDialect",
":TorchMLIRTorchConversionPassesIncGen",
":TorchMLIRTorchConversionToMLProgram",
":TorchMLIRTorchDialect",
":TorchMLIRTorchPasses",
":TorchMLIRTorchToArith",
Expand All @@ -495,7 +496,6 @@ cc_library(
":TorchMLIRTorchToSCF",
":TorchMLIRTorchToTMTensor",
":TorchMLIRTorchToTosa",
":TorchMLIRTorchConversionToMLProgram",
"@llvm-project//mlir:ConversionPasses",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:LinalgDialect",
Expand Down Expand Up @@ -781,8 +781,8 @@ cc_library(
":TorchMLIRTorchConversionDialect",
"@llvm-project//mlir:ArithTransforms",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:MLProgramDialect",
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:MLProgramDialect",
"@llvm-project//mlir:MathTransforms",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:Pass",
Expand Down

0 comments on commit 109c91a

Please sign in to comment.