Commit f4433b37 authored by Claudio André's avatar Claudio André
Browse files

CI: print some info about the build env

It is not possible to debug if the developer knows nothing about
the CI running environment.
parent 4a5a2c72
Pipeline #11530 passed with stages
in 3 minutes and 47 seconds
......@@ -18,13 +18,20 @@ build:
expire_in: 3h30min
script:
- echo "== Info =="
- tests/ci-helper.sh "INFO"
- tests/ci-helper.sh "GIT_INFO"
- echo "== Building =="
- meson . _build
- ninja -C _build
- ninja -C _build 2>&1 | tee compilation.log
- echo "== Installing =="
- ninja -C _build install
- echo "== Report =="
- tests/ci-helper.sh "WARNINGS"
##
# Stage: Test
#
......@@ -32,10 +39,20 @@ build:
##
test:
stage: test
artifacts:
name: log
when: always
paths:
- $(pwd)/*.log
dependencies:
- build
script:
- echo "== Info =="
- tests/ci-helper.sh "INFO"
- tests/ci-helper.sh "GIT_INFO"
- |
if [[ -n "${CI_COMMIT_TAG}" ]]; then
echo "== Distro Test =="
......
#!/bin/bash -e
function do_print_labels(){
if [[ -n "${1}" ]]; then
label_len=${#1}
span=$(((54 - $label_len) / 2))
echo
echo "= ======================================================== ="
printf "%s %${span}s %s %${span}s %s\n" "=" "" "$1" "" "="
echo "= ======================================================== ="
else
echo "= ========================= Done ========================= ="
echo
fi
}
function do_show_info(){
local compiler=gcc
echo -n "Processors: "; grep -c ^processor /proc/cpuinfo
grep ^MemTotal /proc/meminfo
id; uname -a
printenv
echo '-----------------------------------------'
cat /etc/*-release
echo '-----------------------------------------'
if [[ ! -z $CC ]]; then
compiler=$CC
fi
echo 'Compiler version'
$compiler --version
echo '-----------------------------------------'
$compiler -dM -E -x c /dev/null
echo '-----------------------------------------'
}
function do_check_warnings(){
cat compilation.log | grep "warning:" | awk '{total+=1}END{print "Total number of warnings: "total}'
}
# ----------- -----------
if [[ $1 == "INFO" ]]; then
do_print_labels 'Build environment '
do_show_info
do_print_labels
elif [[ $1 == "GIT_INFO" ]]; then
do_print_labels 'The Commit'
git log --pretty=format:"%h %cd %s" -1; echo
do_print_labels
elif [[ $1 == "WARNINGS" ]]; then
do_print_labels 'Warnings Report '
do_check_warnings
do_print_labels
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment