-
-
Notifications
You must be signed in to change notification settings - Fork 55
206 lines (166 loc) · 5.14 KB
/
checks.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
202
203
204
205
206
name: Checks
on:
push:
branches:
- master
- devel
pull_request:
jobs:
check-manpage:
runs-on: ubuntu-20.04
name: Check manpage
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get -y install libunwind-dev binutils-dev libiberty-dev help2man
- name: Compile Austin
run: |
autoreconf --install
./configure
make
- name: Generate manpage
run: bash doc/genman.sh
- name: Check manpage
run: git diff -I".* DO NOT MODIFY.*" -I"[.]TH AUSTIN.*" --exit-code src/austin.1
cppcheck-linux:
runs-on: ubuntu-20.04
name: Static code analysis (Linux)
env:
cppcheck-version: 2.10.3
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get -y install libpcre3-dev
- name: Restore cppcheck build
id: cppcheck-build-restore
uses: actions/cache/restore@v3
with:
path: |
${{ github.workspace }}/cppcheck
key: ${{ runner.os }}-cppcheck-${{ env.cppcheck-version }}
- name: Check out cppcheck
uses: actions/checkout@v2
with:
repository: danmar/cppcheck
ref: ${{ env.cppcheck-version }}
path: ${{ github.workspace }}/cppcheck
- name: Compile cppcheck
run: |
sudo apt-get update
sudo apt-get -y install libpcre3-dev
cd cppcheck
make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"
cd -
- name: Save cppcheck build
id: cppcheck-build-save
uses: actions/cache/save@v3
with:
path: |
${{ github.workspace }}/cppcheck
key: ${{ runner.os }}-cppcheck-${{ env.cppcheck-version }}
- name: Check source code
run: ${{ github.workspace }}/cppcheck/cppcheck -q -f --error-exitcode=1 --inline-suppr src
cppcheck-macos:
name: Static code analysis (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install cppcheck
run: brew install cppcheck
- name: Check source code
run: cppcheck -q -f --error-exitcode=1 --inline-suppr src
codespell:
runs-on: ubuntu-20.04
name: Codespell
steps:
- uses: actions/checkout@v2
- uses: "actions/setup-python@v2"
with:
python-version: "3.9"
- name: Install codespell
run: pip install codespell
- name: Check source code spelling
run: codespell -I .github/workflows/wordlist.txt -S "src/python/*" src
formatting-tests:
runs-on: ubuntu-20.04
name: Formatting (tests)
steps:
- uses: actions/checkout@v2
- uses: "actions/setup-python@v2"
with:
python-version: "3.10"
- name: Install black
run: pip install black
- name: Check formatting
run: black --check --exclude=test/targets test/
linting-tests:
runs-on: ubuntu-20.04
name: Linting (tests)
steps:
- uses: actions/checkout@v2
- uses: "actions/setup-python@v2"
with:
python-version: "3.10"
- name: Install flake8
run: pip install flake8
- name: Lint code
run: flake8 --config test/.flake8 test/
coverage:
runs-on: ubuntu-20.04
name: Code coverage
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get -y install libunwind-dev binutils-dev libiberty-dev gcovr
- name: Install test dependencies
run: |
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get -y install \
valgrind \
python2.7 \
python3.{5..11} \
python3.10-full python3.10-dev
- name: Compile Austin
run: |
autoreconf --install
./configure --enable-coverage
make
- name: Run tests
run: |
ulimit -c unlimited
python3.10 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r test/requirements.txt
.venv/bin/pytest --pastebin=failed -sr fE -n auto || true
sudo -E env PATH="$PATH" .venv/bin/pytest --pastebin=failed -sr fE -n auto || true
deactivate
- name: Generate Cobertura report
run: gcovr --xml ./cobertura.xml -r src/
- name: Upload report to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
verbose: true
check-cog:
runs-on: ubuntu-20.04
name: Check cog output
steps:
- uses: actions/checkout@v2
- name: Install cog
run: pip install cogapp
- name: Compile Austin
run: |
autoreconf --install
./configure
make
- name: Run cog check
run: bash scripts/cog.sh --check