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+ 
10+ name : Checks 
11+ 
12+ on :
13+   pull_request :
14+     types :
15+       - opened 
16+       - synchronize 
17+       - reopened 
18+       - ready_for_review 
19+ 
20+ concurrency :
21+   group : ${{ github.workflow }}-${{ github.ref }} 
22+   cancel-in-progress : true 
23+ 
24+ jobs :
25+   prep :
26+     if : github.event.pull_request.draft == false 
27+     runs-on : ubuntu-latest 
28+ 
29+     steps :
30+       - name : Checkout 
31+         uses : actions/checkout@v4 
32+ 
33+       - name : Use Node.js ${{ env.NODE }} 
34+         uses : actions/setup-node@v4 
35+         with :
36+           node-version-file : ' .nvmrc' 
37+ 
38+       - name : Cache node_modules 
39+         uses : actions/cache@v4 
40+         id : cache-node-modules 
41+         with :
42+           path : node_modules 
43+           key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }} 
44+ 
45+       - name : Install 
46+         run : npm install 
47+ 
48+   lint :
49+     needs : prep 
50+     runs-on : ubuntu-latest 
51+ 
52+     steps :
53+       - name : Checkout 
54+         uses : actions/checkout@v4 
55+ 
56+       - name : Use Node.js ${{ env.NODE }} 
57+         uses : actions/setup-node@v4 
58+         with :
59+           node-version-file : ' .nvmrc' 
60+ 
61+       - name : Cache node_modules 
62+         uses : actions/cache@v4 
63+         id : cache-node-modules 
64+         with :
65+           path : node_modules 
66+           key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }} 
67+ 
68+       - name : Install 
69+         run : npm install 
70+ 
71+       - name : Lint 
72+         run : npm run lint 
73+ 
74+   test :
75+     needs : prep 
76+     runs-on : ubuntu-latest 
77+ 
78+     steps :
79+       - name : Checkout 
80+         uses : actions/checkout@v4 
81+ 
82+       - name : Use Node.js ${{ env.NODE }} 
83+         uses : actions/setup-node@v4 
84+         with :
85+           node-version-file : ' .nvmrc' 
86+ 
87+       - name : Cache node_modules 
88+         uses : actions/cache@v4 
89+         id : cache-node-modules 
90+         with :
91+           path : node_modules 
92+           key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }} 
93+ 
94+       - name : Install 
95+         run : npm install 
96+ 
97+       - name : Test 
98+         run : npm run test 
99+ 
100+   build :
101+     needs : prep 
102+     runs-on : ubuntu-latest 
103+ 
104+     steps :
105+       - name : Checkout 
106+         uses : actions/checkout@v4 
107+ 
108+       - name : Use Node.js ${{ env.NODE }} 
109+         uses : actions/setup-node@v4 
110+         with :
111+           node-version-file : ' .nvmrc' 
112+ 
113+       - name : Cache node_modules 
114+         uses : actions/cache@v4 
115+         id : cache-node-modules 
116+         with :
117+           path : node_modules 
118+           key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }} 
119+ 
120+       - name : Install 
121+         run : npm install 
122+ 
123+       - name : Test 
124+         run : npm run all:build 
0 commit comments