Repository navigation
365 lines (297 loc) · 12.6 KB
/
Copy pathci.yml
File metadata and controls
365 lines (297 loc) · 12.6 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
name: CI
on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master, feature/* ]
jobs:
cmake-build:
name: 'CMAKE: Build for x86_64'
runs-on: ubuntu-latest
container:
image: chocotechnologies/dmod:1.0.4
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clean build directory
run: rm -rf build
- name: Create build directory
run: mkdir -p build
- name: Configure CMake for MODULE mode
working-directory: build
run: cmake .. -DDMOD_MODE=DMOD_MODULE -DDMOD_TOOLS_NAME=arch/x86_64
- name: Build MODULE mode
working-directory: build
run: cmake --build .
- name: Configure CMake for SYSTEM mode
working-directory: build
run: cmake .. -DDMOD_MODE=DMOD_SYSTEM -DDMOD_TOOLS_NAME=arch/x86_64
- name: Build SYSTEM mode
working-directory: build
run: cmake --build .
- name: Test loader with example_app.dmf
working-directory: build
run: ./examples/system/dmod_loader/dmod_loader ./dmf/example_app.dmf
- name: Test loader with MyApplication.dmf
working-directory: build
run: ./examples/system/dmod_loader/dmod_loader ./dmf/MyApplication.dmf
- name: Test loader with module name (example_app)
working-directory: build
run: ./examples/system/dmod_loader/dmod_loader example_app
- name: Test loader with module name (MyApplication)
working-directory: build
run: ./examples/system/dmod_loader/dmod_loader MyApplication
- name: Test loader with non-existent module name
working-directory: build
run: |
if ./examples/system/dmod_loader/dmod_loader nonexistent_module 2>&1 | grep -q "Cannot find module file for module name"; then
echo "Correctly failed to load non-existent module"
else
echo "Expected error message not found"
exit 1
fi
- name: Test DIF functionality
working-directory: build
run: |
./examples/system/dif_test/dif_test
./examples/system/dif_test/test_direct_access
- name: Test DMOD_LOG_STEP_* macros via log_step module
working-directory: build
run: |
./examples/system/dmod_loader/dmod_loader ./dmf/log_step.dmf
echo "log_step module loaded and executed successfully"
- name: Run example dmod_add_test module
working-directory: build
run: |
./examples/system/dmod_loader/dmod_loader ./dmf/test_example.dmf
echo "test_example module passed all test steps"
- name: Run manifest library tests
working-directory: build
run: ./tests/tests_dmod_manifest
- name: Run dmf-get integration tests
working-directory: tests/integration
run: bash test_dmf_get.sh ../../build
- name: Run todmd integration tests
working-directory: tests/integration
run: bash test_todmd.sh ../../build
- name: Run whereisdmf integration tests
working-directory: tests/integration
run: bash test_whereisdmf.sh ../../build
- name: Test dmod_link_modules with dmini
run: |
mkdir -p .github/test_dmod_link_modules/build
cd .github/test_dmod_link_modules/build
cmake .. -DDMOD_MODE=DMOD_MODULE
cmake --build .
echo "dmod_link_modules test completed successfully"
- name: Verify dmini headers were downloaded
run: |
if [ -d ".github/test_dmod_link_modules/build/dmf/inc/dmini/include" ]; then
echo "SUCCESS: dmini headers downloaded to build/dmf/inc/dmini/include"
ls -la .github/test_dmod_link_modules/build/dmf/inc/dmini/include/
else
echo "ERROR: dmini headers not found at expected location"
echo "Searching for dmini directories..."
find .github/test_dmod_link_modules/build -name "dmini" -type d || true
exit 1
fi
- name: Test loading module built with dmod_link_modules
run: |
./build/examples/system/dmod_loader/dmod_loader .github/test_dmod_link_modules/build/dmf/test_link.dmf
echo "Module with linked dependencies loaded successfully"
- name: Run coverage check
working-directory: build
run: cmake --build . --target coverage_check
continue-on-error: true
- name: Build compressed DMF
working-directory: build
run: |
echo "Building compressed DMF"
cmake .. -DDMOD_MODE=DMOD_MODULE -DDMOD_TOOLS_NAME=arch/x86_64
cmake --build .
- name: Test loader with compressed example_app.dmfc
working-directory: build
run: ./examples/system/dmod_loader/dmod_loader ./dmfc/example_app.dmfc
- name: Test loader with compressed DMF after removing dmf directory
working-directory: build
run: |
rm -rf dmf
./examples/system/dmod_loader/dmod_loader ./dmfc/example_app.dmfc
- name: Create DMP package from DMF files
working-directory: build
run: |
# Rebuild DMF files (remove artifacts to force rebuild after dmf was deleted)
rm -rf examples/module examples/dif templates/module/output
cmake .. -DDMOD_MODE=DMOD_MODULE -DDMOD_TOOLS_NAME=arch/x86_64
cmake --build .
# Create DMP package with vfs as main module
./bin/tools/todmp test_package ./dmf ./test_package.dmp vfs
echo "DMP package created successfully"
- name: List DMP package contents
working-directory: build
run: |
./bin/tools/todmp -l ./test_package.dmp
echo "DMP package listing completed"
- name: Test loading DMP package
working-directory: build
run: |
./examples/system/dmod_loader/dmod_loader ./test_package.dmp
echo "DMP package loaded and executed successfully"
- name: Create DMP package without main module
working-directory: build
run: |
./bin/tools/todmp libs_package ./dmf ./libs_package.dmp
echo "DMP package without main module created successfully"
- name: Test todmp help and version
working-directory: build
run: |
./bin/tools/todmp --help
./bin/tools/todmp --version
make-build:
name: 'MAKE: Build for x86_64'
runs-on: ubuntu-latest
container:
image: chocotechnologies/dmod:1.0.4
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clean build directory
run: rm -rf build
- name: Build MODULE mode with Make
run: make DMOD_MODE=DMOD_MODULE
- name: Build SYSTEM mode with Make
run: make DMOD_MODE=DMOD_SYSTEM
- name: Test loader with example_app.dmf
run: chmod +x ./build/examples/system/dmod_loader && ./build/examples/system/dmod_loader build/dmf/example_app.dmf
- name: Test loader with module name (example_app)
run: ./build/examples/system/dmod_loader example_app
- name: Test loader with non-existent module name
run: |
if ./build/examples/system/dmod_loader nonexistent_module 2>&1 | grep -q "Cannot find module file for module name"; then
echo "Correctly failed to load non-existent module"
else
echo "Expected error message not found"
exit 1
fi
- name: Build compressed modules with Make
run: make DMOD_MODE=DMOD_MODULE
- name: Test loader with compressed example_app.dmfc
run: ./build/examples/system/dmod_loader build/dmfc/example_app.dmfc
- name: Test loader with compressed DMF after removing dmf directory
run: |
rm -rf build/dmf
./build/examples/system/dmod_loader build/dmfc/example_app.dmfc
- name: DIF test
run: |
chmod +x ./build/examples/dif_test/dif_test
./build/examples/dif_test/dif_test
- name: Create DMP package from DMF files
run: |
# Rebuild DMF files (remove artifacts to force rebuild)
rm -rf build/examples/module build/examples/dif build/templates/module/output
make DMOD_MODE=DMOD_MODULE
# Create DMP package with vfs as main module
./build/bin/tools/todmp test_package ./build/dmf ./build/test_package.dmp vfs
echo "DMP package created successfully"
- name: List DMP package contents
run: |
./build/bin/tools/todmp -l ./build/test_package.dmp
echo "DMP package listing completed"
- name: Test loading DMP package
run: |
./build/examples/system/dmod_loader ./build/test_package.dmp
echo "DMP package loaded and executed successfully"
- name: Create DMP package without main module
run: |
./build/bin/tools/todmp libs_package ./build/dmf ./build/libs_package.dmp
echo "DMP package without main module created successfully"
- name: Test todmp help and version
run: |
./build/bin/tools/todmp --help
./build/bin/tools/todmp --version
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dmod-build-artifacts
path: |
./build/examples/system/dmod_loader
./build/examples/dif_test/dif_test
./build/dmf/example_app.dmf
./build/dmf/dmodex.dmf
./build/test_package.dmp
./build/libs_package.dmp
external-module-cmake:
name: 'CMAKE: Test external module build'
runs-on: ubuntu-latest
container:
image: chocotechnologies/dmod:1.0.4
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build dmod in MODULE mode
run: |
mkdir -p build
cd build
cmake .. -DDMOD_MODE=DMOD_MODULE -DDMOD_TOOLS_NAME=arch/x86_64
cmake --build .
- name: Build dmod in SYSTEM mode for loader
run: |
cd build
cmake .. -DDMOD_MODE=DMOD_SYSTEM -DDMOD_TOOLS_NAME=arch/x86_64
cmake --build . --target dmod_loader
- name: Create external module directory
run: |
./scripts/new-module.sh \
--name external_test \
--type application \
--path /tmp/external_test_module \
--dmod-dir "${GITHUB_WORKSPACE}" \
--author "CI Test"
- name: Build external module with CMake
run: |
cd /tmp/external_test_module
mkdir -p build
cd build
cmake ..
cmake --build .
- name: Verify external module DMF was created
run: |
test -f /tmp/external_test_module/build/dmf/external_test.dmf
echo "External module DMF created successfully"
- name: Test external module with dmod_loader
run: |
cd /tmp/external_test_module/build
${GITHUB_WORKSPACE}/build/examples/system/dmod_loader/dmod_loader ./dmf/external_test.dmf
external-module-make:
name: 'MAKE: Test external module build'
runs-on: ubuntu-latest
container:
image: chocotechnologies/dmod:1.0.4
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build dmod with Make in MODULE mode
run: make DMOD_MODE=DMOD_MODULE
- name: Build dmod with Make in SYSTEM mode for loader
run: make DMOD_MODE=DMOD_SYSTEM
- name: Rebuild dmod in MODULE mode before external module
run: make DMOD_MODE=DMOD_MODULE
- name: Create external module directory
run: |
./scripts/new-module.sh \
--name external_test_make \
--type application \
--path /tmp/external_test_module_make \
--dmod-dir "${GITHUB_WORKSPACE}" \
--author "CI Test"
- name: Build external module with Make
run: |
cd /tmp/external_test_module_make
make
- name: Verify external module DMF was created
run: |
test -f ${GITHUB_WORKSPACE}/build/dmf/external_test_make.dmf
echo "External module DMF created successfully with Make"
- name: Test external module with dmod_loader
run: |
${GITHUB_WORKSPACE}/build/examples/system/dmod_loader ${GITHUB_WORKSPACE}/build/dmf/external_test_make.dmf