diff options
author | Claudio André <claudioandre.br@gmail.com> | 2018-07-12 16:51:59 -0300 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2019-02-04 15:19:30 +0100 |
commit | df4e2bbd02494c0c7ffe9041c717f039ec6fc39b (patch) | |
tree | 8b77aae222bffac41bbf643f7adbf5df9bc9e410 /build-aux | |
parent | 6c9f5ae27c5cfdcf4c43e44fd3d03fe0734cd6a5 (diff) | |
download | gnome-settings-daemon-df4e2bbd02494c0c7ffe9041c717f039ec6fc39b.tar.gz |
CI: Improve continuous integration speed
The expected gain is 5 minutes.
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/ci/ci-helper.sh | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/build-aux/ci/ci-helper.sh b/build-aux/ci/ci-helper.sh new file mode 100755 index 00000000..ddecded2 --- /dev/null +++ b/build-aux/ci/ci-helper.sh @@ -0,0 +1,61 @@ +#!/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 'Commit' + git log --pretty=format:"%h %cd %s" -1; echo + do_print_labels + +elif [[ $1 == "WARNINGS" ]]; then + do_print_labels 'Warning Report ' + do_check_warnings + do_print_labels +fi
\ No newline at end of file |