-
Notifications
You must be signed in to change notification settings - Fork 29
57 lines (48 loc) · 1.75 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
name: Lint
on:
push:
branches: [ "**" ]
paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake']
pull_request:
branches: [ "**" ]
paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake']
jobs:
build:
name: Lint all cpp
runs-on: ubuntu-latest
steps:
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Create default Conan profile
run: conan profile detect
- name: Fetch up-core-api conan recipe
uses: actions/checkout@v4
with:
path: up-conan-recipes
repository: gregmedd/up-conan-recipes
- name: Build up-core-api conan package
shell: bash
run: |
conan create --version 1.5.8 up-conan-recipes/up-core-api/developer
- name: Fetch up-cpp
uses: actions/checkout@v4
with:
path: up-cpp
- name: Install conan packages for up-cpp
id: pkgs
shell: bash
run: |
cd up-cpp
conan install . --build=missing
cd build/Release/generators
grep -r 'set(.*_PACKAGE_FOLDER_RELEASE '| cut -d '"' -f2 | sort | uniq | awk '$0="-I"$0"/include"' | tr '\n' ' ' | awk '$0="includes="$0' >> "$GITHUB_OUTPUT"
- name: Run linters
uses: cpp-linter/cpp-linter-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo-root: up-cpp
style: 'file' # read .clang-format for configuration
tidy-checks: '' # Read .clang-tidy for configuration
extra-args: '-std=c++17 -Iinclude ${{ steps.pkgs.output.includes }}'