@@ -10,49 +10,65 @@ jobs:
10
10
matrix :
11
11
os : [macos-latest, ubuntu-latest, windows-latest]
12
12
steps :
13
- - name : ' Checkout'
13
+ - name : Checkout
14
14
uses : actions/checkout@v2
15
15
16
- - name : ' Install'
16
+ - name : Install
17
17
run : npm ci --ignore-scripts
18
18
19
- - name : ' Lint'
19
+ - name : Lint
20
20
run : npm run lint
21
21
22
- - name : ' Build'
22
+ - name : Build
23
23
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
30
46
steps :
31
- - name : ' Checkout'
47
+ - name : Checkout
32
48
uses : actions/checkout@v2
33
49
34
- - name : ' Install'
50
+ - name : Install
35
51
run : npm ci --ignore-scripts
36
52
37
- - name : ' Build'
53
+ - name : Build
38
54
run : npm run build
39
55
40
- - name : ' Setup BrowserStack environment'
56
+ - name : Setup BrowserStack environment
41
57
uses : browserstack/github-actions/setup-env@master
42
58
with :
43
59
username : ${{ secrets.BROWSERSTACK_USERNAME }}
44
60
access-key : ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
45
61
46
- - name : ' Start BrowserStack tunnel'
62
+ - name : Start BrowserStack tunnel
47
63
uses : browserstack/github-actions/setup-local@master
48
64
with :
49
65
local-testing : start
50
66
local-identifier : random
51
67
52
- - name : ' Run tests on BrowserStack'
68
+ - name : Run tests on BrowserStack
53
69
run : npm run test-remote
54
70
55
- - name : ' Stop BrowserStack tunnel'
71
+ - name : Stop BrowserStack tunnel
56
72
uses : browserstack/github-actions/setup-local@master
57
73
with :
58
74
local-testing : stop
0 commit comments