Skip to content

Commit

Permalink
Add code-format gh action
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Frank <[email protected]>
  • Loading branch information
ThoFrank committed Nov 7, 2024
1 parent 7922684 commit 3ff6402
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/format.yml
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

0 comments on commit 3ff6402

Please sign in to comment.