Skip to content

Instantly share code, notes, and snippets.

@ei1333
Created December 11, 2022 12:15
Show Gist options
  • Select an option

  • Save ei1333/fc493e4465de9018b71bf6b581c94309 to your computer and use it in GitHub Desktop.

Select an option

Save ei1333/fc493e4465de9018b71bf6b581c94309 to your computer and use it in GitHub Desktop.
format.yml
name: clang-format
on:
pull_request:
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.ref }}
- name: install tools
run: |
sudo wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - 2>/dev/null
sudo add-apt-repository "deb http://apt.llvm.org/`lsb_release -sc`/ llvm-toolchain-`lsb_release -sc` main" 2>/dev/null
sudo apt-get update
sudo apt-get install clang-format-16
- name: apply formatter
run: |
clang-format-16 --dry-run --Werror $(find . -name "*.hpp" -or -name "*.cpp")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment