aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2020-01-14 11:37:18 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2020-01-14 11:20:26 +0000
commitc3e4b6c7287ff8ca0db4b6e61e88001f62595792 (patch)
tree123a173d56719bc571fdb8dd9189d079f7ab3618 /.github
parente92bef2b62ece3505e3e090f0573af321b6db697 (diff)
CMake Build: Enable tests on GitHub actions builds
They take 1 to 2 minutes of execution. The success rate is from 97 to 99%, so I haven't made the tests step blocking. Change-Id: I39925cf6703904e15ba1c0c313aaf1daca382424 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build_cmake.yml24
1 files changed, 21 insertions, 3 deletions
diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml
index ed1f5c73ff..1f2f3c7966 100644
--- a/.github/workflows/build_cmake.yml
+++ b/.github/workflows/build_cmake.yml
@@ -9,6 +9,7 @@ env:
NINJA_VERSION: 1.9.0
BUILD_TYPE: Release
CCACHE_VERSION: 3.7.7
+ GOOGLETEST_VERSION: 1.10.0
jobs:
build:
@@ -217,6 +218,16 @@ jobs:
)
endif()
+ - name: Download Googletest
+ id: googletest
+ shell: cmake -P {0}
+ run: |
+ # Googletest should be a submodule
+ file(DOWNLOAD "https://github.com/google/googletest/archive/release-$ENV{GOOGLETEST_VERSION}.tar.gz" ./googletest.tar.gz SHOW_PROGRESS)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf googletest.tar.gz)
+ file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/googletest-release-$ENV{GOOGLETEST_VERSION}" googletest_dir)
+ message("::set-output name=googletest_dir::${googletest_dir}")
+
- name: Configure
shell: cmake -P {0}
run: |
@@ -242,6 +253,8 @@ jobs:
endif()
set(ENV{PATH} "$ENV{GITHUB_WORKSPACE}${path_separator}$ENV{PATH}")
+ set(ENV{GOOGLETEST_DIR} "${{ steps.googletest.outputs.googletest_dir }}")
+
# Workaround for https://gitlab.kitware.com/cmake/cmake/issues/20119
foreach(step 1 2)
execute_process(
@@ -256,6 +269,7 @@ jobs:
-D CMAKE_C_COMPILER_LAUNCHER=ccache
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache
-D BUILD_WITH_PCH=OFF
+ -D WITH_TESTS=ON
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
@@ -314,14 +328,18 @@ jobs:
include(ProcessorCount)
ProcessorCount(N)
+ set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
+
execute_process(
COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/ctest -j ${N}
WORKING_DIRECTORY build
RESULT_VARIABLE result
)
- if (NOT result EQUAL 0)
- message(FATAL_ERROR "Running tests failed!")
- endif()
+
+ # Do not fail on ctest failure
+ #if (NOT result EQUAL 0)
+ # message(FATAL_ERROR "Running tests failed!")
+ #endif()
- name: Install Strip