-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 936 Bytes
/
check-format.yml
File metadata and controls
37 lines (30 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: 📊 Format check
on: [push, pull_request, workflow_dispatch]
env:
BUILD_TYPE: Debug # Change build type here.
jobs:
build:
runs-on: ubuntu-20.04 # Update Ubuntu version here.
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Install Conan
shell: bash
run: |
sudo pip install conan
- name: Install clang-format
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y clang-format
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCHECK_FORMAT_PREV_DIFF=""
- name: Run clang-format
shell: bash
run: |
cd build
cmake --build . --config $BUILD_TYPE --target CheckDiffFormat
[[ -s patch.txt ]] && echo "*** The following formatting errors were found:" || echo "*** No formatting errors found."
cat patch.txt
[[ -s patch.txt ]] && exit 1 || exit 0