build: introduce clang-format in the code base, enforce via CI #6
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: | |
branches: | |
- main | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
check_format: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install the packages needed for checking code formatting | |
run: | | |
# sudo apt install --no-install-recommends -y \ | |
# clang-format-15 | |
# sudo update-alternatives --get-selections | |
sudo update-alternatives --list clang-format | |
sudo update-alternatives --query clang-format | |
clang-format --version | |
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 10 | |
sudo update-alternatives --set clang-format /usr/bin/clang-format-15 | |
clang-format --version | |
exit 1 | |
- name: Checkout itcoin-fbft | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: check code formatting | |
run: | | |
make check-code-formatting |