forked from Thalhammer/jwt-cpp
-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (124 loc) · 4.35 KB
/
lint.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Lint CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
clang-format:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
files:
- "include/jwt-cpp/*.h"
- "include/jwt-cpp/traits/**/*.h"
- "tests/*.cpp"
- "tests/**/*.cpp"
- "example/*.cpp"
- "example/**/*.cpp"
steps:
- run: |
sudo apt-get install clang-format-14
shopt -s globstar
- uses: actions/checkout@v4
- run: clang-format-14 -i ${{ matrix.files }}
- uses: ./.github/actions/process-linting-results
with:
linter_name: clang-format
cmake-format:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
files: ["**/CMakeLists.txt", "cmake/code-coverage.cmake"]
steps:
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- run: pip install cmakelang
- run: shopt -s globstar
- uses: actions/checkout@v4
- run: cmake-format -i ${{ matrix.files }}
- uses: ./.github/actions/process-linting-results
with:
linter_name: cmake-format
clang-tidy:
runs-on: ubuntu-20.04
steps:
- run: sudo apt-get install clang-tidy
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v4
- name: configure
run: |
mkdir build
cd build
cmake .. -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-fix"
- name: run
working-directory: build
run: make
- uses: ./.github/actions/process-linting-results
with:
linter_name: clang-tidy
render-defaults:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
traits:
- { name: "boost_json", library: "Boost.JSON", url: "https://github.com/boostorg/json", disable_pico: true }
- { name: "danielaparker_jsoncons", library: "jsoncons", url: "https://github.com/danielaparker/jsoncons", disable_pico: true }
- { name: "kazuho_picojson", library: "picojson", url: "https://github.com/kazuho/picojson", disable_pico: false }
- { name: "nlohmann_json", library: "JSON for Modern C++", url: "https://github.com/nlohmann/json", disable_pico: true }
- { name: "open_source_parsers_jsoncpp", library: "jsoncpp", url: "https://github.com/open-source-parsers/jsoncpp", disable_pico: true }
name: render-defaults (${{ matrix.traits.name }})
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get install clang-format-14
- uses: ./.github/actions/render/defaults
id: render
with:
traits_name: ${{ matrix.traits.name }}
library_name: ${{ matrix.traits.library }}
library_url: ${{ matrix.traits.url }}
disable_default_traits: ${{ matrix.traits.disable_pico }}
- run: clang-format-14 -i ${{ steps.render.outputs.file_path }}
- run: git add ${{ steps.render.outputs.file_path }}
- uses: ./.github/actions/process-linting-results
with:
linter_name: render-defaults
render-tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
traits:
# - { name: "boost_json", suite: "BoostJsonTest" } # Currently needs work arounds for API limitations
- { name: "danielaparker_jsoncons", suite: "JsonconsTest" }
# - { name: "kazuho_picojson", suite: "PicoJsonTest" } # Currently the default everything tests against this!
- { name: "nlohmann_json", suite: "NlohmannTest" }
- { name: "open_source_parsers_jsoncpp", suite: "OspJsoncppTest" }
name: render-tests (${{ matrix.traits.name }})
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get install clang-format-14
shopt -s globstar
- uses: ./.github/actions/render/tests
with:
traits_name: ${{ matrix.traits.name }}
test_suite_name: ${{ matrix.traits.suite }}
- run: clang-format-14 -i tests/**/*.cpp
- run: git add tests/traits/*
- uses: ./.github/actions/process-linting-results
with:
linter_name: render-tests
line-ending:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- run: git add --renormalize .
- uses: ./.github/actions/process-linting-results
with:
linter_name: line-ending