Skip to content

Commit 391a978

Browse files
committed
run first chrome headless, then on saucelabs
1 parent d732d8d commit 391a978

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

.github/workflows/mocha.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,44 @@ jobs:
137137
with:
138138
github-token: '${{ secrets.GITHUB_TOKEN }}'
139139

140-
test-browser:
141-
name: Browser Tests on SauceLabs [${{ matrix.browser }}]
140+
test-browser-local:
141+
name: Browser Test
142142
needs: smoke
143143
runs-on: ubuntu-latest
144144
timeout-minutes: 20
145+
# Don't run forked 'pull_request' without saucelabs token
146+
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
147+
steps:
148+
- uses: actions/setup-node@v4
149+
with:
150+
node-version: lts/*
151+
- uses: actions/checkout@v4
152+
with:
153+
persist-credentials: false
154+
- name: 'Cache node_modules'
155+
uses: actions/cache@v3
156+
with:
157+
path: '~/.npm'
158+
# this key is different than above, since we are running scripts
159+
# (builds, postinstall lifecycle hooks, etc.)
160+
key: "ubuntu-latest-node-full-lts-${{ hashFiles('**/package-lock.json') }}"
161+
- name: Install Dependencies
162+
run: npm ci
163+
- name: Run Browser Tests
164+
run: npm start test.browser
165+
env:
166+
BROWSER: ChromeDebug
167+
168+
test-browser-saucelabs:
169+
name: Browser Tests on SauceLabs [${{ matrix.browser }}]
170+
needs:
171+
- smoke
172+
- test-browser-local
173+
runs-on: ubuntu-latest
174+
timeout-minutes: 20
145175
strategy:
146176
matrix:
147177
browser:
148-
- ChromeDebug
149178
- firefox@latest
150179
- chrome@latest
151180
- MicrosoftEdge@latest

0 commit comments

Comments
 (0)