mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
37 lines
997 B
YAML
37 lines
997 B
YAML
name: Check format
|
|
description: Check format using clang-format-17
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Add llvm repo
|
|
run: |
|
|
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 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-17
|
|
sudo rm /usr/bin/clang-format
|
|
sudo ln -s /usr/bin/clang-format-17 /usr/bin/clang-format
|
|
shell: bash
|
|
|
|
- name: Run formatter
|
|
continue-on-error: true
|
|
id: run_formatter
|
|
run: |
|
|
./.githooks/pre-commit
|
|
shell: bash
|
|
|
|
- name: Check for differences
|
|
id: assert
|
|
shell: bash
|
|
run: |
|
|
git diff --color --exit-code | tee "clang-format.patch"
|
|
|
|
- name: Fail job
|
|
if: ${{ steps.run_formatter.outcome != 'success' }}
|
|
shell: bash
|
|
run: exit 1
|