@@ -300,25 +300,53 @@ jobs:
300
300
if : inputs.tests_selector == 'cts'
301
301
env :
302
302
CMAKE_EXTRA_ARGS : ${{ inputs.extra_cmake_args }}
303
+ # Continue execution if some category fails to build.
304
+ shell : bash {0}
305
+ # Compile each binary individually; if a failure occurs during the
306
+ # 'test_all' build, the entire build will be affected.
303
307
run : |
304
308
cmake -GNinja -B./build-cts -S./khronos_sycl_cts -DCMAKE_CXX_COMPILER=$(which clang++) \
305
309
-DSYCL_IMPLEMENTATION=DPCPP \
306
310
-DSYCL_CTS_EXCLUDE_TEST_CATEGORIES="$PWD/devops/cts_exclude_filter" \
307
311
-DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF \
308
312
-DSYCL_CTS_MEASURE_BUILD_TIMES=ON \
309
- -DDPCPP_INSTALL_DIR="$$(dirname (which clang++))/.." \
310
- $CMAKE_EXTRA_ARGS
311
- ninja -C build-cts
313
+ -DDPCPP_INSTALL_DIR="$(dirname $(which clang++))/.." \
314
+ $CMAKE_EXTRA_ARGS | tee "cmake_output.txt"
315
+
316
+ # Get names of all added test-categories:
317
+ categories=$(grep -o '^-- Adding test: test_[a-zA-Z0-9_]*' "./cmake_output.txt" | sed 's/^-- Adding test: //')
318
+
319
+ number_of_test_categories=$(echo $categories | wc -w)
320
+ iteration=1
321
+ failed_to_build=""
322
+
323
+ for i in $categories; do
324
+ echo "::group::Building $i ($iteration of $number_of_test_categories)"
325
+ ninja -C build-cts $i
326
+ [ $? -ne 0 ] && failed_to_build+=$i'\n'
327
+ echo "::endgroup::"
328
+ ((iteration++))
329
+ done
330
+
331
+ if [ -n "$failed_to_build" ]; then
332
+ echo -e "Failed to build:\n$failed_to_build"
333
+ echo -e "Failed to build:\n$failed_to_build" >> $GITHUB_STEP_SUMMARY
334
+ exit 1
335
+ fi
336
+
337
+ exit 0
312
338
313
339
- name : SYCL CTS List devices
314
- if : inputs.tests_selector == 'cts'
340
+ # Proceed with execution even if the 'build' step did not succeed.
341
+ if : inputs.tests_selector == 'cts' && (success() || failure())
315
342
env :
316
343
ONEAPI_DEVICE_SELECTOR : ${{ inputs.target_devices }}
317
344
run : |
318
- ./build-cts/bin/test_all --list-devices
345
+ ./build-cts/bin/* --list-devices
319
346
320
347
- name : Run SYCL CTS tests
321
- if : inputs.tests_selector == 'cts'
348
+ # Proceed with execution even if the previous two steps did not succeed.
349
+ if : inputs.tests_selector == 'cts' && (success() || failure())
322
350
env :
323
351
ONEAPI_DEVICE_SELECTOR : ${{ inputs.target_devices }}
324
352
# This job takes ~100min usually. But sometimes some test isn't
@@ -331,33 +359,20 @@ jobs:
331
359
# the default behavior.
332
360
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#custom-shell
333
361
shell : bash {0}
334
- # FIXME: For some reason the "sub_group api" test-case is failing with
335
- # SIGSEGV while running test_all, so running each binary separately.
336
- # BTW test_all requires a lot of resources to build it, so probably it'll
337
- # be better to build each binary also separately.
338
- # run: |
339
- # ./build-cts/bin/test_all $CTS_TEST_ARGS
340
362
run : |
341
- status=""
342
363
failed_suites=""
364
+
343
365
for i in `ls -1 ./build-cts/bin`; do
344
- if [ "$i" != "test_all" ]; then
345
- echo "::group::Running $i"
346
- build-cts/bin/$i
347
- if [ $? -ne 0 ]; then
348
- status=1
349
- if [$failed_suites == ""]; then
350
- failed_suites=$i
351
- else
352
- failed_suites="$failed_suites, $i"
353
- fi
354
- fi
355
- echo "::endgroup::"
356
- fi
366
+ echo "::group::Running $i"
367
+ build-cts/bin/$i
368
+ [ $? -ne 0 ] && failed_suites+=$i'\n'
369
+ echo "::endgroup::"
357
370
done
358
- if [ -n "$status" ]; then
359
- echo "Failed suite(s): $failed_suites"
360
- echo "Failed suite(s): $failed_suites" >> $GITHUB_STEP_SUMMARY
371
+
372
+ if [ -n "$failed_suites" ]; then
373
+ echo -e "Failed suite(s): $failed_suites"
374
+ echo -e "Failed suite(s): $failed_suites" >> $GITHUB_STEP_SUMMARY
361
375
exit 1
362
376
fi
377
+
363
378
exit 0
0 commit comments