diff --git a/.github/workflows/mocha.yml b/.github/workflows/mocha.yml index ab063f88df..101b25c1d4 100644 --- a/.github/workflows/mocha.yml +++ b/.github/workflows/mocha.yml @@ -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: @@ -165,3 +173,4 @@ jobs: env: SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} + BROWSER: ${{ matrix.browser }} diff --git a/karma.conf.js b/karma.conf.js index 162328926f..728632151b 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -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', @@ -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); };