diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09e9109..9a4edbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,3 +36,13 @@ jobs: - name: Run browser tests in Saucelabs run: npm run test-ci timeout-minutes: 5 + - name: Install lcov + run: | + sudo apt update + sudo apt install lcov + - name: Merge lcov reports + run: find coverage -name lcov.info -exec echo -a \"{}\" \; | xargs lcov -o coverage/lcov.info + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} diff --git a/karma.conf.js b/karma.conf.js index e57339f..12dde3b 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -6,18 +6,28 @@ module.exports = function (config) { 'stackframe.js', 'spec/*-spec.js' ], - reporters: ['spec'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, customLaunchers: { - Chrome_Travis: { + Chrome_No_Sandbox: { base: 'Chrome', flags: ['--no-sandbox'] } }, browsers: ['PhantomJS'], + reporters: ['spec', 'saucelabs', 'coverage', 'coveralls'], + preprocessors: { + 'error-stack-parser.js': 'coverage' + }, + coverageReporter: { + type: 'lcov', + dir: 'coverage', + subdir: function(browser) { + return browser.toLowerCase().split(/[ /-]/)[0]; + } + }, singleRun: false }); }; diff --git a/package.json b/package.json index 9b6796b..6290b29 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "scripts": { "lint": "eslint", "test": "karma start karma.conf.js --single-run", - "test-pr": "karma start karma.conf.js --single-run --browsers Firefox,Chrome_Travis", + "test-pr": "karma start karma.conf.js --single-run --browsers Firefox,Chrome_No_Sandbox", "test-ci": "karma start karma.conf.ci.js --single-run", "prepare": "cp stackframe.js dist/ && uglifyjs stackframe.js -o dist/stackframe.min.js --compress --mangle --source-map \"url=stackframe.min.js.map\"" }