From 32bd33c1bad7d6e164e62ff926359a3cad260ae8 Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Sat, 26 Dec 2020 18:06:31 -0800 Subject: [PATCH 1/7] Single target testing Enable building and testing via a single target (check) - require chakracore library to be built before the test run. --- azure-pipelines.yml | 1 - test/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 26925290ddc..e73a321ab0b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,5 @@ jobs: - script: | cd build - ninja ninja check displayName: 'Build and test' diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 932e8fc5bef..e11a4d0084e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,6 @@ add_custom_target(check COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/runtests.py ${TEST_BUILD_TYPE} ${TEST_EXCLUDE} --binary ${CMAKE_BINARY_DIR}/ch --logfile ${CMAKE_BINARY_DIR}/check.log WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} USES_TERMINAL - DEPENDS ch + DEPENDS ch ChakraCore ) From bd644ba2bd2002c3c7bb36e73e203e09c4418de4 Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Sat, 26 Dec 2020 20:15:24 -0800 Subject: [PATCH 2/7] [CI] Enable Linux release builds Manipulate build target: run tests for debug builds and simply build for release. --- azure-pipelines.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e73a321ab0b..fb2928045f5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,8 +11,13 @@ jobs: matrix: debug: build_type: 'Debug' + test_target: 'check' release_with_debug: build_type: 'RelWithDebInfo' + test_target: 'check' + release: + build_type: 'Release' + test_target: 'all' steps: - script: sudo apt-get install -y ninja-build clang libicu-dev @@ -31,5 +36,7 @@ jobs: - script: | cd build - ninja check + ninja $TARGET displayName: 'Build and test' + env: + TARGET: $(test_target) From 51a1134b03703a04ab71253d00e045b8e6904a87 Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Sat, 26 Dec 2020 22:21:40 -0800 Subject: [PATCH 3/7] Add OSX CI Expand CI matrix to include OSX. --- azure-pipelines.yml | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fb2928045f5..742db6e8831 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,24 +3,47 @@ trigger: - release/* jobs: - - job: Linux + - job: CMake timeoutInMinutes: 0 - pool: - vmImage: 'ubuntu-latest' strategy: matrix: - debug: + Linux.Debug: + image_name: 'ubuntu-latest' + deps: 'sudo apt-get install -y ninja-build clang libicu-dev' build_type: 'Debug' test_target: 'check' - release_with_debug: + Linux.ReleaseWithDebug: + image_name: 'ubuntu-latest' + deps: 'sudo apt-get install -y ninja-build clang libicu-dev' build_type: 'RelWithDebInfo' test_target: 'check' - release: + Linux.Release: + image_name: 'ubuntu-latest' + deps: 'sudo apt-get install -y ninja-build clang libicu-dev' + build_type: 'Release' + test_target: 'all' + matrix: + OSX.Debug: + image_name: 'macOS-latest' + deps: 'brew install ninja icu4c' + build_type: 'Debug' + test_target: 'check' + OSX.ReleaseWithDebug: + image_name: 'macOS-latest' + deps: 'brew install ninja icu4c' + build_type: 'RelWithDebInfo' + test_target: 'check' + OSX.Release: + image_name: 'macOS-latest' + deps: 'brew install ninja icu4c' build_type: 'Release' test_target: 'all' + pool: + vmImage: $(image_name) + steps: - - script: sudo apt-get install -y ninja-build clang libicu-dev + - script: $(deps) displayName: 'Install dependencies' - script: | From fb5ab5ebcbcfe414eed1e809eec5ff918ec64633 Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Sat, 26 Dec 2020 22:23:06 -0800 Subject: [PATCH 4/7] Typo - duplicate yaml tag --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 742db6e8831..1ec247703d8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,7 +22,6 @@ jobs: deps: 'sudo apt-get install -y ninja-build clang libicu-dev' build_type: 'Release' test_target: 'all' - matrix: OSX.Debug: image_name: 'macOS-latest' deps: 'brew install ninja icu4c' From bfc59bd7be0a47746d0b605196ee007e7512c35f Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Sun, 27 Dec 2020 17:37:13 -0800 Subject: [PATCH 5/7] Timeout and OSX debug library type Prevent tests from failing on OSX debug builds, by setting timeouts and forcing static library build. Shared library issue is described in #5876. --- CMakeLists.txt | 39 ++++++++++++++++++++------------------- azure-pipelines.yml | 11 +++++++++-- test/CMakeLists.txt | 6 +++++- 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53a08a0759b..428f6d63979 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,31 +10,32 @@ if(NOT CHAKRACORE_BUILD_SH) option(INTL_ICU "Enable Intl" ON) option(EMBED_ICU "Build ICU within ChakraCore build" OFF) set(ICU_INCLUDE_PATH "" CACHE STRING "libicu iclude path") -endif(NOT CHAKRACORE_BUILD_SH) +else(NOT CHAKRACORE_BUILD_SH) -# Keep CMake from caching static/shared library -# option. Otherwise, CMake fails to update cached -# references + # Keep CMake from caching static/shared library + # option. Otherwise, CMake fails to update cached + # references -# todo: create a sub cmake file to take care of _SH uncaching... -if(SHARED_LIBRARY_SH) + # todo: create a sub cmake file to take care of _SH uncaching... + if(SHARED_LIBRARY_SH) unset(SHARED_LIBRARY_SH CACHE) unset(STATIC_LIBRARY_SH CACHE) - unset(STATIC_LIBRARY CACHE) - set(SHARED_LIBRARY 1) -endif() + unset(STATIC_LIBRARY CACHE) + set(SHARED_LIBRARY 1) + endif() -if(STATIC_LIBRARY_SH) - unset(SHARED_LIBRARY_SH CACHE) - unset(STATIC_LIBRARY_SH CACHE) - unset(SHARED_LIBRARY CACHE) - set(STATIC_LIBRARY 1) -endif() + if(STATIC_LIBRARY_SH) + unset(SHARED_LIBRARY_SH CACHE) + unset(STATIC_LIBRARY_SH CACHE) + unset(SHARED_LIBRARY CACHE) + set(STATIC_LIBRARY 1) + endif() -if(LIBS_ONLY_BUILD_SH) - unset(LIBS_ONLY_BUILD_SH CACHE) - set(CC_LIBS_ONLY_BUILD 1) -endif() + if(LIBS_ONLY_BUILD_SH) + unset(LIBS_ONLY_BUILD_SH CACHE) + set(CC_LIBS_ONLY_BUILD 1) + endif() +endif(NOT CHAKRACORE_BUILD_SH) if(CC_USES_SYSTEM_ARCH_SH OR NOT CHAKRACORE_BUILD_SH) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1ec247703d8..a62780b21c7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ trigger: jobs: - job: CMake - timeoutInMinutes: 0 + timeoutInMinutes: 120 strategy: matrix: Linux.Debug: @@ -12,31 +12,37 @@ jobs: deps: 'sudo apt-get install -y ninja-build clang libicu-dev' build_type: 'Debug' test_target: 'check' + libtype_flag: '' Linux.ReleaseWithDebug: image_name: 'ubuntu-latest' deps: 'sudo apt-get install -y ninja-build clang libicu-dev' build_type: 'RelWithDebInfo' test_target: 'check' + libtype_flag: '' Linux.Release: image_name: 'ubuntu-latest' deps: 'sudo apt-get install -y ninja-build clang libicu-dev' build_type: 'Release' test_target: 'all' + libtype_flag: '' OSX.Debug: image_name: 'macOS-latest' deps: 'brew install ninja icu4c' build_type: 'Debug' test_target: 'check' + libtype_flag: '-DSTATIC_LIBRARY=ON' OSX.ReleaseWithDebug: image_name: 'macOS-latest' deps: 'brew install ninja icu4c' build_type: 'RelWithDebInfo' test_target: 'check' + libtype_flag: '' OSX.Release: image_name: 'macOS-latest' deps: 'brew install ninja icu4c' build_type: 'Release' test_target: 'all' + libtype_flag: '' pool: vmImage: $(image_name) @@ -51,10 +57,11 @@ jobs: - script: | cd build - cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. + cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $(LIBTYPE) -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. displayName: CMake env: BUILD_TYPE: $(build_type) + LIBTYPE: $(libtype_flag) - script: | cd build diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e11a4d0084e..05aba09b1eb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,10 @@ add_custom_target(check COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/runtests.py ${TEST_BUILD_TYPE} ${TEST_EXCLUDE} --binary ${CMAKE_BINARY_DIR}/ch --logfile ${CMAKE_BINARY_DIR}/check.log WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} USES_TERMINAL - DEPENDS ch ChakraCore + DEPENDS ch ) +if (NOT STATIC_LIBRARY) + add_dependencies(check ChakraCore) +endif() + From f10d36eb626fdb59917eaccbf5d9d95405e41389 Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Sun, 27 Dec 2020 18:28:27 -0800 Subject: [PATCH 6/7] CI debug: library flag --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a62780b21c7..cff34f804dc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -57,6 +57,7 @@ jobs: - script: | cd build + echo Library flag $(LIBTYPE) cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $(LIBTYPE) -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. displayName: CMake env: From fe95b4a0e04bc5a6c55e8c6f74e5dd9df07b4a80 Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Sun, 27 Dec 2020 19:34:26 -0800 Subject: [PATCH 7/7] Use proper shell syntax Fix environment variable reference. Remove debug output. --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cff34f804dc..7c7695502aa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -57,8 +57,7 @@ jobs: - script: | cd build - echo Library flag $(LIBTYPE) - cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $(LIBTYPE) -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. + cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $LIBTYPE -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. displayName: CMake env: BUILD_TYPE: $(build_type)