aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.travis.yml
blob: 5c0b0c68e7b3ca8ad5bb4efbc7fe874921504d97 (plain) (blame)
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
language: cpp
os: linux
dist: bionic

addons:
  apt:
    update: true
    packages:
      - cmake
      - g++-multilib
    sources:
      - sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
        key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'

env:
  global:
    - travis_boost_version=1.71.0
  jobs:
    - configuration=Debug   platform=x86
    - configuration=Release platform=x86
    - configuration=Debug   platform=x64
    - configuration=Release platform=x64

before_script:
  - >-
    ./cmake/boost/build/ci/travis.py
    --link static
    --
    --with-filesystem --with-program_options --with-regex --with-test

script:
  - >-
    ./cmake/cmake/build/ci/travis.py
    --install "$HOME/install"
    --
    -D "CMAKE_TOOLCHAIN_FILE=cmake/cmake/toolchains/gcc-$platform.cmake"
    -D "BOOST_ROOT=$HOME/boost_1_71_0"
    -D "BOOST_LIBRARYDIR=$HOME/boost_1_71_0/stage/$platform/$configuration/lib"
    -D ENABLE_TESTS=ON

  - "$HOME/install/bin/math-server-unit-tests"
  - "$HOME/install/bin/math-server-benchmarks"

jobs:
  fast_finish: true
  include:
    - name: Run clang-format
      if: branch = master
      addons:
        apt:
          update: true
          packages:
            - clang-format-9
          sources:
            - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
              key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
      # Clear before_script:
      before_script:
        - true
      script:
        - ./cmake/tools/clang-format.py --clang-format clang-format-9
    - name: Build and publish multi-arch images
      language: minimal
      addons:
        apt:
          update: true
          # Newer docker for BuildKit/buildx support:
          sources:
            - key_url: 'https://download.docker.com/linux/ubuntu/gpg'
              sourceline: 'deb https://download.docker.com/linux/ubuntu "$(lsb_release -cs)" stable'
          packages:
            - docker-ce
      install:
        # GCR & BuildKit don't work together, e.g.:
        # https://github.com/moby/buildkit/issues/606
        - echo '{}' | sudo tee /etc/docker/daemon.json
        - sudo systemctl restart docker
      # Clear before_script:
      before_script:
        - true
      script: |-
          if [ "$TRAVIS_BRANCH" = master ]; then
              make login && make builder/create && make push
          else
              make builder/create && make buildx
          fi
    - name: Build native images using Compose
      language: minimal
      # Don't install the unnecessary dependencies:
      addons:
        apt:
          update: false
      services:
        - docker
      # Clear before_script:
      before_script:
        - true
      script: make compose-build
    - name: Build native images using Docker
      language: minimal
      # Don't install the unnecessary dependencies:
      addons:
        apt:
          update: false
      services:
        - docker
      # Clear before_script:
      before_script:
        - true
      script: make docker-build