test #88
Workflow file for this run
This file contains hidden or 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
| name: "Check Clang Format" | |
| on: [push, pull_request] | |
| jobs: | |
| format: | |
| name: "Check Clang Format" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: "Install clang-format" | |
| run: | | |
| wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
| sudo add-apt-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-21 main" | |
| sudo apt-get update | |
| sudo apt-get install clang-format-21 | |
| sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-21 100 | |
| - name: "Format Codes" | |
| run: find src/ -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.hpp" \) -exec clang-format -i {} + | |
| - name: Check diff | |
| run: git diff --exit-code HEAD | |
| - name: Create Pull Request | |
| if: failure() | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| commit-message: "style: format codes" | |
| title: "Format codes for ${{ github.ref }}" | |
| labels: "style" | |
| assignees: "${{ github.actor }}" | |
| reviewers: "${{ github.actor }}" | |
| branch: "auto-pr/clang-format/${{ github.ref }}" |