Skip to content

Commit 7544c4f

Browse files
authored
feat: Add codecov (#1362)
1 parent 5d12cc1 commit 7544c4f

File tree

5 files changed

+136
-2775
lines changed

5 files changed

+136
-2775
lines changed

.travis.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@ cache:
1313
before_install:
1414
- curl -o- -L https://yarnpkg.com/install.sh | bash
1515
- export PATH="$HOME/.yarn/bin:$PATH"
16-
16+
before_script:
17+
- |
18+
CHANGES=$(git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD master))
19+
if [ -n "$(grep 'raven-js' <<< "$CHANGES")" ]; then
20+
RAVEN_JS_CHANGES=true
21+
fi
22+
FORCE=$(git log --format=%B --no-merges -n 1)
23+
if [ -n "$(grep '\[force ci\]' <<< "$FORCE")" ]; then
24+
RAVEN_JS_CHANGES=true
25+
fi
1726
matrix:
1827
include:
1928
- env: NAME="raven-js"
@@ -27,14 +36,12 @@ matrix:
2736
cd packages/raven-js
2837
npm install
2938
npm run test
30-
if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
31-
npm run test:ci;
32-
else
33-
exit 0;
39+
if [[ ("$RAVEN_JS_CHANGES" = "true" || "$TRAVIS_PULL_REQUEST" = "false" ) && "$TRAVIS_SECURE_ENV_VARS" = "true" ]]; then
40+
npm run test:ci
3441
fi
3542
- env: NAME="@sentry -> lint"
3643
script: yarn build && yarn lint
3744
- env: NAME="@sentry -> test"
3845
addons:
3946
chrome: stable
40-
script: yarn build && yarn test
47+
script: yarn build && yarn test && yarn codecov

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"clean": "lerna run --stream clean",
66
"fix": "lerna run --stream --concurrency 1 fix",
77
"lint": "lerna run --stream --concurrency 1 lint",
8-
"test": "lerna run --stream --concurrency 1 --sort test"
8+
"test": "lerna run --stream --concurrency 1 --sort test",
9+
"codecov": "codecov"
910
},
1011
"workspaces": [
1112
"packages/browser",
@@ -24,6 +25,7 @@
2425
"@types/raven": "^2.5.1",
2526
"@types/sinon": "^4.3.1",
2627
"chai": "^4.1.2",
28+
"codecov": "^3.0.2",
2729
"jest": "^22.4.3",
2830
"karma-sinon": "^1.0.5",
2931
"lerna": "^2.11.0",

packages/core/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"exclude": ["dist"],
55
"compilerOptions": {
66
"rootDir": ".",
7-
"types": ["node", "jest", "chai", "sinon"],
7+
"types": ["node", "jest"],
88
"plugins": [{ "name": "tslint-language-service" }]
99
}
1010
}

packages/node/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"exclude": ["dist"],
55
"compilerOptions": {
66
"rootDir": ".",
7-
"types": ["node", "jest", "chai", "sinon"],
7+
"types": ["node", "jest"],
88
"plugins": [{ "name": "tslint-language-service" }]
99
}
1010
}

0 commit comments

Comments
 (0)