summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: ab6fe298c768d937444ed4cd56aacb1ab7cd77e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
sudo: required
dist: xenial
services:
    - docker

env:
    global:
        - AUTHOR_EMAIL="$(git log -1 $TRAVIS_COMMIT --pretty=\"%aE\")"
        - CI_MANAGERS="$TRAVIS_BUILD_DIR/travis-ci/managers"
        - CI_TOOLS="$TRAVIS_BUILD_DIR/travis-ci/tools"
        - REPO_ROOT="$TRAVIS_BUILD_DIR"

stages:
    # Run Coverity periodically instead of for each commit/PR
    - name: Coverity
      if: type = cron

jobs:
    include:
        - stage: Build & test
          name: Debian Testing
          language: bash
          env:
              - DEBIAN_RELEASE="testing"
              - CONT_NAME="systemd-debian-$DEBIAN_RELEASE"
              - DOCKER_EXEC="docker exec -ti $CONT_NAME"
          before_install:
              - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
              - docker --version
          install:
              - $CI_MANAGERS/debian.sh SETUP
          script:
              - set -e
              # Build systemd
              - $CI_MANAGERS/debian.sh RUN
              - set +e
          after_script:
              - $CI_MANAGERS/debian.sh CLEANUP

        - name: Debian Testing (ASan+UBSan)
          language: bash
          env:
              - DEBIAN_RELEASE="testing"
              - CONT_NAME="systemd-debian-$DEBIAN_RELEASE"
              - DOCKER_EXEC="docker exec -ti $CONT_NAME"
          before_install:
              - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
              - docker --version
          install:
              - $CI_MANAGERS/debian.sh SETUP
          script:
              - set -e
              - $CI_MANAGERS/debian.sh RUN_ASAN
              - set +e
          after_script:
              - $CI_MANAGERS/debian.sh CLEANUP

        - name: Debian Testing (clang)
          language: bash
          env:
              - DEBIAN_RELEASE="testing"
              - CONT_NAME="systemd-debian-$DEBIAN_RELEASE"
              - DOCKER_EXEC="docker exec -ti $CONT_NAME"
          before_install:
              - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
              - docker --version
          install:
              - $CI_MANAGERS/debian.sh SETUP
          script:
              - set -e
              - $CI_MANAGERS/debian.sh RUN_CLANG
              - set +e
          after_script:
              - $CI_MANAGERS/debian.sh CLEANUP

        - name: Debian Testing (clang ASan+UBSan)
          language: bash
          env:
              - DEBIAN_RELEASE="testing"
              - CONT_NAME="systemd-debian-$DEBIAN_RELEASE"
              - DOCKER_EXEC="docker exec -ti $CONT_NAME"
          before_install:
              - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
              - docker --version
          install:
              - $CI_MANAGERS/debian.sh SETUP
          script:
              - set -e
              - $CI_MANAGERS/debian.sh RUN_CLANG_ASAN
              - set +e
          after_script:
              - $CI_MANAGERS/debian.sh CLEANUP

        - stage: Coverity
          language: bash
          env:
              - FEDORA_RELEASE="latest"
              - CONT_NAME="coverity-fedora-$FEDORA_RELEASE"
              - DOCKER_EXEC="docker exec -ti $CONT_NAME"
              - TOOL_BASE="/var/tmp/coverity-scan-analysis"
              - DOCKER_RUN="docker run -v $TOOL_BASE:$TOOL_BASE:rw --env-file .cov-env"
              # Coverity env variables
              - PLATFORM="$(uname)"
              - TOOL_ARCHIVE="/var/tmp/cov-analysis-$PLATFORM.tgz
              - SCAN_URL="https://scan.coverity.com"
              - UPLOAD_URL="https://scan.coverity.com/builds"
              - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
              - COVERITY_SCAN_NOTIFICATION_EMAIL="${AUTHOR_EMAIL}"
              - COVERITY_SCAN_BRANCH_PATTERN="$TRAVIS_BRANCH"
              # Encrypted COVERITY_SCAN_TOKEN env variable
              # Generated using `travis encrypt -r systemd/systemd COVERITY_SCAN_TOKEN=xxxx`
              - 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="
          before_install:
              - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
              - docker --version
          install:
              # Install Coverity on the host
              - $CI_TOOLS/get-coverity.sh
              # Export necessary env variables for Coverity
              - env | grep -E "TRAVIS|COV|TOOL|URL" > .cov-env
              # Pull a Docker image and start a new container
              - $CI_MANAGERS/fedora.sh SETUP
          script:
              - set -e
              # Preconfigure with meson to prevent Coverity from capturing meson metadata
              # Set compiler flag to prevent emit failure
              - $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"
              # Run Coverity
              - $DOCKER_EXEC tools/coverity.sh build
              - $DOCKER_EXEC tools/coverity.sh upload

              - set +e
          after_script:
              - $CI_MANAGERS/fedora.sh CLEANUP