diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0906d54a651bcbe7b010d4eddf26bcc15aa46d1f..dd729ce9b6a21e2d59b70de5735cf27d130f9b2e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,59 +5,45 @@ # files implicitly passed between jobs or stages, only artifacts and maybe # cache (depends on configuration). -image: alpine:3.7 - -before_script: - - case "$CI_BUILD_NAME" in - *-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 - - case "$CI_BUILD_NAME" in - *-clang) ln -s /usr/lib/llvm5/lib/LLVMgold.so /usr/lib/LLVMgold.so;; - *) ;; - esac +image: alpine:3.8 +stages: + - build + - test #========== Stage build ========== -.build-cmake: &build-cmake - variables: - EXTRA_PKGS: cmake python3 py3-click qt5-qtbase-dev graphviz-dev jsoncpp-dev +.build: &build_template + stage: build + before_script: + - apk add --no-cache bash build-base cmake python3 libexecinfo-dev cppunit-dev libxml2-dev tclap-dev readline-dev qt5-qtbase-dev graphviz-dev jsoncpp-dev ${EXTRA_PKGS} script: - - cd CMake - - ./alib_cmake.py -w -m - - cd .. + - export CXX=${CXX} + - CMake/generate.py -wm - 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 . + - make -j $(grep -c processor /proc/cpuinfo) 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 + - release/ expire_in: 1 day - stage: build - -build-cmake-clang: - <<: *build-cmake -build-cmake-gcc: - <<: *build-cmake +build:gcc: + <<: *build_template + variables: + CXX: g++ -build-doc: +build:clang: + <<: *build_template variables: - EXTRA_PKGS: doxygen graphviz + CXX: clang++ + EXTRA_PKGS: clang + +build:doc: + stage: build + before_script: + - apk add --no-cache doxygen graphviz script: - doxygen allow_failure: true @@ -65,29 +51,31 @@ build-doc: name: docs paths: - doc/ - expire_in: 1 week - stage: build + expire_in: 1 day #========== Stage test ========== -.test-cmake: &test-cmake - variables: - # coreutils are needed because of timeout command used in tests. - EXTRA_PKGS: bc coreutils python3 qt5-qtbase qt5-qtbase-x11 graphviz jsoncpp +.test: &test_template + stage: test + before_script: + - apk add --no-cache bash bc coreutils python3 cmake make libexecinfo cppunit libxml2 tclap readline qt5-qtbase qt5-qtbase-x11 graphviz jsoncpp script: - cd release - - for test in $(ls */test-alib2*); do if [ -f ${test} ]; then ./${test} || exit 1; fi; done - - cd .. - - for test in $(ls tests.*.sh); do ./${test} release/bin ${JOBS} || exit 1; touch release/bin/log_tests.txt; cat release/bin/log_tests.txt; done - stage: test + - make test + # temporary until make tests manages all tests + - 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 + - cd ../.. + - for test in $(ls tests.*.sh); do ./${test} release/bin $(grep -c processor /proc/cpuinfo) || exit 1; touch release/bin/log_tests.txt; cat release/bin/log_tests.txt; done -test-cmake-gcc: - <<: *test-cmake +test:gcc: + <<: *test_template dependencies: - - build-cmake-gcc + - build:gcc -test-cmake-clang: - <<: *test-cmake +test:clang: + <<: *test_template dependencies: - - build-cmake-clang + - build:clang