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+
110name : Checks
2- on :
3- push :
4- branches :
5- - main
11+
12+ on :
613 pull_request :
7- branches :
8- - main
14+ types :
15+ - opened
16+ - synchronize
17+ - reopened
18+ - ready_for_review
919
10- env :
11- NODE : 16
20+ concurrency :
21+ group : ${{ github.workflow }}-${{ github.ref }}
22+ cancel-in-progress : true
1223
1324jobs :
1425 prep :
1526 if : github.event.pull_request.draft == false
1627 runs-on : ubuntu-latest
1728
1829 steps :
19- - name : Cancel Previous Runs
20- 21- with :
22- access_token : ${{ github.token }}
23-
2430 - name : Checkout
25- uses : actions/checkout@v2
31+ uses : actions/checkout@v4
2632
2733 - name : Use Node.js ${{ env.NODE }}
28- uses : actions/setup-node@v1
34+ uses : actions/setup-node@v4
2935 with :
30- node-version : ${{ env.NODE }}
36+ node-version-file : ' .nvmrc '
3137
3238 - name : Cache node_modules
33- uses : actions/cache@v2
39+ uses : actions/cache@v4
3440 id : cache-node-modules
3541 with :
3642 path : node_modules
37- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
43+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
3844
3945 - name : Install
4046 run : yarn install
@@ -45,74 +51,74 @@ jobs:
4551
4652 steps :
4753 - name : Checkout
48- uses : actions/checkout@v2
54+ uses : actions/checkout@v4
4955
5056 - name : Use Node.js ${{ env.NODE }}
51- uses : actions/setup-node@v1
57+ uses : actions/setup-node@v4
5258 with :
53- node-version : ${{ env.NODE }}
59+ node-version-file : ' .nvmrc '
5460
5561 - name : Cache node_modules
56- uses : actions/cache@v2
62+ uses : actions/cache@v4
5763 id : cache-node-modules
5864 with :
5965 path : node_modules
60- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
66+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
6167
6268 - name : Install
6369 run : yarn install
6470
6571 - name : Lint
66- run : yarn lint
72+ run : yarn run lint
6773
6874 test :
6975 needs : prep
7076 runs-on : ubuntu-latest
7177
7278 steps :
7379 - name : Checkout
74- uses : actions/checkout@v2
80+ uses : actions/checkout@v4
7581
7682 - name : Use Node.js ${{ env.NODE }}
77- uses : actions/setup-node@v1
83+ uses : actions/setup-node@v4
7884 with :
79- node-version : ${{ env.NODE }}
85+ node-version-file : ' .nvmrc '
8086
8187 - name : Cache node_modules
82- uses : actions/cache@v2
88+ uses : actions/cache@v4
8389 id : cache-node-modules
8490 with :
8591 path : node_modules
86- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
92+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
8793
8894 - name : Install
8995 run : yarn install
9096
9197 - name : Test
92- run : yarn test
98+ run : yarn run test
9399
94100 build :
95101 needs : test
96102 runs-on : ubuntu-latest
97103
98104 steps :
99105 - name : Checkout
100- uses : actions/checkout@v2
106+ uses : actions/checkout@v4
101107
102108 - name : Use Node.js ${{ env.NODE }}
103- uses : actions/setup-node@v1
109+ uses : actions/setup-node@v4
104110 with :
105- node-version : ${{ env.NODE }}
111+ node-version-file : ' .nvmrc '
106112
107113 - name : Cache node_modules
108- uses : actions/cache@v2
114+ uses : actions/cache@v4
109115 id : cache-node-modules
110116 with :
111117 path : node_modules
112- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
118+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
113119
114120 - name : Install
115121 run : yarn install
116122
117- - name : Test
118- run : yarn build
123+ - name : Build
124+ run : yarn run build
0 commit comments