-
Notifications
You must be signed in to change notification settings - Fork 8
107 lines (102 loc) · 3.52 KB
/
analysis.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
name: Analysis
on:
pull_request:
push:
# don't run on packaging and dependabot branches
branches-ignore:
- 'for-debian'
- 'debian/**'
- 'pristine-tar'
- 'dependabot/**'
paths:
- '**'
- '!doc/**'
- '!**.md'
permissions:
contents: read
security-events: write
jobs:
clang:
runs-on: ubuntu-22.04
container: debian:bookworm
name: clang-analyzer
steps:
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y install meson make git python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps clang clang-tools
- uses: actions/checkout@v4
- name: 'workaround for Meson versions < 1.1'
run: ln -s meson.options meson_options.txt
- name: meson setup
run: scan-build --use-cc=clang meson setup -Dpdf-doc=false build
- name: meson compile
run: scan-build --use-cc=clang -sarif -o sarif-output meson compile -C build/
- name: find output directory
run: |
echo "SARIF_DIR=$(ls -d sarif-output/*)" >> ${GITHUB_ENV}
- name: define CONTAINER_WORKSPACE
run: |
echo "CONTAINER_WORKSPACE=${PWD}" >> ${GITHUB_ENV}
- name: upload SARIF results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ env.SARIF_DIR }}
checkout_path: ${{ env.CONTAINER_WORKSPACE }}
cppcheck:
runs-on: ubuntu-22.04
container: debian:bookworm
name: cppcheck
steps:
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y install meson make git python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps cppcheck
- uses: actions/checkout@v4
- name: 'workaround for Meson versions < 1.1'
run: ln -s meson.options meson_options.txt
- name: meson setup
run: meson setup -Dpdf-doc=false build
- name: meson compile
run: meson compile -C build/
- name: cppcheck
run: |
cppcheck --project=build/compile_commands.json -DAF_UNIX=1 --enable=warning,style,unusedFunction --xml 2>cppcheck.xml
- uses: airtower-luna/[email protected]
with:
tool: 'CppCheck'
input_file: 'cppcheck.xml'
sarif_file: 'cppcheck.sarif'
- name: define CONTAINER_WORKSPACE
run: |
echo "CONTAINER_WORKSPACE=${PWD}" >> ${GITHUB_ENV}
- name: upload SARIF results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'cppcheck.sarif'
checkout_path: ${{ env.CONTAINER_WORKSPACE }}
codeql:
runs-on: ubuntu-22.04
name: CodeQL
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get -y install meson make python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
- name: 'workarounds for ancient Meson (0.x)'
run: |
ln -s meson.options meson_options.txt
sed -i -e '/verbose: true,/d' test/meson.build
- name: meson setup
run: meson setup -Dpdf-doc=false build
- name: meson compile
run: meson compile -C build/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3