Skip to content

Commit 33ccec3

Browse files
committed
Fix coverage reporting for CI
1 parent 69c7ae2 commit 33ccec3

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ jobs:
3636
- name: Run browser tests in Saucelabs
3737
run: npm run test-ci
3838
timeout-minutes: 5
39+
- name: Install lcov
40+
run: |
41+
sudo apt update
42+
sudo apt install lcov
43+
- name: Merge lcov reports
44+
run: find coverage -name lcov.info -exec echo -a \"{}\" \; | xargs lcov -o coverage/lcov.info
45+
- name: Coveralls
46+
uses: coverallsapp/github-action@master
47+
with:
48+
github-token: ${{ secrets.github_token }}

karma.conf.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,28 @@ module.exports = function (config) {
66
'stackframe.js',
77
'spec/*-spec.js'
88
],
9-
reporters: ['spec'],
109
port: 9876,
1110
colors: true,
1211
logLevel: config.LOG_INFO,
1312
autoWatch: true,
1413
customLaunchers: {
15-
Chrome_Travis: {
14+
Chrome_No_Sandbox: {
1615
base: 'Chrome',
1716
flags: ['--no-sandbox']
1817
}
1918
},
2019
browsers: ['PhantomJS'],
20+
reporters: ['spec', 'saucelabs', 'coverage', 'coveralls'],
21+
preprocessors: {
22+
'error-stack-parser.js': 'coverage'
23+
},
24+
coverageReporter: {
25+
type: 'lcov',
26+
dir: 'coverage',
27+
subdir: function(browser) {
28+
return browser.toLowerCase().split(/[ /-]/)[0];
29+
}
30+
},
2131
singleRun: false
2232
});
2333
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"scripts": {
4545
"lint": "eslint",
4646
"test": "karma start karma.conf.js --single-run",
47-
"test-pr": "karma start karma.conf.js --single-run --browsers Firefox,Chrome_Travis",
47+
"test-pr": "karma start karma.conf.js --single-run --browsers Firefox,Chrome_No_Sandbox",
4848
"test-ci": "karma start karma.conf.ci.js --single-run",
4949
"prepare": "cp stackframe.js dist/ && uglifyjs stackframe.js -o dist/stackframe.min.js --compress --mangle --source-map \"url=stackframe.min.js.map\""
5050
}

0 commit comments

Comments
 (0)