feat: add format check workflow #1
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
name: Check code formatting | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
clang_format: | |
name: 'Check code formatting' | |
runs-on: ubuntu-latest | |
container: | |
image: archlinux | |
steps: | |
- name: Checkout repository action | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github/actions | |
- name: Install clang | |
shell: bash | |
run: | |
sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf | |
pacman --noconfirm --noprogressbar -Syyu | |
pacman --noconfirm --noprogressbar -Sy clang | |
- name: Run clang-format | |
shell: bash | |
run: clang-format --dry-run --Werror */**.{h,c}pp |