CI: refactor the build process

In order to shrink the file and reuse "code".
This commit is contained in:
Claudio André 2018-06-19 14:35:23 -03:00
parent 8fb43047df
commit 38487017b3

View file

@ -23,6 +23,12 @@ stages:
build-aux/ci/ci-helper.sh "INFO" && build-aux/ci/ci-helper.sh "INFO" &&
build-aux/ci/ci-helper.sh "GIT_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 # Stage: Build
# #
@ -36,10 +42,7 @@ build:
script: script:
- *environment_information - *environment_information
- *build_procedure
- echo "== Building =="
- meson . _build
- ninja -C _build 2>&1 | tee compilation.log
- echo "== Installing ==" - echo "== Installing =="
- ninja -C _build install - ninja -C _build install
@ -84,15 +87,12 @@ coverage:
<<: *save_build_logs <<: *save_build_logs
stage: test stage: test
variables: variables:
BUILD_OPTS: "-Db_coverage=true"
coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/' coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/'
script: script:
- *environment_information - *environment_information
- *build_procedure
- echo "== Building =="
- rm -rf _build/
- meson . _build -Db_coverage=true
- ninja -C _build 2>&1 | tee compilation.log
- echo "== Testing ==" - echo "== Testing =="
- ninja -C _build test - ninja -C _build test