Skip to content

Commit

Permalink
improve ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Oct 31, 2023
1 parent 5d19e03 commit d732d8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/mocha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,18 @@ jobs:
github-token: '${{ secrets.GITHUB_TOKEN }}'

test-browser:
name: 'Browser Tests'
name: Browser Tests on SauceLabs [${{ matrix.browser }}]
needs: smoke
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
browser:
- ChromeDebug
- firefox@latest
- chrome@latest
- MicrosoftEdge@latest
- safari@latest
# Don't run forked 'pull_request' without saucelabs token
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
steps:
Expand All @@ -165,3 +173,4 @@ jobs:
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
BROWSER: ${{ matrix.browser }}
8 changes: 8 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const rollupPlugin = require('./scripts/karma-rollup-plugin');
const BASE_BUNDLE_DIR_PATH = path.join(__dirname, '.karma');
const env = process.env;
const hostname = os.hostname();
const BROWSER = env.BROWSER;

const SAUCE_BROWSER_PLATFORM_MAP = {
'chrome@latest': 'Windows 10',
Expand Down Expand Up @@ -120,6 +121,13 @@ module.exports = config => {
files: [...cfg.files, {pattern: './mocha.js.map', included: false}]
};

if (BROWSER) {
cfg = {
...cfg,
browsers: [BROWSER]
};
}

config.set(cfg);
};

Expand Down

0 comments on commit d732d8d

Please sign in to comment.