1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 02:25:09 +00:00
conky/.gitlab-ci.yml

704 lines
16 KiB
YAML
Raw Normal View History

---
2019-02-23 02:57:10 +00:00
stages:
- pull
- base
- dependencies
2019-02-23 02:57:10 +00:00
- build
- test
2019-02-24 15:24:32 +00:00
- deploy
2019-02-23 02:57:10 +00:00
variables:
SCCACHE_GCS_BUCKET: btm-build-cache
SCCACHE_GCS_RW_MODE: READ_WRITE
SCCACHE_GCS_KEY_PATH: /tmp/storage-key.json
DOCKER_DRIVER: overlay2
before_script:
- echo $GCS_STORAGE_KEY > $SCCACHE_GCS_KEY_PATH
.pull_images: &pull_images
stage: pull
allow_failure: true
image: docker:stable
services:
- docker:dind
script:
- set -- $CI_JOB_NAME
- export DISTRO=$2
- export COMPILER=$3
- "echo \"Distro: ${DISTRO}\nCompiler: ${COMPILER}\""
- export DOCKER_HOST="${DOCKER_HOST:-tcp://localhost:2375/}"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# Pull either the last ref slug, or latest, depending on which exists
- docker pull $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_REF_SLUG || docker pull $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest
# If ref slug exists, use that, otherwise fallback to latest tag
- >
docker tag
$CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_REF_SLUG
$CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA ||
docker tag
$CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest
$CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA
pull ubuntu clang-7: *pull_images
pull ubuntu clang-8: *pull_images
pull ubuntu gcc-5: *pull_images
pull ubuntu gcc-6: *pull_images
pull ubuntu gcc-7: *pull_images
pull ubuntu gcc-8: *pull_images
pull fedora gcc-8: *pull_images
pull fedora clang-7: *pull_images
pull centos6 gcc-7: *pull_images
pull centos7 gcc-7: *pull_images
pull centos7 gcc-8: *pull_images
pull centos7 clang-5: *pull_images
2019-02-24 15:24:32 +00:00
.docker_base_builder: &docker_base_builder
2019-02-24 14:55:30 +00:00
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
- unknown_failure
- api_failure
2019-02-24 15:24:32 +00:00
stage: base
image: docker:stable
2019-02-24 15:24:32 +00:00
only:
changes:
- tests/dockerfiles/*
services:
- docker:dind
before_script:
2019-02-24 15:24:32 +00:00
- set -- $CI_JOB_NAME
- export DISTRO=$2
- "echo \"Distro: ${DISTRO}\nDocker base: ${DOCKER_BASE_IMAGE}\""
- export DOCKER_HOST="${DOCKER_HOST:-tcp://localhost:2375/}"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE/builder/$DISTRO-base:latest || true
- >
docker pull $CI_REGISTRY_IMAGE/builder/$DISTRO-base:$CI_COMMIT_REF_SLUG
|| true
script:
- cd tests/dockerfiles
2019-02-24 15:24:32 +00:00
- docker pull $DOCKER_BASE_IMAGE || true
- >
docker build -f Dockerfile.$DISTRO-base
--cache-from $CI_REGISTRY_IMAGE/builder/$DISTRO-base:latest
--tag $CI_REGISTRY_IMAGE/builder/$DISTRO-base:$CI_COMMIT_SHA
--tag $CI_REGISTRY_IMAGE/builder/$DISTRO-base:$CI_COMMIT_REF_SLUG .
- docker push $CI_REGISTRY_IMAGE/builder/$DISTRO-base:$CI_COMMIT_SHA
2019-02-24 15:24:32 +00:00
- docker push $CI_REGISTRY_IMAGE/builder/$DISTRO-base:$CI_COMMIT_REF_SLUG
2019-02-24 15:24:32 +00:00
builder ubuntu base:
<<: *docker_base_builder
variables:
2019-02-24 15:24:32 +00:00
DOCKER_BASE_IMAGE: ubuntu:bionic
2019-02-24 15:24:32 +00:00
builder fedora base:
<<: *docker_base_builder
variables:
2019-02-24 15:24:32 +00:00
DOCKER_BASE_IMAGE: fedora:latest
2019-02-24 15:24:32 +00:00
builder centos6 base:
<<: *docker_base_builder
variables:
2019-02-24 15:24:32 +00:00
DOCKER_BASE_IMAGE: centos:6
builder centos7 base:
<<: *docker_base_builder
variables:
DOCKER_BASE_IMAGE: centos:7
2019-02-24 15:24:32 +00:00
.docker_builder: &docker_builder
<<: *docker_base_builder
stage: dependencies
script:
2019-02-24 15:24:32 +00:00
- set -- $CI_JOB_NAME
- export DISTRO=$2
- export COMPILER=$3
- "echo \"Distro: ${DISTRO}\nCompiler: ${COMPILER}\""
- cd tests/dockerfiles
- >
docker tag $CI_REGISTRY_IMAGE/builder/$DISTRO-base:$CI_COMMIT_REF_SLUG
$CI_REGISTRY_IMAGE/builder/$DISTRO-base:latest
- >
docker pull $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_REF_SLUG
|| true
- >
docker pull
$CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_REF_SLUG
|| true
- >
docker build -f Dockerfile.$DISTRO-$COMPILER
--build-arg IMAGE=$CI_REGISTRY_IMAGE
--cache-from $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_REF_SLUG
--tag $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA
--tag $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_REF_SLUG .
- docker push ${CI_REGISTRY_IMAGE}/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA
- >
docker push
${CI_REGISTRY_IMAGE}/builder/$DISTRO-$COMPILER:$CI_COMMIT_REF_SLUG
2019-02-24 15:24:32 +00:00
builder ubuntu clang-7: *docker_builder
builder ubuntu clang-8: *docker_builder
builder ubuntu gcc-5: *docker_builder
builder ubuntu gcc-6: *docker_builder
builder ubuntu gcc-7: *docker_builder
builder ubuntu gcc-8: *docker_builder
builder fedora gcc-8: *docker_builder
builder fedora clang-7: *docker_builder
builder centos6 gcc-7: *docker_builder
builder centos7 gcc-7: *docker_builder
builder centos7 gcc-8: *docker_builder
builder centos7 clang-5: *docker_builder
.build_stages: &build_stages
2019-02-24 14:55:30 +00:00
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
- unknown_failure
- api_failure
image: $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA
stage: build
2019-02-23 02:57:10 +00:00
script:
2019-02-24 15:24:32 +00:00
- "echo \"Distro: ${DISTRO}\nCompiler: ${COMPILER}\nCC: $CC\nCXX: $CXX\""
2019-02-23 02:57:10 +00:00
- mkdir build
- cd build
- >
cmake
-DCMAKE_EXE_LINKER_FLAGS=$LINKER_FLAGS
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DMAINTAINER_MODE=ON
-DBUILD_AUDACIOUS=$BUILD_AUDACIOUS
-DBUILD_MYSQL=ON
-DBUILD_LUA_IMLIB2=ON
-DBUILD_LUA_RSVG=$BUILD_LUA_RSVG
-DBUILD_LUA_CAIRO=$BUILD_LUA_CAIRO
-DBUILD_XMMS2=$BUILD_XMMS2
-DBUILD_ICAL=ON
-DBUILD_IRC=ON
-DBUILD_HTTP=ON
-DBUILD_ICONV=ON
-DBUILD_PULSEAUDIO=ON
-DBUILD_JOURNAL=$BUILD_JOURNAL
-DBUILD_RSS=ON
-DBUILD_IRC=ON
-DBUILD_NVIDIA=$BUILD_NVIDIA
..
2019-02-23 02:57:10 +00:00
- make -j4
.build_variables: &build_variables
CC: clang-7
CXX: clang++-7
LINKER_FLAGS: ""
BUILD_AUDACIOUS: "ON"
BUILD_XMMS2: "ON"
BUILD_NVIDIA: "ON"
BUILD_JOURNAL: "ON"
BUILD_LUA_CAIRO: "ON"
BUILD_LUA_RSVG: "ON"
2019-02-24 15:24:32 +00:00
ubuntu clang-7:
<<: *build_stages
variables:
<<: *build_variables
2019-02-24 15:24:32 +00:00
DISTRO: ubuntu
COMPILER: clang-7
CC: clang-7
CXX: clang++-7
2019-02-23 02:57:10 +00:00
2019-02-24 15:24:32 +00:00
ubuntu clang-8:
<<: *build_stages
variables:
<<: *build_variables
2019-02-24 15:24:32 +00:00
DISTRO: ubuntu
COMPILER: clang-8
CC: clang-8
CXX: clang++-8
2019-02-24 15:24:32 +00:00
ubuntu gcc-5:
<<: *build_stages
variables:
<<: *build_variables
2019-02-24 15:24:32 +00:00
DISTRO: ubuntu
COMPILER: gcc-5
CC: gcc-5
CXX: g++-5
2019-02-24 15:24:32 +00:00
ubuntu gcc-6:
<<: *build_stages
variables:
<<: *build_variables
2019-02-24 15:24:32 +00:00
DISTRO: ubuntu
COMPILER: gcc-6
CC: gcc-6
CXX: g++-6
2019-02-24 15:24:32 +00:00
ubuntu gcc-7:
<<: *build_stages
variables:
<<: *build_variables
2019-02-24 15:24:32 +00:00
DISTRO: ubuntu
COMPILER: gcc-7
CC: gcc-7
CXX: g++-7
2019-02-24 15:24:32 +00:00
ubuntu gcc-8:
<<: *build_stages
variables:
<<: *build_variables
2019-02-24 15:24:32 +00:00
DISTRO: ubuntu
COMPILER: gcc-8
CC: gcc-8
CXX: g++-8
2019-02-24 15:24:32 +00:00
fedora gcc-8:
<<: *build_stages
variables:
<<: *build_variables
DISTRO: fedora
2019-02-24 15:24:32 +00:00
COMPILER: gcc-8
CC: gcc
CXX: g++
BUILD_AUDACIOUS: "OFF"
2019-02-24 15:24:32 +00:00
fedora clang-7:
<<: *build_stages
variables:
<<: *build_variables
DISTRO: fedora
2019-02-24 15:24:32 +00:00
COMPILER: clang-7
CC: clang
CXX: clang++
BUILD_AUDACIOUS: "OFF"
2019-02-24 15:24:32 +00:00
centos6 gcc-7:
<<: *build_stages
variables:
<<: *build_variables
DISTRO: centos6
2019-02-24 15:24:32 +00:00
COMPILER: gcc-7
CC: gcc
CXX: g++
CMAKE: cmake3
BUILD_AUDACIOUS: "OFF"
BUILD_XMMS2: "OFF"
BUILD_NVIDIA: "OFF"
BUILD_JOURNAL: "OFF"
BUILD_LUA_CAIRO: "OFF"
BUILD_LUA_RSVG: "OFF"
# required because centos6 separates tinfo from ncurses
LINKER_FLAGS: "-ltinfo"
before_script:
- source /opt/rh/devtoolset-7/enable
2019-02-24 15:24:32 +00:00
centos7 gcc-7:
<<: *build_stages
variables:
<<: *build_variables
DISTRO: centos7
2019-02-24 15:24:32 +00:00
COMPILER: gcc-7
CC: gcc
CXX: g++
CMAKE: cmake3
BUILD_AUDACIOUS: "OFF"
BUILD_XMMS2: "OFF"
BUILD_NVIDIA: "OFF"
BUILD_JOURNAL: "OFF"
before_script:
- source /opt/rh/devtoolset-7/enable
2019-02-24 15:24:32 +00:00
centos7 gcc-8:
<<: *build_stages
variables:
<<: *build_variables
DISTRO: centos7
2019-02-24 15:24:32 +00:00
COMPILER: gcc-8
CC: gcc
CXX: g++
CMAKE: cmake3
BUILD_AUDACIOUS: "OFF"
BUILD_XMMS2: "OFF"
BUILD_NVIDIA: "OFF"
BUILD_JOURNAL: "OFF"
before_script:
- source /opt/rh/devtoolset-8/enable
centos7 clang-5:
<<: *build_stages
variables:
<<: *build_variables
DISTRO: centos7
COMPILER: clang-5
CC: clang
CXX: clang++
BUILD_AUDACIOUS: "OFF"
BUILD_XMMS2: "OFF"
BUILD_NVIDIA: "OFF"
BUILD_JOURNAL: "OFF"
before_script:
- source /opt/rh/llvm-toolset-7/enable
.freebsd_deps: &freebsd_deps
2019-02-24 14:55:30 +00:00
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
- unknown_failure
- api_failure
tags:
- freebsd12
before_script:
# Try up to 5 times until installation succeeds. It may be locked.
- >
for i in {1..5}; do
sudo pkg install -y -q
cairo
docbook-xsl
docbook2X
gettext-runtime
imlib2
lcov
libical
libiconv
libinotify
libircclient
libmicrohttpd
librsvg2
libX11
libXdamage
libXext
libXfixes
libXft
libXinerama
libxslt
lua53
mysql80-client
pkgconf
xmms2
$COMPILER_PACKAGE
&& break || sleep $(expr $i \* $i + 1); done
.freebsd_build_script: &freebsd_build_script
script:
- mkdir build
- cd build
- >
cmake
-DCMAKE_REQUIRED_INCLUDES="/usr/include;/usr/local/include"
-DCMAKE_EXE_LINKER_FLAGS=$LINKER_FLAGS
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DMAINTAINER_MODE=ON
-DBUILD_MYSQL=ON
-DBUILD_LUA_IMLIB2=ON
-DBUILD_LUA_RSVG=ON
-DBUILD_LUA_CAIRO=ON
-DBUILD_XMMS2=ON
-DBUILD_ICAL=ON
-DBUILD_IRC=ON
-DBUILD_HTTP=ON
-DBUILD_ICONV=ON
-DBUILD_RSS=ON
-DBUILD_IRC=ON
..
- make -j4
freebsd12 gcc-8:
<<: *freebsd_deps
stage: build
variables:
DISTRO: freebsd12
CC: gcc
CXX: g++
COMPILER_PACKAGE: gcc
<<: *freebsd_build_script
freebsd12 clang-7:
<<: *freebsd_deps
stage: build
variables:
DISTRO: freebsd12
CC: clang
CXX: clang++
COMPILER_PACKAGE: llvm70
<<: *freebsd_build_script
.test_stages: &test_stages
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
- unknown_failure
- api_failure
image: $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA
stage: test
.test_run: &test_run
script:
2019-02-24 15:24:32 +00:00
- "echo \"Distro: ${DISTRO}\nCompiler: ${COMPILER}\nCC: $CC\nCXX: $CXX\""
- mkdir build
- cd build
- >
cmake
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DMAINTAINER_MODE=ON
-DBUILD_TESTS=ON
..
- make -j4
- make -j4 test
- if [ "$COMPILER" == "clang-7" ] ; then make -j4 test-conky-coverage-txt ; fi
- if [ "$COMPILER" == "clang-7" ] ; then make -j4 test-conky-coverage-html ; fi
- if [ "$COMPILER" == "clang-7" ] ; then lcov-summary test-conky-coverage-html.info.cleaned ; fi
coverage: '/Total Coverage:\s+(\d+\.\d+)%/'
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-coverage-report"
paths:
- build/test-conky-coverage-html/
test ubuntu clang-7:
<<: *test_stages
<<: *test_run
variables:
DISTRO: ubuntu
COMPILER: clang-7
CC: clang-7
CXX: clang++-7
test ubuntu clang-8:
<<: *test_stages
<<: *test_run
variables:
DISTRO: ubuntu
COMPILER: clang-8
CC: clang-8
CXX: clang++-8
test ubuntu gcc-5:
<<: *test_stages
<<: *test_run
variables:
DISTRO: ubuntu
COMPILER: gcc-5
CC: gcc-5
CXX: g++-5
test ubuntu gcc-6:
<<: *test_stages
<<: *test_run
variables:
DISTRO: ubuntu
COMPILER: gcc-6
CC: gcc-6
CXX: g++-6
test ubuntu gcc-7:
<<: *test_stages
<<: *test_run
variables:
DISTRO: ubuntu
COMPILER: gcc-7
CC: gcc-7
CXX: g++-7
test ubuntu gcc-8:
<<: *test_stages
<<: *test_run
variables:
DISTRO: ubuntu
COMPILER: gcc-8
CC: gcc-8
CXX: g++-8
test fedora clang-7:
<<: *test_stages
<<: *test_run
variables:
DISTRO: fedora
COMPILER: clang-7
CC: clang
CXX: clang++
test fedora gcc-8:
<<: *test_stages
<<: *test_run
variables:
DISTRO: fedora
COMPILER: gcc-8
CC: gcc
CXX: g++
test centos6 gcc-7:
<<: *test_stages
<<: *test_run
variables:
DISTRO: centos7
COMPILER: gcc-7
CC: gcc
CXX: g++
before_script:
- source /opt/rh/devtoolset-7/enable
test centos7 clang-5:
<<: *test_stages
<<: *test_run
variables:
DISTRO: centos7
COMPILER: clang-5
CC: clang
CXX: clang++
before_script:
- source /opt/rh/llvm-toolset-7/enable
test centos7 gcc-7:
<<: *test_stages
<<: *test_run
variables:
DISTRO: centos7
COMPILER: gcc-7
CC: gcc
CXX: g++
before_script:
- source /opt/rh/devtoolset-7/enable
test centos7 gcc-8:
<<: *test_stages
<<: *test_run
variables:
DISTRO: centos7
COMPILER: gcc-8
CC: gcc
CXX: g++
before_script:
- source /opt/rh/devtoolset-8/enable
test freebsd12 clang-7:
<<: *freebsd_deps
<<: *test_run
variables:
DISTRO: freebsd12
COMPILER: clang-7
COMPILER_PACKAGE: llvm70
CC: clang
CXX: clang++
test freebsd12 gcc-8:
<<: *freebsd_deps
<<: *test_run
variables:
DISTRO: freebsd12
COMPILER: gcc-8
COMPILER_PACKAGE: gcc
CC: gcc
CXX: g++
check clang-tidy:
<<: *test_stages
variables:
COMPILER: clang-7
DISTRO: ubuntu
CC: clang-7
CXX: clang++-7
2019-02-23 02:57:10 +00:00
script:
- mkdir build
2019-02-23 02:57:10 +00:00
- cd build
- >
cmake
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DMAINTAINER_MODE=ON
-DCHECK_CODE_QUALITY=ON
..
- make -j4
- make -j4 check-clang-tidy
2019-02-23 02:57:10 +00:00
check clang-format:
<<: *test_stages
variables:
COMPILER: clang-7
DISTRO: ubuntu
CC: clang-7
CXX: clang++-7
2019-02-23 02:57:58 +00:00
script:
- mkdir build
2019-02-23 02:57:58 +00:00
- cd build
- >
cmake
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DMAINTAINER_MODE=ON
-DCHECK_CODE_QUALITY=ON
..
- make -j4 check-clang-format
2019-02-24 15:24:32 +00:00
.push_base_images: &push_base_images
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
- unknown_failure
- api_failure
2019-02-24 15:24:32 +00:00
stage: deploy
image: docker:stable
services:
- docker:dind
only:
refs:
- master
- tags
before_script:
- export DOCKER_HOST="${DOCKER_HOST:-tcp://localhost:2375/}"
2019-02-24 15:24:32 +00:00
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
2019-02-24 15:24:32 +00:00
- set -- $CI_JOB_NAME
- export DISTRO=$2
- 'echo "Distro: ${DISTRO}"'
- docker pull $CI_REGISTRY_IMAGE/builder/$DISTRO-base:$CI_COMMIT_SHA
- >
docker tag $CI_REGISTRY_IMAGE/builder/$DISTRO-base:$CI_COMMIT_SHA
$CI_REGISTRY_IMAGE/builder/$DISTRO-base:latest
2019-02-24 15:24:32 +00:00
- docker push $CI_REGISTRY_IMAGE/builder/$DISTRO-base:latest
push ubuntu base: *push_base_images
push centos6 base: *push_base_images
push centos7 base: *push_base_images
push fedora base: *push_base_images
.push_images: &push_images
<<: *push_base_images
only:
refs:
- master
- tags
script:
- set -- $CI_JOB_NAME
- export DISTRO=$2
- export COMPILER=$3
- "echo \"Distro: ${DISTRO}\nCompiler: ${COMPILER}\""
- docker pull $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA
- >
docker tag $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:$CI_COMMIT_SHA
$CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest
2019-02-24 15:24:32 +00:00
- docker push $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest
push ubuntu clang-7: *push_images
push ubuntu clang-8: *push_images
push ubuntu gcc-5: *push_images
push ubuntu gcc-6: *push_images
push ubuntu gcc-7: *push_images
push ubuntu gcc-8: *push_images
push fedora gcc-8: *push_images
push fedora clang-7: *push_images
push centos6 gcc-7: *push_images
push centos7 gcc-7: *push_images
push centos7 gcc-8: *push_images
push centos7 clang-5: *push_images