forked from Mastercard/client-encryption-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
40 lines (40 loc) · 1.48 KB
/
.travis.yml
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
language: node_js
git:
depth: false # "Shallow clone detected during the analysis"
matrix:
fast_finish: true
include:
- node_js: 6.12.3
- node_js: 6
- node_js: 7
- node_js: 8
- node_js: 9
- node_js: 10
- node_js: 11
- node_js: node # latest stable release
- node_js: "lts/*" # latest LTS release
env:
# Do not run analysis on PR (secure env variables like SONAR_TOKEN are not always available)
- WITH_SONAR_ANALYSIS=$([ "$TRAVIS_PULL_REQUEST" = "false" ] && echo true || echo false)
- SONAR_SCANNER_VERSION=3.3.0.1492
install:
- npm install
- |
test "$WITH_SONAR_ANALYSIS" = "true" \
&& wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip \
&& unzip sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip || echo 'Skipping Sonar Scanner installation'
script:
- npm test
- npm run coverage
after_success:
- |
test "$WITH_SONAR_ANALYSIS" = "true" && sonar-scanner-$SONAR_SCANNER_VERSION/bin/sonar-scanner \
-Dsonar.projectName=$SONAR_PROJECT_NAME \
-Dsonar.projectKey=$SONAR_PROJECT_KEY \
-Dsonar.organization=$SONAR_ORGANIZATION_KEY \
-Dsonar.sources=./lib \
-Dsonar.tests=./test \
-Dsonar.testExecutionReportPaths=test-results.xml \
-Dsonar.javascript.lcov.reportPaths=.nyc_output/coverage.lcov \
-Dsonar.host.url=$SONAR_URL \
-Dsonar.login=$SONAR_TOKEN || echo 'Skipping Sonar Scanner execution'