-
Notifications
You must be signed in to change notification settings - Fork 15
55 lines (42 loc) · 1.4 KB
/
check_format.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Check for format changes
# Build on every branch push, tag push, and pull request change:
on: [push, pull_request]
jobs:
check_format:
name: Check format
runs-on: ubuntu-latest
steps:
- name: Checkout reposistory
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt install clang-format-11
- name: make format
run: make -j $(nproc) format
- name: Check if there are format changes
id: format_changes
uses: tj-actions/verify-changed-files@v14
- name: format changes
if: steps.format_changes.outputs.files_changed == 'true'
run: |
echo "Changed files: ${{ steps.format_changes.outputs.changed_files }}"
echo "Please run \`make format\` and commit the result"
exit 1
check_tidy:
name: Check tidy
runs-on: ubuntu-latest
steps:
- name: Checkout reposistory
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt install clang-tidy-11
- name: make tidy
run: make -j $(nproc) tidy
- name: Check if there are tidy changes
id: tidy_changes
uses: tj-actions/verify-changed-files@v14
- name: tidy changes
if: steps.tidy_changes.outputs.files_changed == 'true'
run: |
echo "Changed files: ${{ steps.tidy_changes.outputs.changed_files }}"
echo "Please run \`make tidy\` and commit the result"
exit 1