Merge pull request #94 from smatsuodev/directory-listing #309
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: format | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
format: | |
timeout-minutes: 10 | |
# 24.04 は beta | |
# 新しい clang-format を簡単にインストールするために必要 | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
- run: | | |
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" | sudo tee /etc/apt/sources.list.d/llvm.list | |
echo "deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list | |
sudo apt-get update | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: clang-format-19 | |
version: 1.0 | |
- run: clang-format-19 -i $(git ls-files '*.cpp' '*.hpp') | |
- run: git diff --exit-code |