-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github actions fail on unformatted code.
- Loading branch information
1 parent
be6c10d
commit 61ff091
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Check formatting | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
formatter: | ||
name: Check formatting of Python, C++, and Bazel files. | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build wheel | ||
shell: bash | ||
run: | | ||
bazelisk run //:bazel_formatter | ||
bazelisk run //:python_formatter | ||
bazelisk run //:clang_formatter | ||
- name: Check if any files have changed | ||
id: changes | ||
uses: UnicornGlobal/has-changes-action@v1 | ||
|
||
- name: Error if code has not been formatted | ||
if: steps.changes.outputs.changed == 1 | ||
run: | | ||
echo "Code has not been formatted. Please run the formatters as described by the README." | ||
return 1 |