@@ -37,20 +37,20 @@ jobs:
3737 exit 1
3838 fi
3939
40- - name : Use Node.js ${{ matrix.node-version }}
41- uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
42- with :
43- node-version : ${{ matrix.node-version }}
44- cache : " pnpm"
45-
4640 - name : Install pnpm
4741 uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
4842 id : pnpm-install
4943 with :
5044 run_install : false
5145
46+ - name : Use Node.js ${{ matrix.node-version }}
47+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
48+ with :
49+ node-version : ${{ matrix.node-version }}
50+ cache : " pnpm"
51+
5252 - name : Install dependencies
53- run : pnpm install --frozen-lockfile
53+ run : pnpm install
5454
5555 - name : Check formatting
5656 run : |
@@ -59,53 +59,42 @@ jobs:
5959 - name : Lint
6060 run : pnpm lint
6161
62- type-check :
63- name : Type Check
62+ test :
63+ name : Test
6464 runs-on : ubuntu-22.04
65+
6566 strategy :
67+ fail-fast : false
6668 matrix :
6769 node-version : [22]
6870
6971 steps :
7072 - name : Checkout
7173 uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
7274
73- - name : Use Node.js ${{ matrix.node-version }}
74- uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
75- with :
76- node-version : ${{ matrix.node-version }}
77- cache : " pnpm"
78-
7975 - name : Install pnpm
8076 uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
8177 id : pnpm-install
8278 with :
8379 run_install : false
8480
85- - name : Install dependencies
86- run : pnpm install --frozen-lockfile
87-
88- - name : Cache curriculum data
89- uses : actions/cache@5a5a1f2c0a6815595b0419c1e2d0a0e9c1f2c0a6 # v4
90- id : curriculum-cache
81+ - name : Use Node.js ${{ matrix.node-version }}
82+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
9183 with :
92- path : data/structure
93- key : curriculum-${{ hashFiles('scripts/fetch-curriculum-data.mjs') }}-${{ github.sha }}
94- restore-keys : |
95- curriculum-${{ hashFiles('scripts/fetch-curriculum-data.mjs') }}-
96-
97- - name : Fetch curriculum data
98- if : steps.curriculum-cache.outputs.cache-hit != 'true'
99- run : pnpm fetch-data
84+ node-version : ${{ matrix.node-version }}
85+ cache : " pnpm"
10086
101- - name : Generate GraphQL types
102- run : pnpm codegen
87+ - name : Install Dependencies
88+ run : |
89+ pnpm install
90+ pnpm fetch-data
10391
104- - name : Type check
105- run : pnpm type-check
92+ - name : Run Tests
93+ run : pnpm test
10694
10795 build :
10896 name : Build
97+ needs : [lint, test]
10998 runs-on : ubuntu-22.04
11099 strategy :
111100 matrix :
@@ -115,36 +104,23 @@ jobs:
115104 - name : Checkout
116105 uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
117106
118- - name : Use Node.js ${{ matrix.node-version }}
119- uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
120- with :
121- node-version : ${{ matrix.node-version }}
122- cache : " pnpm"
123-
124107 - name : Install pnpm
125108 uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
126109 id : pnpm-install
127110 with :
128111 run_install : false
129112
130- - name : Install dependencies
131- run : pnpm install --frozen-lockfile
132-
133- - name : Cache curriculum data
134- uses : actions/cache@5a5a1f2c0a6815595b0419c1e2d0a0e9c1f2c0a6 # v4
135- id : curriculum-cache
113+ - name : Use Node.js ${{ matrix.node-version }}
114+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
136115 with :
137- path : data/structure
138- key : curriculum-${{ hashFiles('scripts/fetch-curriculum-data.mjs') }}-${{ github.sha }}
139- restore-keys : |
140- curriculum-${{ hashFiles('scripts/fetch-curriculum-data.mjs') }}-
141-
142- - name : Fetch curriculum data
143- if : steps.curriculum-cache.outputs.cache-hit != 'true'
144- run : pnpm fetch-data
116+ node-version : ${{ matrix.node-version }}
117+ cache : " pnpm"
145118
146- - name : Build project
147- run : pnpm build
119+ - name : Install and Build
120+ run : |
121+ pnpm install
122+ pnpm fetch-data
123+ pnpm build
148124
149125 - name : Upload build artifacts
150126 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
@@ -153,89 +129,34 @@ jobs:
153129 path : packages/server/dist
154130 retention-days : 7
155131
156- test :
157- name : Test
132+ test-coverage :
133+ name : Test Coverage
134+ needs : [lint, test]
158135 runs-on : ubuntu-22.04
159- needs : [lint, type-check, build]
160136 strategy :
161- fail-fast : false
162137 matrix :
163138 node-version : [22]
164139
165140 steps :
166141 - name : Checkout
167142 uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
168143
169- - name : Use Node.js ${{ matrix.node-version }}
170- uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
171- with :
172- node-version : ${{ matrix.node-version }}
173- cache : " pnpm"
174-
175144 - name : Install pnpm
176145 uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
177146 id : pnpm-install
178147 with :
179148 run_install : false
180149
181- - name : Install dependencies
182- run : pnpm install --frozen-lockfile
183-
184- - name : Cache curriculum data
185- uses : actions/cache@5a5a1f2c0a6815595b0419c1e2d0a0e9c1f2c0a6 # v4
186- id : curriculum-cache
187- with :
188- path : data/structure
189- key : curriculum-${{ hashFiles('scripts/fetch-curriculum-data.mjs') }}-${{ github.sha }}
190- restore-keys : |
191- curriculum-${{ hashFiles('scripts/fetch-curriculum-data.mjs') }}-
192-
193- - name : Fetch curriculum data
194- if : steps.curriculum-cache.outputs.cache-hit != 'true'
195- run : pnpm fetch-data
196-
197- - name : Run tests
198- run : pnpm test
199-
200- test-coverage :
201- name : Test Coverage
202- runs-on : ubuntu-22.04
203- needs : [lint, type-check, build]
204- strategy :
205- matrix :
206- node-version : [22]
207-
208- steps :
209- - name : Checkout
210- uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
211-
212150 - name : Use Node.js ${{ matrix.node-version }}
213151 uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
214152 with :
215153 node-version : ${{ matrix.node-version }}
216154 cache : " pnpm"
217155
218- - name : Install pnpm
219- uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
220- id : pnpm-install
221- with :
222- run_install : false
223-
224- - name : Install dependencies
225- run : pnpm install --frozen-lockfile
226-
227- - name : Cache curriculum data
228- uses : actions/cache@5a5a1f2c0a6815595b0419c1e2d0a0e9c1f2c0a6 # v4
229- id : curriculum-cache
230- with :
231- path : data/structure
232- key : curriculum-${{ hashFiles('scripts/fetch-curriculum-data.mjs') }}-${{ github.sha }}
233- restore-keys : |
234- curriculum-${{ hashFiles('scripts/fetch-curriculum-data.mjs') }}-
235-
236- - name : Fetch curriculum data
237- if : steps.curriculum-cache.outputs.cache-hit != 'true'
238- run : pnpm fetch-data
156+ - name : Install Dependencies
157+ run : |
158+ pnpm install
159+ pnpm fetch-data
239160
240161 - name : Run tests with coverage
241162 run : pnpm test:coverage
0 commit comments