-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Frank <[email protected]>
- Loading branch information
Showing
1 changed file
with
39 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,39 @@ | ||
name: Code format check | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
treefmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create user program directory | ||
run: | | ||
mkdir -p $HOME/.local/bin | ||
echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
- name: Install treefmt | ||
run: | | ||
curl -L https://github.com/numtide/treefmt/releases/download/v2.0.5/treefmt_2.0.5_linux_amd64.tar.gz -o treefmt.tar.gz | ||
tar -xvzf treefmt.tar.gz | ||
install -m 755 treefmt $HOME/.local/bin | ||
rm LICENSE README.md treefmt treefmt.tar.gz | ||
- name: Install clang-format | ||
run: | | ||
curl -L https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-32d3ac78/clang-format-17_linux-amd64 -o clang-format | ||
install -m 755 clang-format $HOME/.local/bin | ||
rm clang-format | ||
- uses: actions/setup-python@v5 | ||
|
||
- name: Install cmake-format | ||
run: | | ||
pip install cmakelang | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Check code format | ||
continue-on-error: true | ||
run: | | ||
treefmt | ||
git diff --exit-code |