Skip to content

Commit 963c388

Browse files
committed
Create local and remote test jobs
1 parent ea29930 commit 963c388

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

.github/workflows/test.yml

+33-17
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,65 @@ jobs:
1010
matrix:
1111
os: [macos-latest, ubuntu-latest, windows-latest]
1212
steps:
13-
- name: 'Checkout'
13+
- name: Checkout
1414
uses: actions/checkout@v2
1515

16-
- name: 'Install'
16+
- name: Install
1717
run: npm ci --ignore-scripts
1818

19-
- name: 'Lint'
19+
- name: Lint
2020
run: npm run lint
2121

22-
- name: 'Build'
22+
- name: Build
2323
run: npm run build
24-
test:
25-
name: Test (${{ matrix.os }})
26-
runs-on: ${{ matrix.os }}
27-
strategy:
28-
matrix:
29-
os: [ubuntu-latest]
24+
25+
test-local:
26+
if: (!secrets.BROWSERSTACK_USERNAME) || (!secrets.BROWSERSTACK_ACCESS_KEY)
27+
name: Test (local)
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
33+
- name: Install
34+
run: npm ci --ignore-scripts
35+
36+
- name: Build
37+
run: npm run build
38+
39+
- name: Run tests locally
40+
run: npm run test
41+
42+
test-remote:
43+
if: secrets.BROWSERSTACK_USERNAME && secrets.BROWSERSTACK_ACCESS_KEY
44+
name: Test (remote)
45+
runs-on: ubuntu-latest
3046
steps:
31-
- name: 'Checkout'
47+
- name: Checkout
3248
uses: actions/checkout@v2
3349

34-
- name: 'Install'
50+
- name: Install
3551
run: npm ci --ignore-scripts
3652

37-
- name: 'Build'
53+
- name: Build
3854
run: npm run build
3955

40-
- name: 'Setup BrowserStack environment'
56+
- name: Setup BrowserStack environment
4157
uses: browserstack/github-actions/setup-env@master
4258
with:
4359
username: ${{ secrets.BROWSERSTACK_USERNAME }}
4460
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
4561

46-
- name: 'Start BrowserStack tunnel'
62+
- name: Start BrowserStack tunnel
4763
uses: browserstack/github-actions/setup-local@master
4864
with:
4965
local-testing: start
5066
local-identifier: random
5167

52-
- name: 'Run tests on BrowserStack'
68+
- name: Run tests on BrowserStack
5369
run: npm run test-remote
5470

55-
- name: 'Stop BrowserStack tunnel'
71+
- name: Stop BrowserStack tunnel
5672
uses: browserstack/github-actions/setup-local@master
5773
with:
5874
local-testing: stop

0 commit comments

Comments
 (0)