aboutsummaryrefslogtreecommitdiffhomepage
path: root/.travis.yml
blob: ea6ffc518096b7597db3b18fa57e52905e024513 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
language: c
# Use the latest Travis images since they are more up to date than the stable release.
group: edge

before_script:
 - export -f travis_fold

script:
 - "bash -ex .travis-ci.sh"

addons:
  apt:
    packages: &base_build
     # This is the absolute minimum for configure to pass
     # Non C++ based tasks use it so they can run make builtfiles
     - ccache
    packages: &core_build
     # This is all the bits we need to enable all options
     - *base_build
     - libasound2-dev
     - libevdev-dev
     - libola-dev
     - libjack-jackd2-dev
     - liblua5.3-dev
     - libssl-dev
    packages: &core_build_gpp_latest
     - *core_build
     - gcc-8
     - g++-8
    packages: &core_build_clang_latest
     - *core_build
     - clang-6.0
    packages: &core_build_windows
     - *core_build
     - mingw-w64


matrix:
  fast_finish: true
  include:
    - os: osx
      osx_image: xcode10.2
      compiler: clang
      env:
      - TASK='compile'
    - os: osx
      osx_image: xcode10.2
      compiler: gcc
      env:
      - TASK='compile'
    - os: osx
      osx_image: xcode10.2
      compiler: clang
      env:
      - TASK='sanitize'
    - os: linux
      dist: xenial
      compiler: clang
      env: TASK='compile'
      addons:
        apt:
          packages:
           - *core_build_clang_latest
          sources:
           - ubuntu-toolchain-r-test
           - llvm-toolchain-xenial-6.0
    - os: linux
      dist: xenial
      compiler: gcc
      env: TASK='compile'
      addons:
        apt:
          packages:
           - *core_build_gpp_latest
          sources:
           - ubuntu-toolchain-r-test
    - os: linux
      dist: xenial
      compiler: mingw32-gcc
      env: 
        - TASK='windows'
        - CC='x86_64-w64-mingw32-gcc'
      addons:
        apt:
          packages:
           - *core_build_windows
          sources:
           - ubuntu-toolchain-r-test
    - os: linux
      dist: xenial
      compiler: clang
      env: TASK='sanitize'
      addons:
        apt:
          packages:
           - *core_build_clang_latest
          sources:
           - ubuntu-toolchain-r-test
           - llvm-toolchain-xenial-6.0
    - os: linux
      dist: xenial
      compiler: gcc
      env: TASK='coverity'
      addons:
        apt:
          packages:
           # Coverity doesn't work with g++-5 or g++-6 yet
           - *core_build
           - gcc-4.9
          sources:
           - ubuntu-toolchain-r-test
    - os: linux
      dist: xenial
      env: TASK='spellintian'
      addons:
        apt:
          packages:
           - *core_build
           - moreutils
    - os: linux
      dist: xenial
      env: TASK='spellintian-duplicates'
      addons:
        apt:
          packages:
           - *core_build
           - moreutils
    - os: linux
      dist: xenial
      env: TASK='codespell'
      addons:
        apt:
          packages:
           - *core_build
           - moreutils
  allow_failures:
    - os: linux
      dist: xenial
      compiler: gcc
      env: TASK='coverity'
    - os: linux
      dist: xenial
      env: TASK='spellintian-duplicates'
    - os: linux
      dist: xenial
      env: TASK='codespell'

env:
  global:
   # No colours in terminal (to reduce log file size)
   - TERM=dumb
   # Parallel make build
   - MAKEFLAGS="-j 2"
   # -- BEGIN Coverity Scan ENV
   - COVERITY_SCAN_BUILD_COMMAND_PREPEND="cov-configure --comptype gcc --compiler gcc-4.9 --template"
   # The build command with all of the arguments that you would apply to a manual `cov-build`
   # Usually this is the same as STANDARD_BUILD_COMMAND, excluding the automated test arguments
   - COVERITY_SCAN_BUILD_COMMAND="make"
   # Name of the project
   - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
   # Email address for notifications related to this build
   # - COVERITY_SCAN_NOTIFICATION_EMAIL=""
   # Regular expression selects on which branches to run analysis
   # Be aware of quotas. Do not run on every branch/commit
   - COVERITY_SCAN_BRANCH_PATTERN=".*"
   # COVERITY_SCAN_TOKEN via "travis encrypt" using the repo's public key
   # - secure: ""
   # -- END Coverity Scan ENV

cache:
  apt: true
  directories:
    - $HOME/.ccache # ccache cache

before_cache:
  - ccache -s # see how many hits ccache got

install:
  - if [ "$TASK" = "codespell" ]; then pip install --user git+https://github.com/codespell-project/codespell.git; fi

before_install:
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
# 'brew install' sometimes returns non-zero for some arcane reason. Executing 'true' resets the exit code and allows Travis to continue building...
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua openssl jack; true; fi
# OpenSSL is not a proper install due to some Apple bull, so provide additional locations via the environment...
# Additionally, newer versions of this "recipe" seem to use the name 'openssl@1.1' instead of plain 'openssl' and there seems to be
# no way to programmatically get the link and include paths. Genius! Hardcoding the new version for the time being...
 - export CFLAGS="$CFLAGS -I/usr/local/opt/openssl@1.1/include"
 - export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl@1.1/lib" 
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too
#Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that
 - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) -a "$CC" = "gcc" ]; then export CC="ccache gcc-8"; export CXX="ccache g++-8"; fi
#Use the latest clang if we're compiling with clang
 - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CC" = "clang" ]; then export CC="clang-6.0"; export CXX="clang-6.0"; fi
#Report the compiler versions
 - $CC --version
#OS X uses something other than $CXX variable
 - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) ]; then $CXX --version; fi
 - if [ "$TASK" == "spellintian" -o "$TASK" == "spellintian-duplicates" ]; then wget "http://archive.ubuntu.com/ubuntu/pool/main/l/lintian/lintian_2.5.104_all.deb"; sudo dpkg -i lintian_*.deb; sudo apt-get install -f -y; fi # Install a later lintian

after_script:
  - if [ "$TASK" = "coverity" ]; then tail -n 10000 ${TRAVIS_BUILD_DIR}/cov-int/build-log.txt; cat ${TRAVIS_BUILD_DIR}/cov-int/scm_log.txt; fi

deploy:
 provider: releases
 api_key: $GITHUB_TOKEN
 file: ./deployment/*
 skip_cleanup: true
 draft: true
 on:
  tags: true