forked from dosbox-staging/dosbox-staging
-
Notifications
You must be signed in to change notification settings - Fork 4
201 lines (173 loc) · 6.48 KB
/
analysis.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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Code analysis
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CCACHE_DIR: "/dev/shm/.ccache"
CCACHE_MAXSIZE: "64M"
CCACHE_COMPRESS: "true"
jobs:
run_linters:
name: Script linters
runs-on: ubuntu-20.04
if: github.event_name != 'pull_request' || contains('dreamer,kcgen,ant-222,Wengier', github.actor) == false
steps:
- name: Checkout repository
uses: actions/checkout@v2
- run: sudo apt-get update
- name: Run shellcheck
run: ./scripts/verify-bash.sh
- name: Install pylint
run: |
sudo apt-get install python3-setuptools
sudo pip3 install pylint beautifulsoup4 html5lib jsonpickle
- name: Run pylint
run: ./scripts/verify-python.sh
- name: Install markdownlint
run: |
sudo apt-get install ruby-full
ruby --version
sudo gem install mdl
- name: Run markdownlint
run: ./scripts/verify-markdown.sh
- name: Install appstream-util
run: sudo apt-get install appstream-util
- name: Verify metainfo.xml
run: appstream-util validate-relax --nonet contrib/linux/dosbox-staging.metainfo.xml
build_clang_static_analyser:
name: Clang static analyzer
runs-on: ubuntu-20.04
needs: run_linters
steps:
- name: Checkout repository
uses: actions/checkout@v2
- run: sudo apt-get update
- name: Install dependencies
run: |
sudo apt-get install clang-tools python3-bs4 $(cat .github/packages/ubuntu-20.04-apt.txt)
sudo pip3 install --upgrade meson ninja
- name: Prepare compiler cache
id: prep-ccache
shell: bash
run: |
mkdir -p "${CCACHE_DIR}"
echo "::set-output name=dir::$CCACHE_DIR"
echo "::set-output name=today::$(date -I)"
echo "::set-output name=yesterday::$(date --date=yesterday -I)"
- uses: actions/cache@v2
id: cache-ccache
with:
path: ${{ steps.prep-ccache.outputs.dir }}
key: ccache-static-clang-${{ steps.prep-ccache.outputs.today }}
restore-keys: |
ccache-static-clang-${{ steps.prep-ccache.outputs.yesterday }}
- name: Cache subprojects
uses: actions/cache@v2
with:
path: subprojects/packagecache
key: subprojects-${{ hashFiles('subprojects/*.wrap') }}
- name: Log environment
run: ./scripts/log-env.sh
- run: meson setup -Dunit_tests=disabled build
- name: Build and run scan-build
run: |
set -x
ninja -C build scan-build
mv build/meson-logs/scanbuild report
- name: Upload report
uses: actions/upload-artifact@v2
with:
name: clang-analysis-report
path: report
- name: Summarize report
env:
MAX_BUGS: 27
run: |
# summary
echo "Full report is included in build Artifacts"
echo
./scripts/count-clang-bugs.py report/*/index.html
dynamic_matrix:
name: ${{ matrix.conf.name }}
needs: run_linters
runs-on: ubuntu-20.04
strategy:
matrix:
conf:
# AddressSanitizer is a fast memory error detector. Memory access
# instructions are instrumented to detect out-of-bounds and
# use-after-free bugs.
# See GCC manual to learn more.
- name: GCC address sanitizer
build_flags: -Db_sanitize=address
logs: gcc-asan-logs
max_issues: 0
# UndefinedBehaviorSanitizer is a fast undefined behavior detector.
# Various computations are instrumented to detect undefined behavior
# at runtime, such as shift operation correctness, integer division by
# zero, null-pointer dereference, signed integer overflow,
# dereferencing memory with wrong alignment, and more.
# See GCC manual to learn more.
- name: GCC undefined sanitizer
build_flags: -Db_sanitize=undefined
logs: gcc-usan-logs
max_issues: 0
# Clang allows enabling both AddressSanitizer and
# UndefinedBehaviorSanitizer at the same time.
# See Clang manual to learn more.
- name: Clang undefined+address sanitizer
build_flags: >-
--native-file=.github/meson/native-clang.ini
-Db_sanitize=address,undefined
-Dc_args=-fsanitize-recover=all
-Dcpp_args=-fsanitize-recover=all
-Db_asneeded=true
-Db_lundef=false
-Ddefault_library=static
--wrap-mode=forcefallback
-Dfluidsynth:try-static-deps=true
logs: clang-uasan-logs
max_issues: 4
steps:
- name: Checkout repository
uses: actions/checkout@v2
- run: sudo apt-get update
- name: Install dependencies
run: |
sudo apt-get install $(cat .github/packages/ubuntu-20.04-apt.txt)
sudo pip3 install --upgrade meson ninja
- name: Prepare compiler cache
id: prep-ccache
shell: bash
run: |
mkdir -p "${CCACHE_DIR}"
echo "::set-output name=dir::$CCACHE_DIR"
echo "::set-output name=today::$(date -I)"
echo "::set-output name=yesterday::$(date --date=yesterday -I)"
- uses: actions/cache@v2
id: cache-ccache
with:
path: ${{ steps.prep-ccache.outputs.dir }}
key: ccache-sanitizers-${{ steps.prep-ccache.outputs.today }}
restore-keys: ccache-sanitizers-${{ steps.prep-ccache.outputs.yesterday }}
- name: Cache subprojects
uses: actions/cache@v2
with:
path: subprojects/packagecache
key: subprojects-${{ hashFiles('subprojects/*.wrap') }}
- name: Log environment
run: ./scripts/log-env.sh
- run: meson setup -Dunit_tests=disabled ${{ matrix.conf.build_flags }} build
- run: ninja -C build
- name: Run sanitizer test cases
run: ./.github/scripts/run-sanitizers.sh build sanitizer-logs
- name: Upload logs
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.conf.logs }}
path: sanitizer-logs
- name: Summarize issues
run: >
xzcat sanitizer-logs/EnterExit.log.xz |
MAX_ISSUES=${{ matrix.conf.max_issues }} ./scripts/count-xsan-issues.py -