summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: e25aba9f3d77e8949a547eb3e77daad363a274dc (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
x-ccache-setup-steps: &ccache-setup-steps
  - export CCACHE_NOSTATS=1
  - export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
  - export CC='ccache gcc-6'
  - export CXX='ccache g++-6'

os: linux
language: cpp
env:
  global:
    - PYTHON2_VERSION="2.7.15"
    - PYTHON3_VERSION="3.6.7"  # "3.7.1" after #29326 is fixed
    - PYTHON2_CACHE=$HOME/.ccache/py${PYTHON2_VERSION}
    - PYTHON3_CACHE=$HOME/.ccache/py${PYTHON3_VERSION}
cache:
  ccache: true
  directories:
    - ${PYTHON2_CACHE}
    - ${PYTHON3_CACHE}
jobs:
  include:
    - stage: "Compile"
      name: "Compile V8 (py2)"
      addons:
        apt:
          update: true
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
      install: *ccache-setup-steps
      script:
        - pyenv global ${PYTHON2_VERSION}
        - ./configure
        - make -j2 -C out V=1 v8

    - name: "Compile V8 (py3)"
      addons:
        apt:
          update: true
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
      install: *ccache-setup-steps
      script:
        - pyenv global ${PYTHON3_VERSION}
        # - ./configure  # workaround pending #25878
        - python3 configure.py
        - make -j2 -C out V=1 v8

    - name: "Compile Node.js (py2)"
      addons:
        apt:
          update: true
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
      install: *ccache-setup-steps
      script:
        - pyenv global ${PYTHON2_VERSION}
        - ./configure
        - make -j2 V=1
        - cp out/Release/node ${PYTHON2_CACHE}
        - cp out/Release/cctest ${PYTHON2_CACHE}

    - name: "Compile Node.js (py3)"
      addons:
        apt:
          update: true
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
      install: *ccache-setup-steps
      script:
        - pyenv global ${PYTHON3_VERSION}
        # - ./configure  # workaround pending #25878
        - python3 configure.py
        - make -j2 V=1
        - cp out/Release/node ${PYTHON3_CACHE}
        - cp out/Release/cctest ${PYTHON3_CACHE}

    - stage: "Tests"
      name: "Test JS Suites (py2)"
      install:
        - mkdir -p out/Release
        - cp ${PYTHON2_CACHE}/node out/Release/node
      script:
        - pyenv global ${PYTHON2_VERSION}
        - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default

    - name: "Test JS Suites (py3)"
      install:
        - mkdir -p out/Release
        - cp ${PYTHON3_CACHE}/node out/Release/node
      script:
        - pyenv global ${PYTHON3_VERSION}
        - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default

    - name: "Test C++ Suites (py2)"
      install:
        - export CCACHE_NOSTATS=1
        - export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
        - export CC='ccache gcc'
        - export CXX='ccache g++'
        - mkdir -p out/Release
        - cp ${PYTHON2_CACHE}/node out/Release/node
        - ln -fs out/Release/node node
        - cp ${PYTHON2_CACHE}/cctest out/Release/cctest
        - touch config.gypi
      script:
        - pyenv global ${PYTHON2_VERSION}
        - out/Release/cctest
        - make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
        - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api

    - name: "Test C++ Suites (py3)"
      install:
        - export CCACHE_NOSTATS=1
        - export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
        - export CC='ccache gcc'
        - export CXX='ccache g++'
        - mkdir -p out/Release
        - cp ${PYTHON3_CACHE}/node out/Release/node
        - ln -fs out/Release/node node
        - cp ${PYTHON3_CACHE}/cctest out/Release/cctest
        - touch config.gypi
      script:
        - pyenv global ${PYTHON3_VERSION}
        - out/Release/cctest
        - make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
        - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api

    - name: "Linter (py2)"
      language: node_js
      node_js: "node"
      install:
        - pyenv global ${PYTHON2_VERSION}
        - make lint-py-build || true
      script:
        - NODE=$(which node) make lint lint-py

    - name: "Linter (py3)"
      language: node_js
      node_js: "node"
      install:
        - pyenv global ${PYTHON3_VERSION}
        - make lint-py-build || true
      script:
        - NODE=$(which node) make lint lint-py

    - name: "First commit message adheres to guidelines at <a href=\"https://goo.gl/p2fr5Q\">https://goo.gl/p2fr5Q</a>"
      if: type = pull_request
      language: node_js
      node_js: "node"
      script:
        - if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
            bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST};
          fi

  allow_failures:
    - name: "Test C++ Suites (py3)"  # allow_failures pending #29246