This repository was archived by the owner on Jan 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
227 lines (198 loc) · 5.62 KB
/
Taskfile.yaml
File metadata and controls
227 lines (198 loc) · 5.62 KB
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
version: 3
vars:
PER_YEAR: 1
GH_ORG: "nim-works"
TARGET: nimskull
BRANCH: devel
TMPD: /tmp
DB_FILE: /tmp/db.sqlite
PNG_FILE: /tmp/db.png
SCRIPT_OPTS: /tmp/db.sqlite /tmp/db.png --config=scripts/config.cfg
BIN: ./build/bin/code_forensics
ROOT: |
{{env "PWD"}}
REL_CONAN: "build/dependencies/conan"
CONAN_DIR: |
{{env "PWD"}}/build/dependencies/conan
GDB_CMD: gdb
-batch
-nx
-ex "source {{env "PWD"}}/gdb_decorator.py"
-ex "set print address off"
-ex "set print frame-arguments none"
-ex "set print frame-info source-and-location"
-ex "set filename-display basename"
-ex "run"
-ex "bt"
--args
IMAGE: code_forensics_arch
CONTAINER: code_forensics_run
tasks:
arch_docker_image:
desc: "Build a docker test image or re-build if one already exists"
vars:
IMAGE: code_forensics_arch
cmds:
- docker image rm {{.IMAGE}} || true
- docker image build -t {{.IMAGE}} .
arch_interactive_copy:
desc: "Run an interactive session with repository copied to the container"
cmds:
- docker rm -f {{.CONTAINER}} || true
- docker container create -it --name {{.CONTAINER}} {{.IMAGE}}
- docker cp {{.PWD}} {{.CONTAINER}}:/tmp/
- docker start --attach --interactive {{.CONTAINER}}
arch_interactive_pass:
desc: "Run an interactive section with repository passed directly to the container."
cmds:
- docker rm -f {{.CONTAINER}} || true
- >
docker
container
create
-v={{.PWD}}:/tmp/code_forensics
-it
--name {{.CONTAINER}}
{{.IMAGE}}
- docker start --attach --interactive {{.CONTAINER}}
arch_interactive_copy_gh:
desc: "Run an interactive session with code_forensics packaged image"
cmds:
- task: arch_interactive_copy
vars:
IMAGE: ghcr.io/haxscramper/code_forensics:master
ensure_deps:
desc: "Ensure test directory exists"
status:
- test -e /tmp/{{.TARGET}}
cmds:
- git clone https://github.com/{{.GH_ORG}}/{{.TARGET}}.git /tmp/{{.TARGET}}
ensure_test_db:
desc: "Ensure test database exists"
deps: [ensure_deps]
status:
- test -s {{.DB_FILE}}
cmds:
- task: debug_run
burndown:
deps: [ensure_test_db]
desc: Build sampled burndown plot
cmds:
- "./scripts/table_per_period.py {{.DB_FILE}} {{.PNG_FILE}} --per-year={{.PER_YEAR}}"
ridgeline:
deps: [ensure_test_db]
desc: "Build top commiter activity ridgeline"
cmds:
- ./scripts/author_ridgeline.py {{.SCRIPT_OPTS}} --top=10
authorship:
deps: [ensure_test_db]
desc: "Burndown chart for the code ownership"
cmds:
- ./scripts/code_authorship.py {{.SCRIPT_OPTS}}
hotspot_connections:
deps: [ensure_test_db]
desc: "Generate connectivity graph for the most edited files"
cmds:
- >
./scripts/hotspot_connections.py
{{.DB_FILE}}
/tmp/db.png
--top=120
--config=scripts/config.cfg
--mode=overwrite
--ordering-mode=connections
top_comitter:
deps: [ensure_test_db]
desc: "Generate top comitters for the code"
cmds:
- ./scripts/top_comitters.py {{.SCRIPT_OPTS}}
line_category:
deps: [ensure_test_db]
desc: "Line category breakdown"
cmds:
- ./scripts/line_category.py --subdir-breakdown={{.PER_DIR}} {{.SCRIPT_OPTS}}
vars:
PER_DIR: False
message_length:
deps: [ensure_test_db]
desc: "Generate stats for the commit message lenght"
cmds:
- ./scripts/commit_message_length.py {{.SCRIPT_OPTS}}
all_stats:
deps: [ensure_test_db]
desc: "Execute all statistics scripts in sequence"
cmds:
- >
./scripts/all_stats.py
{{.DB_FILE}}
{{.TMPD}}
--config={{.PWD}}/scripts/all_config.yaml
--subconfig={{.PWD}}/scripts/config.cfg
compare:
cmds:
- ./tests/ci_compare_repo.sh
build_binary:
dir: build
deps: [conan_install]
desc: "Build build the binary file"
cmds:
# - >
# cmake --build .. --target clean
- >
cmake
..
--trace
--trace-expand
--trace-redirect=/tmp/cmake-trace.txt
# --trace-source=CMakeLists.txt
# --trace-source=external/hcxx_common/CMakeLists.txt
# --trace-expand
- make -j12
conan_install:
cmds:
- conan install . -if {{.REL_CONAN}} --build=missing --settings compiler.libcxx="libstdc++11"
status:
- test -e {{.CONAN_DIR}}
perf_run:
deps: [build_binary]
cmds:
- "perf record {{.BIN}} {{.OPTS}}"
vars:
OPTS: /tmp/{{.TARGET}}
--branch={{.BRANCH}}
--filter-script=scripts/code_filter.py
debug_run:
deps: [build_binary]
cmds:
- "{{.BIN}} --help || gdb_cmd {{.BIN}} --help"
# - "{{.BIN}} {{.OPTS}}"
- rm -f {{.DB_FILE}}
- "{{.BIN}} {{.OPTS}} || {{.GDB_CMD}} {{.BIN}} {{.OPTS}}"
- rm -f /tmp/temp_db.sqlite
- cp {{.DB_FILE}} /tmp/temp_db.sqlite
vars:
OPTS: /tmp/{{.TARGET}}
--branch={{.BRANCH}}
--outfile={{.DB_FILE}}
--filter-script=scripts/code_filter.py
--filter-args=--per-year={{.PER_YEAR}}
--filter-args=--target={{.TARGET}}
build_git_wrapper:
cmd: clang++ generate_git_wrapper/genwrapper.cpp
-std=c++2a
-ferror-limit=1
-o genwrapper.bin
-fuse-ld=mold
-g
-lclang-cpp
-lLLVM
@{{.CONAN_DIR}}/conanbuildinfo.gcc
docs:
cmd: doxygen -q Doxyfile
wrap_git:
deps: [build_git_wrapper]
default:
# deps: [compare]
# deps: [authorship, burndown]
# deps: [burndown]
deps: [debug_run]