diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-11-05 20:46:47 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-11-14 13:12:37 +0100 |
commit | 1fb5474314d40ac9fbf6d8003a3e95f8700ebaf8 (patch) | |
tree | 18296c6acfd28d60849073dc172416639add7645 /.gitlab-ci.yml | |
parent | 47734ee1bebf1dc81f2cc389a6c4e2a060d12eca (diff) | |
download | gnutls-1fb5474314d40ac9fbf6d8003a3e95f8700ebaf8.tar.gz |
.gitlab-ci.yml: use configure cache file and ccache
That reduces the total time spent per build by caching configure
checks, and compilation artifacts.
Also that patch set no longer uploads coverage files as artifacts.
These files are not generally useful, and removing that "feature"
will reduce CI running time.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 114 |
1 files changed, 72 insertions, 42 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 74748f48b6..384e33c833 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,27 @@ stages: - stage1-testing # we utilize the images generated by the build-images project, to -# speed up CI runs. +# speed up CI runs. We also use ccache and store config.cache +# to speed up compilation. We include a version number in cache +# name to allow expiration of old caches. + +cache: + key: "$CI_JOB_NAME-ver2" + paths: + - cache/ + +before_script: + # CCache Config + - mkdir -p cache + - export CCACHE_BASEDIR=${PWD} + - export CCACHE_DIR=${PWD}/cache + - export CC="ccache gcc" + +after_script: + # somehow after_script looses environment + - export CCACHE_BASEDIR=${PWD} + - export CCACHE_DIR=${PWD}/cache + - ccache -s variables: BUILD_IMAGES_PROJECT: gnutls/build-images @@ -16,14 +36,14 @@ variables: # Stage 1, documentation, and advanced checks ################################################## -doc-dist/Fedora: +doc-dist.Fedora: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - git submodule update --init --no-fetch - make autoreconf - - CFLAGS="-std=c99 -O2 -g" ./configure --prefix=/usr --libdir=/usr/lib64 --disable-cxx --disable-non-suiteb-curves --enable-gtk-doc --disable-maintainer-mode - && make -C doc stamp-vti && make -C doc stamp-1 && make -j$(nproc) + - CFLAGS="-std=c99 -O2 -g" ./configure --cache-file cache/config.cache --prefix=/usr --libdir=/usr/lib64 --disable-cxx --disable-non-suiteb-curves --enable-gtk-doc --disable-maintainer-mode + - make -C doc stamp-vti && make -C doc stamp-1 && make -j$(nproc) - make -C doc gnutls.html - PATH="$PATH:/usr/share/sgml/docbook/xsl-stylesheets-1.79.1/epub/bin/" make -C doc gnutls.epub && make -C doc/latex gnutls.pdf @@ -34,13 +54,13 @@ doc-dist/Fedora: - tags # ABI check + coverage -abi-coverage/Fedora: +abi-coverage.Fedora: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - git submodule update --init --no-fetch - make autoreconf - - CFLAGS="-std=c99 -O2 -g" ./configure --prefix=/usr --libdir=/usr/lib64 --disable-cxx --enable-code-coverage --disable-non-suiteb-curves --disable-maintainer-mode --disable-doc + - CFLAGS="-std=c99 -O2 -g" ./configure --cache-file cache/config.cache --prefix=/usr --libdir=/usr/lib64 --disable-cxx --enable-code-coverage --disable-non-suiteb-curves --disable-maintainer-mode --disable-doc && make -j$(nproc) - make abi-check - make pic-check @@ -52,20 +72,19 @@ abi-coverage/Fedora: - tags artifacts: expire_in: 1 week - when: always + when: on_failure paths: - tests/*.log - tests/*/*.log - tests/suite/*/*.log - - GnuTLS*-coverage/* -minimal/Fedora/x86_64: +minimal.Fedora.x86_64: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - echo "No tools build" - make autoreconf - - ./configure --disable-full-test-suite --disable-doc --disable-guile --disable-tools --enable-tests + - ./configure --cache-file cache/config.cache --disable-full-test-suite --disable-doc --disable-guile --disable-tools --enable-tests - make -j$(nproc) - make -j$(nproc) check - echo "Minimal build" @@ -83,14 +102,15 @@ minimal/Fedora/x86_64: except: - tags -no-SSL-3.0/Fedora/x86_64: +no-SSL-3.0.Fedora.x86_64: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - make autoreconf - mkdir -p build && cd build && - ../configure --disable-ssl3-support --disable-ssl2-support --disable-full-test-suite --enable-seccomp-tests --disable-doc --disable-guile && + ../configure --cache-file ../cache/config.cache --disable-ssl3-support --disable-ssl2-support --disable-full-test-suite --enable-seccomp-tests --disable-doc --disable-guile && make -j$(nproc) && make check -j$(nproc) + - cd .. tags: - shared except: @@ -105,16 +125,17 @@ no-SSL-3.0/Fedora/x86_64: - build/tests/*/*.log - build/tests/suite/*/*.log -FIPS140-2/Fedora/x86_64: +FIPS140-2.Fedora.x86_64: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - make autoreconf - mkdir -p build && cd build && - ../configure --disable-non-suiteb-curves --enable-fips140-mode --disable-doc --disable-full-test-suite --disable-guile + ../configure --cache-file ../cache/config.cache --disable-non-suiteb-curves --enable-fips140-mode --disable-doc --disable-full-test-suite --disable-guile - make -j$(nproc) - GNUTLS_SKIP_FIPS_INTEGRITY_CHECKS=1 GNUTLS_FORCE_FIPS_MODE=1 make check -j$(nproc) - make check -j$(nproc) + - cd .. tags: - shared except: @@ -126,12 +147,12 @@ FIPS140-2/Fedora/x86_64: - build/tests/*.log - build/tests/*/*.log -valgrind/Fedora/x86_64: +valgrind.Fedora.x86_64: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - make autoreconf - - ./configure --disable-doc --disable-guile --disable-full-test-suite --enable-valgrind-tests + - ./configure --disable-doc --cache-file cache/config.cache --disable-guile --disable-full-test-suite --enable-valgrind-tests - make -j$(nproc) - make check -j$(nproc) tags: @@ -147,18 +168,18 @@ valgrind/Fedora/x86_64: - tests/*/*.log # Two runs, one with normal backend and another with pkcs11 trust store -asan/Fedora/x86_64: +asan.Fedora.x86_64: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - git submodule update --init --no-fetch - make autoreconf - CFLAGS="-fsanitize=address -g -O2" LDFLAGS="-static-libasan" - ./configure --disable-doc --disable-non-suiteb-curves --disable-guile + ./configure --disable-doc --cache-file cache/config.cache --disable-non-suiteb-curves --disable-guile - make -j$(nproc) - LSAN_OPTIONS="suppressions=$(pwd)/fuzz/lsan.supp" make check -j$(nproc) - CFLAGS="-fsanitize=address -g -O2" LDFLAGS="-static-libasan" - ./configure --disable-doc --with-default-trust-store-pkcs11="pkcs11:" --disable-guile --enable-destructive-tests + ./configure --cache-file cache/config.cache --disable-doc --with-default-trust-store-pkcs11="pkcs11:" --disable-guile --enable-destructive-tests - make -j$(nproc) - make -C tests check -j$(nproc) TESTS="trust-store destructive/p11-kit-load.sh" SUBDIRS=. tags: @@ -174,19 +195,23 @@ asan/Fedora/x86_64: - tests/*/*.log - tests/suite/*/*.log -static-analyzers/Fedora/x86_64: +static-analyzers.Fedora.x86_64: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD + before_script: + - /bin/true script: - make autoreconf - scan-build ./configure --disable-doc --disable-guile --enable-fips140-mode --enable-valgrind-tests - make -j$(nproc) syntax-check - make -j$(nproc) -C gl - scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C lib + - scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C libdane - make -j$(nproc) -C src/gl && scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C src - - scan-build --status-bugs -o scan-build-libdane make -j$(nproc) -C libdane - cppcheck --force -q -Ilib/include -Igl/ -Ilib/ -I. --error-exitcode=1 lib/ -i lib/unistring -i lib/minitasn1 -j$(nproc) $CPPCHECK_OPTIONS - cppcheck --force -q -Ilib/include -Igl/ -Ilibdane/ -I. --error-exitcode=1 libdane/ -j$(nproc) $CPPCHECK_OPTIONS + after_script: + - /bin/true tags: - shared except: @@ -198,7 +223,7 @@ static-analyzers/Fedora/x86_64: - scan-build-lib/* - scan-build-libdane/* -MinGW32/DLLs: +MinGW32.DLLs: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: @@ -206,7 +231,8 @@ MinGW32/DLLs: echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register && rm -f tests/suite/mini-eagain2.c - make autoreconf - - mingw32-configure --with-included-libtasn1 --disable-nls --disable-guile --with-included-unistring --enable-local-libopts --disable-non-suiteb-curves --disable-doc && + - export CC="ccache i686-w64-mingw32-gcc" + - configure ./configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 ---cache-file cache/config.cache --with-included-libtasn1 --disable-nls --disable-guile --with-included-unistring --enable-local-libopts --disable-non-suiteb-curves --disable-doc && mingw32-make -j$(nproc) && mingw32-make -C tests check -j$(nproc) # Combine generated apps and DLLs. #libwinpthread is required by libgcc @@ -236,7 +262,7 @@ MinGW32/DLLs: paths: - win32-build/ -MinGW64/DLLs: +MinGW64.DLLs: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: @@ -244,7 +270,8 @@ MinGW64/DLLs: echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register && rm -f tests/suite/mini-eagain2.c - make autoreconf - - mingw64-configure --with-included-libtasn1 --disable-guile --disable-nls --with-included-unistring --enable-local-libopts --disable-non-suiteb-curves --disable-doc && + - export CC="ccache x86_64-w64-mingw32-gcc" + ./configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --cache-file cache/config.cache --with-included-libtasn1 --disable-guile --disable-nls --with-included-unistring --enable-local-libopts --disable-non-suiteb-curves --disable-doc && mingw64-make -j$(nproc) && mingw64-make -C tests check -j$(nproc) # Combine generated apps and DLLs. #libwinpthread is required by libgcc @@ -279,11 +306,13 @@ MinGW64: image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - make autoreconf + - export CC="ccache x86_64-w64-mingw32-gcc" - mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc && echo ':DOSWin:M::MZ::/usr/bin/wine64:' > /proc/sys/fs/binfmt_misc/register && rm -f tests/suite/mini-eagain2.c && mkdir -p build && cd build && - mingw64-configure --with-included-libtasn1 --disable-guile --disable-nls --with-included-unistring --enable-local-libopts --disable-non-suiteb-curves --disable-doc && + ../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --cache-file cache/config.cache --with-included-libtasn1 --disable-guile --disable-nls --with-included-unistring --enable-local-libopts --disable-non-suiteb-curves --disable-doc && mingw64-make -j$(nproc) && mingw64-make -C tests check -j$(nproc) + - cd .. tags: - shared - docker @@ -302,11 +331,13 @@ MinGW32: image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - make autoreconf + - export CC="ccache i686-w64-mingw32-gcc" - mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc && echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register && rm -f tests/suite/mini-eagain2.c && mkdir -p build && cd build && - mingw32-configure --with-included-libtasn1 --disable-guile --disable-nls --with-included-unistring --enable-local-libopts --disable-non-suiteb-curves --disable-doc && + ../configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 --cache-file cache/config.cache --with-included-libtasn1 --disable-guile --disable-nls --with-included-unistring --enable-local-libopts --disable-non-suiteb-curves --disable-doc && mingw32-make -j$(nproc) && mingw32-make -C tests check -j$(nproc) + - cd .. tags: - shared - docker @@ -322,14 +353,13 @@ MinGW32: # That is a specific runner that we cannot enable universally. # We restrict it to builds under the $BUILD_IMAGES_PROJECT project. -FreeBSD/x86_64: +FreeBSD.x86_64: stage: stage1-testing image: - before_script: - - /usr/bin/true script: + - export CC="ccache clang" - gmake autoreconf && rm -f tests/suite/mini-eagain2.c && LIBS="-L/usr/local/lib" ./configure - --disable-guile --disable-doc && gmake -j$(sysctl hw.ncpu | awk '{print $2}') && gmake check -j$(sysctl hw.ncpu | awk '{print $2}') + --cache-file cache/config.cache --disable-guile --disable-doc && gmake -j$(sysctl hw.ncpu | awk '{print $2}') && gmake check -j$(sysctl hw.ncpu | awk '{print $2}') tags: - freebsd only: @@ -346,13 +376,13 @@ FreeBSD/x86_64: # We need a clean 32-bit fedora for testing. Note that this is also # a test for interoperability with openssl 1.0.x. -Fedora/x86: +Fedora.x86: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_X86_BUILD script: - git submodule update --init --no-fetch - make autoreconf && mkdir -p build && cd build && - CC="gcc -m32" PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig/ ../configure --host=i686-redhat-linux --target=i686-redhat-linux --libdir=/usr/lib --disable-cxx --disable-non-suiteb-curves --enable-seccomp-tests --disable-doc --disable-guile && + CC="ccache gcc -m32" PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig/ ../configure --host=i686-redhat-linux --target=i686-redhat-linux --libdir=/usr/lib --disable-cxx --disable-non-suiteb-curves --enable-seccomp-tests --disable-doc --disable-guile && make -j$(nproc) && make check -j$(nproc) && make pic-check tags: @@ -369,13 +399,13 @@ Fedora/x86: - build/tests/suite/*/*.log # Two runs, one with normal backend and another with pkcs11 trust store -ubsan-Werror/Fedora/x86_64: +ubsan-Werror.Fedora.x86_64: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - git submodule update --init --no-fetch - make autoreconf - - CFLAGS="-fsanitize=undefined -fsanitize=bool -fsanitize=alignment -fsanitize=null -fsanitize=bounds-strict -fsanitize=enum -fno-sanitize-recover -g -O2" LDFLAGS="-static-libubsan" ./configure --disable-non-suiteb-curves --disable-guile --disable-doc + - CFLAGS="-fsanitize=undefined -fsanitize=bool -fsanitize=alignment -fsanitize=null -fsanitize=bounds-strict -fsanitize=enum -fno-sanitize-recover -g -O2" LDFLAGS="-static-libubsan" ./configure --cache-file cache/config.cache --disable-non-suiteb-curves --disable-guile --disable-doc - make -j$(nproc) -C gl - make -j$(nproc) -C lib CFLAGS="-Werror -O2 -g" - make -j$(nproc) -C libdane CFLAGS="-Werror -O2 -g" @@ -383,7 +413,7 @@ ubsan-Werror/Fedora/x86_64: - make -j$(nproc) -C src CFLAGS="-Werror -O2 -g -fsanitize=undefined -Wno-error=parentheses -Wno-error=unused-macros" - make -j$(nproc) - make check -j$(nproc) - - CFLAGS="-fsanitize=undefined -fsanitize=bool -fsanitize=alignment -fsanitize=null -fsanitize=bounds-strict -fsanitize=enum -fno-sanitize-recover -g -O2" LDFLAGS="-static-libubsan" ./configure --disable-non-suiteb-curves --disable-guile --disable-doc --with-default-trust-store-pkcs11="pkcs11:" --enable-destructive-tests + - CFLAGS="-fsanitize=undefined -fsanitize=bool -fsanitize=alignment -fsanitize=null -fsanitize=bounds-strict -fsanitize=enum -fno-sanitize-recover -g -O2" LDFLAGS="-static-libubsan" ./configure --cache-file cache/config.cache --disable-non-suiteb-curves --disable-guile --disable-doc --with-default-trust-store-pkcs11="pkcs11:" --enable-destructive-tests - make -j$(nproc) - make -C tests check -j$(nproc) TESTS="trust-store destructive/p11-kit-load.sh" SUBDIRS=. tags: @@ -399,14 +429,15 @@ ubsan-Werror/Fedora/x86_64: - tests/*/*.log - tests/suite/*/*.log -Debian/x86_64: +Debian.x86_64: stage: stage1-testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD script: - git submodule update --init --no-fetch - make autoreconf && mkdir -p build && cd build && - ../configure --disable-doc --disable-guile && + ../configure --cache-file ../cache/config.cache --disable-doc --disable-guile && make -j$(nproc) && make check -j$(nproc) + - cd .. tags: - shared except: @@ -420,15 +451,14 @@ Debian/x86_64: - build/tests/*/*.log - build/tests/suite/*/*.log -Debian/aarch64: +Debian.aarch64: stage: stage1-testing image: - before_script: - - /bin/true script: - make autoreconf && mkdir -p build && cd build && - ../configure --disable-doc --disable-guile --disable-full-test-suite && + ../configure --cache-file ../cache/config.cache --disable-doc --disable-guile --disable-full-test-suite && make -j$(nproc) && make check -j$(nproc) + - cd .. tags: - aarch64 only: |