-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
36 lines (35 loc) · 1.88 KB
/
circle.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
machine:
node:
version: 5.6.0
environment:
ENABLE_HLR_LOOKUPS: false
HLR_LOOKUPS_USERNAME: testUname
HLR_LOOKUPS_PASSWORD: testPwd
SMSAPI_USERNAME: testUname
SMSAPI_HASHED_PASSWORD: testHashPwd
general:
branches:
ignore:
- gh-pages # list of branches to ignore
- /release\/.*/ # or ignore regexes
dependencies:
pre:
- wget http://repo1.maven.org/maven2/org/codehaus/sonar/runner/sonar-runner-dist/2.4/sonar-runner-dist-2.4.zip
- unzip sonar-runner-dist-2.4.zip
test:
pre:
- npm prune
- npm install mocha-junit-reporter junit-viewer
- sed '/sonar.projectVersion/d' ./sonar-project.properties > tmp && mv tmp sonar-project.properties
- echo sonar.projectVersion=`cat package.json | python -c "import json,sys;obj=json.load(sys.stdin);print obj['version'];"` >> sonar-project.properties
override:
- node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- --recursive tests --timeout=5000 --reporter=mocha-junit-reporter
- node_modules/.bin/junit-viewer --results=test-results.xml --save=test-results.html
post:
- if [[ "$CIRCLE_BRANCH" = "develop" ]]; then sonar-runner-2.4/bin/sonar-runner -X -e -Dsonar.analysis.mode=publish -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASS; fi
- if [[ -n "$CI_PULL_REQUEST" ]]; then sonar-runner-2.4/bin/sonar-runner -X -e -Dsonar.analysis.mode=preview -Dsonar.github.pullRequest=$(basename $CI_PULL_REQUEST) -Dsonar.github.repository=$REPO_SLUG -Dsonar.github.oauth=$GITHUB_TOKEN -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASS -Dsonar.host.url=$SONAR_HOST_URL; fi
- rm -rf sonar-runner-2.4 sonar-runner-dist-2.4.zip
- cp -f -v ./test-results.xml $CIRCLE_ARTIFACTS
- mkdir -p $CIRCLE_TEST_REPORTS/junit
- mv -f -v ./test-results.xml $CIRCLE_TEST_REPORTS/junit
- mv -f -v ./test-results.html $CIRCLE_ARTIFACTS