-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (49 loc) · 1.39 KB
/
lib-formatting.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
56
57
58
name: C code formatting
on:
pull_request:
push:
branches:
- main
- dev
defaults:
run:
shell: bash
working-directory: lib
jobs:
formatting-check:
name: C Expressive Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v4.10.1
with:
clang-format-version: '15'
lint:
name: C Lint Check
runs-on: ubuntu-latest
steps:
# we need this to get <assemblyline.h> to get linting right
- uses: 0xADE1A1DE/AssemblyLine@main
# we need this to get <node/node_api.h> to get linting right
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3
- name: C/C++ Lint Action
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files-changed-only: false
thread-comments: true
style: file
version: 14
tidy-checks: ""
ignore: ".github"
extra-args: "-std=c17 -I./lib/src -I./lib/test -I./lib/src/include -DUSE_ASSEMBLYLINE"
- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: |
echo "Some files failed the linting checks!"; exit 1