-
Notifications
You must be signed in to change notification settings - Fork 189
167 lines (157 loc) · 4.4 KB
/
code-scanning.yaml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Code Scanning
on:
push:
pull_request:
branches: [ master ]
env:
MAKEFLAGS: -j8
permissions:
actions: read
contents: read
security-events: write
jobs:
code-ql:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: >
libasound2-dev
libbluetooth-dev
libbsd-dev
libdbus-1-dev
libfdk-aac-dev
libglib2.0-dev
libmp3lame-dev
libmpg123-dev
libncurses5-dev
libreadline-dev
libsbc-dev
libspandsp-dev
- uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
queries: security-and-quality
- name: Create Build Environment
run: |
mkdir -p ${{ github.workspace }}/{build,m4}
autoreconf --install
- name: Configure GNU Automake
working-directory: ${{ github.workspace }}/build
run: |
${{ github.workspace }}/configure \
--enable-aac \
--enable-faststream \
--enable-mp3lame \
--enable-mpg123 \
--enable-msbc \
--enable-ofono \
--enable-upower \
--enable-aplay \
--enable-cli \
--enable-rfcomm \
--enable-a2dpconf \
--enable-hcitop
- name: Build
working-directory: ${{ github.workspace }}/build
run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
doc8-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run reStructuredText Linter
uses: deep-entertainment/doc8-action@v4
with:
ignorePaths: ${{ github.workspace }}/doc/bluealsa-api.txt
scanPaths: ${{ github.workspace }}
include-what-you-use:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
uses: awalsh128/cache-apt-pkgs-action@v1
with:
# XXX: iwyu package depends on clang-14, but is built with clang-13
packages: >
bear
check
iwyu libclang-13-dev
jq
libasound2-dev
libbluetooth-dev
libbsd-dev
libdbus-1-dev
libfdk-aac-dev
libglib2.0-dev
libmp3lame-dev
libmpg123-dev
libncurses5-dev
libreadline-dev
libsbc-dev
libspandsp-dev
- uses: actions/checkout@v3
- name: Create Build Environment
run: |
mkdir -p ${{ github.workspace }}/{build,m4}
autoreconf --install
- name: Configure GNU Automake
working-directory: ${{ github.workspace }}/build
run: |
${{ github.workspace }}/configure \
--enable-aac \
--enable-debug \
--enable-debug-time \
--enable-faststream \
--enable-mp3lame \
--enable-mpg123 \
--enable-msbc \
--enable-ofono \
--enable-upower \
--enable-aplay \
--enable-cli \
--enable-rfcomm \
--enable-a2dpconf \
--enable-hcitop \
--enable-test
- name: Build
working-directory: ${{ github.workspace }}/build
run: bear -- make check TESTS=
- name: Run IWYU Check
run: |
jq 'del(.[] | select(.file | endswith("-iface.c")))' \
${{ github.workspace }}/build/compile_commands.json > tmp.json \
&& mv tmp.json ${{ github.workspace }}/build/compile_commands.json
iwyu_tool -p ${{ github.workspace }}/build -- \
-Xiwyu --mapping_file=${{ github.workspace }}/.github/iwyu.imp \
-Xiwyu --keep=*/config.h \
-Xiwyu --no_fwd_decls
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Markdown Linter
uses: nosborn/github-action-markdown-cli@v3
with:
files: ${{ github.workspace }}
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run ShellCheck Scan
uses: redhat-plumbers-in-action/differential-shellcheck@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Spell Check
uses: rojopolis/spellcheck-github-actions@master
with:
config_path: .github/spellcheck.yaml