1
+ # This workflow performs basic checks:
2
+ #
3
+ # 1. run a preparation step to install and cache node modules
4
+ # 2. once prep succeeds, lint and test run in parallel
5
+ #
6
+ # The checks only run on non-draft Pull Requests. They don't run on the main
7
+ # branch prior to deploy. It's recommended to use branch protection to avoid
8
+ # pushes straight to 'main'.
9
+
1
10
name : Checks
2
- on :
3
- push :
4
- branches :
5
- - main
11
+
12
+ on :
6
13
pull_request :
7
- branches :
8
- - main
14
+ types :
15
+ - opened
16
+ - synchronize
17
+ - reopened
18
+ - ready_for_review
9
19
10
- env :
11
- NODE : 16
20
+ concurrency :
21
+ group : ${{ github.workflow }}-${{ github.ref }}
22
+ cancel-in-progress : true
12
23
13
24
jobs :
14
25
prep :
15
26
if : github.event.pull_request.draft == false
16
27
runs-on : ubuntu-latest
17
28
18
29
steps :
19
- - name : Cancel Previous Runs
20
-
21
- with :
22
- access_token : ${{ github.token }}
23
-
24
30
- name : Checkout
25
- uses : actions/checkout@v2
31
+ uses : actions/checkout@v4
26
32
27
33
- name : Use Node.js ${{ env.NODE }}
28
- uses : actions/setup-node@v1
34
+ uses : actions/setup-node@v4
29
35
with :
30
- node-version : ${{ env.NODE }}
36
+ node-version-file : ' .nvmrc '
31
37
32
38
- name : Cache node_modules
33
- uses : actions/cache@v2
39
+ uses : actions/cache@v4
34
40
id : cache-node-modules
35
41
with :
36
42
path : node_modules
37
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
43
+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
38
44
39
45
- name : Install
40
46
run : yarn install
@@ -45,74 +51,74 @@ jobs:
45
51
46
52
steps :
47
53
- name : Checkout
48
- uses : actions/checkout@v2
54
+ uses : actions/checkout@v4
49
55
50
56
- name : Use Node.js ${{ env.NODE }}
51
- uses : actions/setup-node@v1
57
+ uses : actions/setup-node@v4
52
58
with :
53
- node-version : ${{ env.NODE }}
59
+ node-version-file : ' .nvmrc '
54
60
55
61
- name : Cache node_modules
56
- uses : actions/cache@v2
62
+ uses : actions/cache@v4
57
63
id : cache-node-modules
58
64
with :
59
65
path : node_modules
60
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
66
+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
61
67
62
68
- name : Install
63
69
run : yarn install
64
70
65
71
- name : Lint
66
- run : yarn lint
72
+ run : yarn run lint
67
73
68
74
test :
69
75
needs : prep
70
76
runs-on : ubuntu-latest
71
77
72
78
steps :
73
79
- name : Checkout
74
- uses : actions/checkout@v2
80
+ uses : actions/checkout@v4
75
81
76
82
- name : Use Node.js ${{ env.NODE }}
77
- uses : actions/setup-node@v1
83
+ uses : actions/setup-node@v4
78
84
with :
79
- node-version : ${{ env.NODE }}
85
+ node-version-file : ' .nvmrc '
80
86
81
87
- name : Cache node_modules
82
- uses : actions/cache@v2
88
+ uses : actions/cache@v4
83
89
id : cache-node-modules
84
90
with :
85
91
path : node_modules
86
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
92
+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
87
93
88
94
- name : Install
89
95
run : yarn install
90
96
91
97
- name : Test
92
- run : yarn test
98
+ run : yarn run test
93
99
94
100
build :
95
101
needs : test
96
102
runs-on : ubuntu-latest
97
103
98
104
steps :
99
105
- name : Checkout
100
- uses : actions/checkout@v2
106
+ uses : actions/checkout@v4
101
107
102
108
- name : Use Node.js ${{ env.NODE }}
103
- uses : actions/setup-node@v1
109
+ uses : actions/setup-node@v4
104
110
with :
105
- node-version : ${{ env.NODE }}
111
+ node-version-file : ' .nvmrc '
106
112
107
113
- name : Cache node_modules
108
- uses : actions/cache@v2
114
+ uses : actions/cache@v4
109
115
id : cache-node-modules
110
116
with :
111
117
path : node_modules
112
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
118
+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
113
119
114
120
- name : Install
115
121
run : yarn install
116
122
117
- - name : Test
118
- run : yarn build
123
+ - name : Build
124
+ run : yarn run build
0 commit comments