From 38487017b3039f564e62bef3c8ac6fde79b9e34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claudio=20Andr=C3=A9?= Date: Tue, 19 Jun 2018 14:35:23 -0300 Subject: CI: refactor the build process In order to shrink the file and reuse "code". --- .gitlab-ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4fe41f01..cfa29c9b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,12 @@ stages: build-aux/ci/ci-helper.sh "INFO" && build-aux/ci/ci-helper.sh "GIT_INFO" +.Build procedure: &build_procedure + echo "== Building ==" && + rm -rf _build/ && + meson . _build ${BUILD_OPTS} && + ninja -C _build 2>&1 | tee compilation.log + ## # Stage: Build # @@ -36,10 +42,7 @@ build: script: - *environment_information - - - echo "== Building ==" - - meson . _build - - ninja -C _build 2>&1 | tee compilation.log + - *build_procedure - echo "== Installing ==" - ninja -C _build install @@ -84,15 +87,12 @@ coverage: <<: *save_build_logs stage: test variables: + BUILD_OPTS: "-Db_coverage=true" coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/' script: - *environment_information - - - echo "== Building ==" - - rm -rf _build/ - - meson . _build -Db_coverage=true - - ninja -C _build 2>&1 | tee compilation.log + - *build_procedure - echo "== Testing ==" - ninja -C _build test -- cgit v1.2.1