-
Notifications
You must be signed in to change notification settings - Fork 24
73 lines (61 loc) · 1.85 KB
/
linter.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
#
# Copyright (c) 2023, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
name: Linters
on:
pull_request:
paths-ignore: "docs/**"
jobs:
cpp-linter:
strategy:
matrix:
llvm-version: [19]
image-version: [22.04]
runs-on: ubuntu-${{ matrix.image-version }}
container:
image:
ghcr.io/trailofbits/vast-ubuntu-${{ matrix.image-version }}-llvm-${{ matrix.llvm-version }}-dev:latest
permissions:
actions: write
issues: write
pull-requests: write
packages: read
env:
CMAKE_PREFIX_PATH: "/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/mlir/;/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/clang/"
steps:
- name: Remove safety checks for pygit
run: git config --global --add safe.directory '*'
- name: Clone the vast repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Export compile commands
run: cmake --preset ci
- name: Install dependencies
run: |
pip3 install clang-tools cpp-linter
clang-tools -i ${{ matrix.llvm-version }}
- name: Run C++ Linters
uses: xlauko/cpp-linter-action@latest
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ matrix.llvm-version }}
style: file
database: ./builds/ci/
lines-changed-only: true
thread-comments: true
step-summary: true
ignore: 'test'
tidy-checks: ''
- name: Report result
if: steps.linter.outputs.checks-failed > 0
run:
echo "Some files failed the linting checks!"
exit 1