Refactor clang-format workflow to remove container dependency and install tools directly
This commit is contained in:
parent
80d3299b51
commit
07c205173e
8
.github/workflows/clang-format.yml
vendored
8
.github/workflows/clang-format.yml
vendored
@ -8,7 +8,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
clang-tools:
|
clang-tools:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: silkeh/clang:latest # Pre-built container with clang tools
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # Needed to push changes back
|
contents: write # Needed to push changes back
|
||||||
@ -19,10 +18,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ github.head_ref }} # checkout the PR branch so we can push back
|
ref: ${{ github.head_ref }} # checkout the PR branch so we can push back
|
||||||
|
|
||||||
|
- name: Install clang tools
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y clang-format clang-tidy
|
||||||
|
|
||||||
- name: Run clang-format and auto-fix
|
- name: Run clang-format and auto-fix
|
||||||
run: |
|
run: |
|
||||||
FILES=$(find . -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp')
|
FILES=$(find . -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp')
|
||||||
clang-format --dump-config -i $FILES
|
clang-format -i $FILES
|
||||||
|
|
||||||
- name: Commit and push changes (if any)
|
- name: Commit and push changes (if any)
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user