ab6fe298c768d937444ed4cd56aacb1ab7cd77e0
[thirdparty/systemd.git] / .travis.yml
1 sudo: required
2 dist: xenial
3 services:
4     - docker
5
6 env:
7     global:
8         - AUTHOR_EMAIL="$(git log -1 $TRAVIS_COMMIT --pretty=\"%aE\")"
9         - CI_MANAGERS="$TRAVIS_BUILD_DIR/travis-ci/managers"
10         - CI_TOOLS="$TRAVIS_BUILD_DIR/travis-ci/tools"
11         - REPO_ROOT="$TRAVIS_BUILD_DIR"
12
13 stages:
14     # Run Coverity periodically instead of for each commit/PR
15     - name: Coverity
16       if: type = cron
17
18 jobs:
19     include:
20         - stage: Build & test
21           name: Debian Testing
22           language: bash
23           env:
24               - DEBIAN_RELEASE="testing"
25               - CONT_NAME="systemd-debian-$DEBIAN_RELEASE"
26               - DOCKER_EXEC="docker exec -ti $CONT_NAME"
27           before_install:
28               - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
29               - docker --version
30           install:
31               - $CI_MANAGERS/debian.sh SETUP
32           script:
33               - set -e
34               # Build systemd
35               - $CI_MANAGERS/debian.sh RUN
36               - set +e
37           after_script:
38               - $CI_MANAGERS/debian.sh CLEANUP
39
40         - name: Debian Testing (ASan+UBSan)
41           language: bash
42           env:
43               - DEBIAN_RELEASE="testing"
44               - CONT_NAME="systemd-debian-$DEBIAN_RELEASE"
45               - DOCKER_EXEC="docker exec -ti $CONT_NAME"
46           before_install:
47               - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
48               - docker --version
49           install:
50               - $CI_MANAGERS/debian.sh SETUP
51           script:
52               - set -e
53               - $CI_MANAGERS/debian.sh RUN_ASAN
54               - set +e
55           after_script:
56               - $CI_MANAGERS/debian.sh CLEANUP
57
58         - name: Debian Testing (clang)
59           language: bash
60           env:
61               - DEBIAN_RELEASE="testing"
62               - CONT_NAME="systemd-debian-$DEBIAN_RELEASE"
63               - DOCKER_EXEC="docker exec -ti $CONT_NAME"
64           before_install:
65               - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
66               - docker --version
67           install:
68               - $CI_MANAGERS/debian.sh SETUP
69           script:
70               - set -e
71               - $CI_MANAGERS/debian.sh RUN_CLANG
72               - set +e
73           after_script:
74               - $CI_MANAGERS/debian.sh CLEANUP
75
76         - name: Debian Testing (clang ASan+UBSan)
77           language: bash
78           env:
79               - DEBIAN_RELEASE="testing"
80               - CONT_NAME="systemd-debian-$DEBIAN_RELEASE"
81               - DOCKER_EXEC="docker exec -ti $CONT_NAME"
82           before_install:
83               - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
84               - docker --version
85           install:
86               - $CI_MANAGERS/debian.sh SETUP
87           script:
88               - set -e
89               - $CI_MANAGERS/debian.sh RUN_CLANG_ASAN
90               - set +e
91           after_script:
92               - $CI_MANAGERS/debian.sh CLEANUP
93
94         - stage: Coverity
95           language: bash
96           env:
97               - FEDORA_RELEASE="latest"
98               - CONT_NAME="coverity-fedora-$FEDORA_RELEASE"
99               - DOCKER_EXEC="docker exec -ti $CONT_NAME"
100               - TOOL_BASE="/var/tmp/coverity-scan-analysis"
101               - DOCKER_RUN="docker run -v $TOOL_BASE:$TOOL_BASE:rw --env-file .cov-env"
102               # Coverity env variables
103               - PLATFORM="$(uname)"
104               - TOOL_ARCHIVE="/var/tmp/cov-analysis-$PLATFORM.tgz
105               - SCAN_URL="https://scan.coverity.com"
106               - UPLOAD_URL="https://scan.coverity.com/builds"
107               - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
108               - COVERITY_SCAN_NOTIFICATION_EMAIL="${AUTHOR_EMAIL}"
109               - COVERITY_SCAN_BRANCH_PATTERN="$TRAVIS_BRANCH"
110               # Encrypted COVERITY_SCAN_TOKEN env variable
111               # Generated using `travis encrypt -r systemd/systemd COVERITY_SCAN_TOKEN=xxxx`
112               - secure: "jKSz+Y1Mv8xMpQHh7g5lzW7E6HQGndFz/vKDJQ1CVShwFoyjV3Zu+MFS3UYKlh1236zL0Z4dvsYFx/b3Hq8nxZWCrWeZs2NdXgy/wh8LZhxwzcGYigp3sIA/cYdP5rDjFJO0MasNkl25/rml8+eZWz+8/xQic98UQHjSco/EOWtssoRcg0J0c4eDM7bGLfIQWE73NNY1Q1UtWjKmx1kekVrM8dPmHXJ9aERka7bmcbJAcKd6vabs6DQ5AfWccUPIn/EsRYqIJTRxJrFYU6XizANZ1a7Vwk/DWHZUEn2msxcZw5BbAMDTMx0TbfrNkKSHMHuvQUCu6KCBAq414i+LgkMfmQ2SWwKiIUsud1kxXX3ZPl9bxDv1HkvVdcniC/EM7lNEEVwm4meOnjuhI2lhOyOjmP3FTSlMHGP7xlK8DS2k9fqL58vn0BaSjwWgd+2+HuL2+nJmxcK1eLGzKqaostFxrk2Xs2vPZkUdV2nWY/asUrcWHml6YlWDn2eP83pfwxHYsMiEHY/rTKvxeVY+iirO/AphoO+eaYu7LvjKZU1Yx5Z4u/SnGWAiCH0yhMis0bWmgi7SCbw+sDd2uya+aoiLIGiB2ChW7hXHXCue/dif6/gLU7b+L8R00pQwnWdvKUPoIJCmZJYCluTeib4jpW+EmARB2+nR8wms2K9FGKM="
113           before_install:
114               - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
115               - docker --version
116           install:
117               # Install Coverity on the host
118               - $CI_TOOLS/get-coverity.sh
119               # Export necessary env variables for Coverity
120               - env | grep -E "TRAVIS|COV|TOOL|URL" > .cov-env
121               # Pull a Docker image and start a new container
122               - $CI_MANAGERS/fedora.sh SETUP
123           script:
124               - set -e
125               # Preconfigure with meson to prevent Coverity from capturing meson metadata
126               # Set compiler flag to prevent emit failure
127               - $DOCKER_EXEC sh -c "CFLAGS='-D_Float128=long\ double -D_Float64=double -D_Float64x=long\ double -D_Float32=float -D_Float32x=double' meson cov-build -Dman=false"
128               # Run Coverity
129               - $DOCKER_EXEC tools/coverity.sh build
130               - $DOCKER_EXEC tools/coverity.sh upload
131
132               - set +e
133           after_script:
134               - $CI_MANAGERS/fedora.sh CLEANUP