From af95474670e88b3deb1b15ce0a396327169a0b97 Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 2 Oct 2020 20:58:03 +0200 Subject: [PATCH] Run unit tests in gitlab CI for linux build --- .gitlab-ci.yml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d171e82225..97bd619c34 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ stages: - build - -Debian: + +.Debian: tags: - docker - linux @@ -14,20 +14,34 @@ Debian: before_script: - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR - apt-get update -yq - - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake build-essential libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-iostreams-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libqt5opengl5-dev libopenal-dev libopenscenegraph-dev libunshield-dev libtinyxml-dev libmygui-dev libbullet-dev ccache + - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake build-essential libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-iostreams-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libqt5opengl5-dev libopenal-dev libopenscenegraph-dev libunshield-dev libtinyxml-dev libmygui-dev libbullet-dev ccache git stage: build script: - export CCACHE_BASEDIR="`pwd`" - export CCACHE_DIR="`pwd`/ccache" && mkdir -pv "$CCACHE_DIR" - - ccache -z -M 250M - - cores_to_use=$((`nproc`-2)); if (( $cores_to_use < 1 )); then cores_to_use=1; fi - - mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=MinSizeRel ../ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - - make -j$cores_to_use - - DESTDIR=artifacts make install + - ccache -z -M 1G + - CI/before_script.linux.sh + - cd build + - cmake --build . -- -j $(nproc) + - cmake --install . + - if [[ "${BUILD_TESTS_ONLY}" ]]; then ./openmw_test_suite; fi - ccache -s artifacts: paths: - - build/artifacts/ + - build/install/ + +Debian_GCC: + extends: .Debian + variables: + CC: gcc + CXX: g++ + +Debian_GCC_tests: + extends: .Debian + variables: + CC: gcc + CXX: g++ + BUILD_TESTS_ONLY: 1 MacOS: tags: @@ -228,4 +242,4 @@ Windows_MSBuild_CS_RelWithDebInfo: - .Windows_MSBuild_Base variables: <<: *cs-targets - config: "RelWithDebInfo" \ No newline at end of file + config: "RelWithDebInfo"