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 11, 2024
1 parent 7e3099e commit fd3930b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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.1.0/treefmt_2.1.0_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
run: |
treefmt
git diff --exit-code

0 comments on commit fd3930b

Please sign in to comment.