-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (73 loc) · 1.94 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
# SPDX-License-Identifier: ISC
#
# Copyright (c) 2023 Johnathan C Maudlin <[email protected]>
---
name: Lint
on:
pull_request:
paths:
- .clang-format
- .clang-tidy
- .clangd
- .github/workflows/lint.yml
- .prettierrc.yml
- include/**/*.h
- meson.build
- src/**/*.c
- src/**/meson.build
push:
paths:
- .clang-format
- .clang-tidy
- .clangd
- .github/workflows/lint.yml
- .prettierrc.yml
- include/**/*.h
- meson.build
- src/**/*.c
- src/**/meson.build
workflow_dispatch:
jobs:
lint:
strategy:
fail-fast: false
matrix:
linter:
- name: clang-format
- name: clang-tidy
os:
- name: ubuntu-latest
deps: clang clang-format clang-tidy cmake git libasan5 libubsan1 lld ninja-build
name: ${{ matrix.linter.name }} (${{ matrix.os.name }})
runs-on: ${{ matrix.os.name }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup build cache
uses: actions/cache@v3
id: build
with:
key: build-${{ hashFiles('**/CMakeLists.txt', '**/*.c', '**/*.h') }}
path: build/
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-{recommends,suggests} ${{ matrix.os.deps }}
# TODO(jcmdln): Test ploy
- name: Build Ploy (Debug)
env:
CC: clang
CXX: clang++
LD: lld
run: |
[ ! -e build ] && mkdir build
cd build
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
ninja
# TODO(jcmdln): Only in actions, clang-tidy warns about suppressed warnings
- name: Run ${{ matrix.linter.name }}
run: |
ninja -C build ${{ matrix.linter.name }}