-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathTaskfile.yml
184 lines (163 loc) · 5.82 KB
/
Taskfile.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
version: 3
includes:
benchmark: ./taskfiles/Benchmark.yml
plot: ./taskfiles/Plot.yml
utils:
taskfile: ./taskfiles/Utils.yml
internal: true
vars:
VCPKG_ROOT: '{{.VCPKG_ROOT | default "./vcpkg"}}'
PROJECT_DIR:
sh: git rev-parse --show-toplevel
TARGET: '{{.TARGET | default "all"}}'
CMAKE_GENERATOR: '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}'
BUILD_TYPE: '{{.BUILD_TYPE | default "Release"}}'
tasks:
generate:
- task: build
- task: benchmark
- task: plot:all
generate:readme:
- task: utils:gen-readme-template
vars:
INPUT: "{{.PROJECT_DIR}}/README.md.mustache"
OUTPUT: "{{.PROJECT_DIR}}/README.md"
RESULTS: >
{{.PROJECT_DIR}}/reports/entities.RESULTS.md.json
{{.PROJECT_DIR}}/reports/extended.RESULTS.md.json
{{.PROJECT_DIR}}/reports/RESULTS.md.json
- "\\cp {{.PROJECT_DIR}}/reports/*.svg {{.PROJECT_DIR}}/img/."
configure:
dir: "{{.PROJECT_DIR}}"
cmds:
- >
cmake -S . -B build -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' -DCMAKE_BUILD_TYPE:STRING={{.CMAKE_BUILD_TYPE}} \
-DENABLE_TESTS:BOOL={{.FEATURE_TESTS | default "OFF"}} \
-DENABLE_FUZZ_TESTS:BOOL={{.FEATURE_FUZZ_TESTS | default "OFF"}} \
-DENABLE_CONSTEXPR_TESTS:BOOL={{.FEATURE_CONSTEXPR_TESTS | default "OFF"}} \
{{.CONFIGURE_FLAGS}}
build:
- task: configure
vars:
FEATURE_TESTS: OFF
CMAKE_BUILD_TYPE: Release
- task: build-template
vars:
CMAKE_BUILD_TYPE: Release
build:debug:
- task: configure
vars:
FEATURE_TESTS: OFF
CMAKE_BUILD_TYPE: Debug
- task: build-template
vars:
CMAKE_BUILD_TYPE: Debug
build:release:
- task: configure
vars:
FEATURE_TESTS: OFF
CMAKE_BUILD_TYPE: Release
CONFIGURE_FLAGS: -DENTITYX_BUILD_SHARED:BOOL=FALSE -DOPT_ENABLE_SANITIZER_ADDRESS:BOOL=OFF -DOPT_ENABLE_SANITIZER_MEMORY:BOOL=OFF -DOPT_ENABLE_SANITIZER_THREAD:BOOL=OFF -DOPT_ENABLE_SANITIZER_UNDEFINED:BOOL=OFF -DOPT_ENABLE_COVERAGE:BOOL=OFF
- task: build-template
vars:
CMAKE_BUILD_TYPE: Release
test:
- task: configure
vars:
FEATURE_TESTS: ON
CMAKE_BUILD_TYPE: Debug
- task: build-template
vars:
CMAKE_BUILD_TYPE: Debug
- task: test-template
vars:
CMAKE_BUILD_TYPE: Debug
test:relwithdebinfo:
- task: configure
vars:
FEATURE_TESTS: ON
CMAKE_BUILD_TYPE: RelWithDebInfo
- task: build-template
vars:
CMAKE_BUILD_TYPE: RelWithDebInfo
- task: test-template
vars:
CMAKE_BUILD_TYPE: RelWithDebInfo
test:release:
- task: configure
vars:
FEATURE_TESTS: ON
CMAKE_BUILD_TYPE: Release
- task: build-template
vars:
CMAKE_BUILD_TYPE: Release
- task: test-template
vars:
CMAKE_BUILD_TYPE: Release
test:without-sanitizer:
- task: configure
vars:
FEATURE_TESTS: ON
CMAKE_BUILD_TYPE: Debug
CONFIGURE_FLAGS: -DOPT_ENABLE_SANITIZER_ADDRESS:BOOL=OFF -DOPT_ENABLE_SANITIZER_MEMORY:BOOL=OFF -DOPT_ENABLE_SANITIZER_THREAD:BOOL=OFF -DOPT_ENABLE_SANITIZER_UNDEFINED:BOOL=OFF
- task: build-template
vars:
CMAKE_BUILD_TYPE: Debug
- task: test-template
vars:
CMAKE_BUILD_TYPE: Debug
test:relwithdebinfo:without-sanitizer:
- task: configure
vars:
FEATURE_TESTS: ON
CMAKE_BUILD_TYPE: RelWithDebInfo
CONFIGURE_FLAGS: -DOPT_ENABLE_SANITIZER_ADDRESS:BOOL=OFF -DOPT_ENABLE_SANITIZER_MEMORY:BOOL=OFF -DOPT_ENABLE_SANITIZER_THREAD:BOOL=OFF -DOPT_ENABLE_SANITIZER_UNDEFINED:BOOL=OFF
- task: build-template
vars:
CMAKE_BUILD_TYPE: RelWithDebInfo
- task: test-template
vars:
CMAKE_BUILD_TYPE: RelWithDebInfo
test:release:without-sanitizer:
- task: configure
vars:
FEATURE_TESTS: ON
CMAKE_BUILD_TYPE: Release
CONFIGURE_FLAGS: -DENTITYX_BUILD_SHARED:BOOL=FALSE -DOPT_ENABLE_SANITIZER_ADDRESS:BOOL=OFF -DOPT_ENABLE_SANITIZER_MEMORY:BOOL=OFF -DOPT_ENABLE_SANITIZER_THREAD:BOOL=OFF -DOPT_ENABLE_SANITIZER_UNDEFINED:BOOL=OFF
- task: build-template
vars:
CMAKE_BUILD_TYPE: Release
- task: test-template
vars:
CMAKE_BUILD_TYPE: Release
# The templates called in the other tasks. The variables can be set using the `vars` parameter or by environment variables. To create global variables that are passed to the internally called templates, use `env`
# This template accepts the generator, build type and feature flags defined by the vars. Other flags can be passed by `CONFIGURE_FLAGS` and `BUILD_FLAGS`. For example, a specific target can be built by setting BUILD_FLAGS to "--target <NAME>"
build-template:
dir: "{{.PROJECT_DIR}}"
internal: true
cmds:
- cmake --build build --config {{.CMAKE_BUILD_TYPE}} {{.BUILD_FLAGS}}
# Execute the app or the tests
test-template:
dir: "{{.PROJECT_DIR}}"
internal: true
cmds:
- ctest --build-test --test-dir build -C {{.CMAKE_BUILD_TYPE}}
format:
- cmake --build build --target fix-format
#- ~/vcpkg/vcpkg format-manifest ./vcpkg.json
lint:
- cmake --build build --target check-format
#- git ls-files --exclude-standard | grep -E '\.(cpp|hpp|c|cc|cxx|hxx|ixx)$' | xargs clang-format -i -style=file
#- git ls-files --exclude-standard | grep -E '(CMakeLists\.txt)|(\.(cmake))$' | xargs cmake-format --in-place | xargs cmake-lint --disabled-codes C0103 C0301 R0912 R0915 R0913 --suppress-decorations
#- npx -y cspell lint --no-progress --show-suggestions
clean:
- rm -rf ./build
default:
dir: "{{.PROJECT_DIR}}"
cmds:
- task: test
install:gen-benchmark-report:
dir: "{{.PROJECT_DIR}}/scripts/gen-benchmark-report"
cmds:
- pipx run poetry install