File: .travis.yml

package info (click to toggle)
node-cors 2.8.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 152 kB
  • sloc: makefile: 4
file content (56 lines) | stat: -rw-r--r-- 1,380 bytes parent folder | download
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
language: node_js
node_js:
  - "0.10"
  - "4.9"
  - "6.14"
  - "8.12"
  - "10.11"
sudo: false
cache:
  directories:
    - node_modules
before_install:
  # Configure npm
  - |
    # Skip updating shrinkwrap / lock
    npm config set shrinkwrap false
  # Setup Node.js version-specific dependencies
  - |
    # mocha for testing
    # - use 3.x for Node.js < 6
    if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
      npm install --save-dev mocha@3.5.3
    fi
  - |
    # nyc for coverage
    # - use 10.x for Node.js < 4
    # - use 11.x for Node.js < 6
    if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then
      npm install --save-dev nyc@10.3.2
    elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
      npm install --save-dev nyc@11.9.0
    fi
  - |
    # supertest for http calls
    # - use 2.0.0 for Node.js < 4
    if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then
      npm install --save-dev supertest@2.0.0
    fi
  # Update Node.js modules
  - |
    # Prune & rebuild node_modules
    if [[ -d node_modules ]]; then
      npm prune
      npm rebuild
    fi
script:
  - |
    # Run test script
    npm test
after_script:
  - |
    # Upload coverage to coveralls if exists
    if [[ -d .nyc_output ]]; then
      npm install --save-dev coveralls@2
      nyc report --reporter=text-lcov | coveralls
    fi