mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
28 lines
817 B
YAML
28 lines
817 B
YAML
name: Check format
|
|
description: Check format using clang-format-16
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Add llvm repo
|
|
run: |
|
|
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main' | sudo tee -a /etc/apt/sources.list
|
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
|
shell: bash
|
|
|
|
- name: Install packages
|
|
run: |
|
|
sudo apt update -qq
|
|
sudo apt install -y jq clang-format-16
|
|
shell: bash
|
|
|
|
- name: Run formatter
|
|
run: |
|
|
find src unittests -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-16 -i
|
|
shell: bash
|
|
|
|
- name: Check for differences
|
|
id: assert
|
|
shell: bash
|
|
run: |
|
|
git diff --color --exit-code | tee "clang-format.patch"
|