-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from TrentonBowserFanClub/dev/bazel-format
Adding bazel format task, and CI format check
- Loading branch information
Showing
18 changed files
with
1,244 additions
and
165 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,5 @@ | ||
# Bazel configurations set for this repository. You | ||
|
||
# can also set local configs in your ~/.bazelrc file. | ||
|
||
common --enable_bzlmod |
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,2 @@ | ||
[flake8] | ||
# TODO |
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,3 @@ | ||
# GitHub Workflows | ||
|
||
Use `act` for testing workflows locally: https://nektosact.com/introduction.html |
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,40 @@ | ||
name: CI | ||
on: | ||
push: | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
concurrency: | ||
# Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109 | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🚀 Checkout | ||
uses: actions/checkout@v4 | ||
- name: 🌿 Setup Bazel | ||
uses: bazel-contrib/[email protected] | ||
with: | ||
bazelisk-cache: true | ||
disk-cache: ${{ github.workflow }} | ||
repository-cache: true | ||
bazelrc: | | ||
build --color=yes | ||
build --show_timestamps | ||
- name: 🗒️ Track Current Files | ||
run: touch /tmp/pre_fmt | ||
- name: 🧹 Format Repository | ||
run: bazel run //:format | ||
- name: 👀 Detect Diff | ||
run: | | ||
set +x | ||
formatted_files=$(find ./config ./src ./tools -newer /tmp/pre_fmt) | ||
num_formatted_files=$(find ./config ./src ./tools -newer /tmp/pre_fmt | wc -l) | ||
if [ "$num_formatted_files" -gt "0" ]; then | ||
echo "❌🔥 Bad code detected! The following files would be reformatted:" | ||
echo "$formatted_files" | ||
exit 1 | ||
fi |
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
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 @@ | ||
# TODO |
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
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
Oops, something went wrong.