Newer
Older
# NOTE #1: Our GitLab CI runs jobs inside Alpine Linux container by default.
#
# NOTE #2: Keep in mind that each job (e.g. test-gcc) is executed in a separate
# isolated environment (it may be even on different machine). There are no
# files implicitly passed between jobs or stages, only artifacts and maybe
# cache (depends on configuration).
*-clang) export CXX=clang++ EXTRA_PKGS="$EXTRA_PKGS clang llvm5-dev";;
*) export CXX=g++;;
esac
- export JOBS=$(grep -c processor /proc/cpuinfo)
- apk add --no-cache build-base bash libexecinfo-dev
cppunit-dev libxml2-dev tclap-dev readline-dev $EXTRA_PKGS
*-clang) ln -s /usr/lib/llvm5/lib/LLVMgold.so /usr/lib/LLVMgold.so;;
- echo USE_RAMDISK=0 >> build.conf
- case "$CI_BUILD_NAME" in
*-clang) echo USE_LTO=1 >> build.conf;;
*) echo USE_LTO=0 >> build.conf;;
esac
#========== Stage build ==========
.build: &build
script:
- bin-release
- "*/bin-release"
- "*/lib-release"
stage: build
build-gcc:
<<: *build
build-clang:
<<: *build
variables:
EXTRA_PKGS: cmake python3 py3-click
script:
- cd CMake
- ./alib_cmake.py -w -m
- cd ..
- mkdir release
- cd release
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make
- mkdir bin
- cd bin
- find .. -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \) -exec test -x {} \; -print | grep -v 'CMakeFiles' | while read line; do ln -s $line $(basename $line); done
- cp ../../translateAddresses .
- cp ../../xmlFormat .
artifacts:
paths:
- release/bin
- "release/*/a*2" #select binaries
- release/tniceprint/tniceprint #explicit binary
- "release/*/lib*.so" #select libraries
- "release/*/test-alib2*" #select libraries test
expire_in: 1 day
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
build-doc:
variables:
EXTRA_PKGS: doxygen graphviz
script:
- make doc
allow_failure: true
artifacts:
name: docs
paths:
- alib2std/doc/
- alib2data/doc/
- alib2common/doc/
- alib2str/doc/
- alib2raw/doc/
- alib2algo/doc/
- alib2elgo/doc/
- alib2measurepp/doc/
expire_in: 1 week
stage: build
#========== Stage test ==========
.test: &test
variables:
# coreutils are needed because of timeout command used in tests.
EXTRA_PKGS: bc coreutils python3
script:
- make test-release
stage: test
test-gcc:
<<: *test
dependencies:
- build-gcc
test-clang:
<<: *test
dependencies:
- build-clang
test-cmake-clang:
variables:
# coreutils are needed because of timeout command used in tests.
EXTRA_PKGS: bc coreutils python3
script:
- for test in $(ls tests.*.sh); do ./${test} release/bin ${JOBS}; touch release/bin/log_tests.txt; cat release/bin/log_tests.txt; done
stage: test
dependencies:
- build-cmake-clang