Build, CI: set up code formatting infrastructure #13
Workflow file for this run
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: Linting | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone tntcxx | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup clang-format | |
run: sudo apt install -y clang-format | |
shell: bash | |
- name: Run clang-format | |
run: > | |
if git clang-format origin/${{ github.event.pull_request.base.ref }} -diff -q; then | |
echo Code formatting changed some files, please review. | |
exit 1 | |
fi | |
shell: bash |