Skip to content

Commit 471951d

Browse files
committed
ci: skip long tests to speed up CI
This adds an `is-bottleneck` matrix flag for the following configurations: - Any compiler with MSan - Apple Clang + ASan - Apple Clang + UBSan and, for these entries, skips the AsciiDoc/HTML golden tests and self-doc test while still running all the other tests. This reduces the wall-clock time of the overall CI run by removing the heaviest tests.
1 parent a5f160b commit 471951d

2 files changed

Lines changed: 26 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
mrdocs-ccflags: {{{ common-ccflags }}} {{{ mrdocs-flags }}}
9494
mrdocs-package-generators: {{#if (ieq os 'windows') }}7Z ZIP WIX{{else}}TGZ TXZ{{/if}}
9595
mrdocs-release-package-artifact: release-packages-{{{ lowercase os }}}
96+
is-bottleneck: {{#if (or msan (and (ieq compiler 'apple-clang') (or asan ubsan))) }}true{{/if}}
9697
output-file: matrix.json
9798
trace-commands: true
9899
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -599,6 +600,7 @@ jobs:
599600
install-prefix: .local
600601
extra-args: |
601602
-D MRDOCS_BUILD_DOCS=OFF
603+
-D MRDOCS_EXPENSIVE_TESTS=${{ matrix.is-bottleneck && 'OFF' || 'ON' }}
602604
-D CMAKE_EXE_LINKER_FLAGS="${{ steps.rmatrix.outputs.common-ldflags }}"
603605
-D LLVM_ROOT="${{ steps.rmatrix.outputs.llvm-path }}"
604606
-D jerryscript_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/jerryscript/install"

CMakeLists.txt

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ option(MRDOCS_PACKAGE "Build install package" ON)
3030
option(MRDOCS_BUILD_SHARED "Link shared" ${BUILD_SHARED_LIBS})
3131
option(MRDOCS_BUILD_TESTS "Build tests" ${BUILD_TESTING})
3232
option(MRDOCS_BUILD_STRICT_TESTS "Enable strict tests" ON)
33+
option(MRDOCS_EXPENSIVE_TESTS "Register expensive tests (adoc/html golden, self-doc)" ON)
3334
option(MRDOCS_REQUIRE_GIT "Git is required: not being able to extract version build is an error" ON)
3435
if (MRDOCS_BUILD_TESTS OR MRDOCS_INSTALL)
3536
option(MRDOCS_BUILD_DOCS "Build documentation" ON)
@@ -480,7 +481,8 @@ if (MRDOCS_BUILD_TESTS)
480481
target_compile_definitions(mrdocs-test PRIVATE -DMRDOCS_TEST_FILES_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test-files")
481482
add_test(NAME mrdocs-unit-tests COMMAND mrdocs-test --unit=true)
482483
foreach (testgenerator IN ITEMS xml adoc html)
483-
add_test(NAME mrdocs-golden-tests-${testgenerator}
484+
if (MRDOCS_EXPENSIVE_TESTS OR testgenerator STREQUAL "xml")
485+
add_test(NAME mrdocs-golden-tests-${testgenerator}
484486
COMMAND
485487
mrdocs-test
486488
--unit=false
@@ -492,6 +494,7 @@ if (MRDOCS_BUILD_TESTS)
492494
"--libc-includes=${CMAKE_SOURCE_DIR}/share/mrdocs/headers/libc-stubs"
493495
--log-level=warn
494496
)
497+
endif()
495498
foreach (action IN ITEMS test create update)
496499
add_custom_target(
497500
mrdocs-${action}-test-fixtures-${testgenerator}
@@ -519,28 +522,30 @@ if (MRDOCS_BUILD_TESTS)
519522
endforeach ()
520523

521524
#-------------------------------------------------
522-
# Self-documentation test (always run; warn-as-error toggled by strict flag)
525+
# Self-documentation test (warn-as-error toggled by strict flag)
523526
#-------------------------------------------------
524527
set(MRDOCS_SELF_DOC_OUTPUT "${CMAKE_BINARY_DIR}/docs/self-reference")
525528
set(MRDOCS_SELF_DOC_TAGFILE "${MRDOCS_SELF_DOC_OUTPUT}/reference.tag.xml")
526529

527-
add_test(NAME mrdocs-self-doc
528-
COMMAND
529-
mrdocs
530-
"${CMAKE_SOURCE_DIR}/CMakeLists.txt"
531-
"--config=${CMAKE_SOURCE_DIR}/docs/mrdocs.yml"
532-
"--output=${MRDOCS_SELF_DOC_OUTPUT}"
533-
--generator=adoc
534-
"--addons=${CMAKE_SOURCE_DIR}/share/mrdocs/addons"
535-
"--stdlib-includes=${LIBCXX_DIR}"
536-
"--stdlib-includes=${STDLIB_INCLUDE_DIR}"
537-
"--libc-includes=${CMAKE_SOURCE_DIR}/share/mrdocs/headers/libc-stubs"
538-
"--tagfile=${MRDOCS_SELF_DOC_TAGFILE}"
539-
--multipage=true
540-
--concurrency=16
541-
--log-level=debug
542-
$<$<BOOL:${MRDOCS_BUILD_STRICT_TESTS}>:--warn-as-error=true>
543-
)
530+
if (MRDOCS_EXPENSIVE_TESTS)
531+
add_test(NAME mrdocs-self-doc
532+
COMMAND
533+
mrdocs
534+
"${CMAKE_SOURCE_DIR}/CMakeLists.txt"
535+
"--config=${CMAKE_SOURCE_DIR}/docs/mrdocs.yml"
536+
"--output=${MRDOCS_SELF_DOC_OUTPUT}"
537+
--generator=adoc
538+
"--addons=${CMAKE_SOURCE_DIR}/share/mrdocs/addons"
539+
"--stdlib-includes=${LIBCXX_DIR}"
540+
"--stdlib-includes=${STDLIB_INCLUDE_DIR}"
541+
"--libc-includes=${CMAKE_SOURCE_DIR}/share/mrdocs/headers/libc-stubs"
542+
"--tagfile=${MRDOCS_SELF_DOC_TAGFILE}"
543+
--multipage=true
544+
--concurrency=16
545+
--log-level=debug
546+
$<$<BOOL:${MRDOCS_BUILD_STRICT_TESTS}>:--warn-as-error=true>
547+
)
548+
endif()
544549

545550
#-------------------------------------------------
546551
# XML lint

0 commit comments

Comments
 (0)