@@ -14,14 +14,10 @@ jobs:
1414 runs-on : ubuntu-latest
1515
1616 steps :
17- - name : Check out source code
18- uses : actions/checkout@v4
19-
20- - name : Enable corepack
21- run : corepack enable
22-
23- - name : Install action packages
24- run : yarn workspaces focus @sourceacademy/modules-github-actions
17+ - name : Initialize Repo
18+ uses : ./.github/actions/src/init
19+ with :
20+ package-name : ' @sourceacademy/modules-github-actions'
2521
2622 - name : Build actions
2723 run : |
@@ -46,26 +42,11 @@ jobs:
4642 matrix :
4743 lib : ${{ fromJson(needs.find-packages.outputs.libs) }}
4844 steps :
49- - name : Check out source code
50- uses : actions/checkout@v4
51-
52- - name : Enable Corepack
53- run : corepack enable
54-
55- - name : Use Node.js 💻
56- uses : actions/setup-node@v4
45+ - name : Initialize Repo
46+ uses : ./.github/actions/src/init
5747 with :
58- node-version-file : .node-version
59- cache : yarn
60-
61- - name : Install Dependencies
62- run : yarn workspaces focus ${{ matrix.lib.name }}
63-
64- - name : Install Playwright (if needed)
65- if : matrix.lib.changes == 'true' && matrix.lib.needsPlaywright
66- run : |
67- cd ${{ matrix.lib.directory }}
68- yarn playwright install --with-deps
48+ package-name : ${{ matrix.lib.name }}
49+ playwright : ${{ matrix.lib.changes && matrix.lib.needsPlaywright }}
6950
7051 - name : Run Tests
7152 if : matrix.lib.changes == 'true'
@@ -90,17 +71,11 @@ jobs:
9071 tabInfo : ${{ fromJson(needs.find-packages.outputs.tabs) }}
9172
9273 steps :
93- - name : Check out source code
94- uses : actions/checkout@v4
95-
96- - name : Enable Corepack
97- run : corepack enable
98-
99- - name : Use Node.js 💻
100- uses : actions/setup-node@v4
74+ - name : Initialize Repo
75+ uses : ./.github/actions/src/init
10176 with :
102- node-version-file : .node-version
103- cache : yarn
77+ package-name : ${{ matrix.tabInfo.name }}
78+ playwright : ${{ matrix.tabInfo.needsPlaywright && matrix.tabInfo.changes }}
10479
10580 - name : Install Dependencies
10681 run : yarn workspaces focus ${{ matrix.tabInfo.name }}
@@ -114,20 +89,14 @@ jobs:
11489 path : ./build/tabs/${{ matrix.tabInfo.tabName }}.js
11590 key : ${{ matrix.tabInfo.name }}
11691
117- - name : Install Playwright (if needed)
118- if : matrix.tabInfo.changes == 'true' && matrix.tabInfo.needsPlaywright
119- run : |
120- cd ${{ matrix.tabInfo.directory }}
121- yarn playwright install --with-deps
122-
12392 - name : Run Tests
124- if : matrix.tabInfo.changes == 'true'
93+ if : matrix.tabInfo.changes
12594 run : |
12695 cd ${{ matrix.tabInfo.directory }}
12796 yarn test
12897
12998 - name : Run Auxillary Tasks
130- if : matrix.tabInfo.changes == 'true'
99+ if : matrix.tabInfo.changes
131100 run : |
132101 cd ${{ matrix.tabInfo.directory }}
133102 yarn tsc
@@ -143,20 +112,10 @@ jobs:
143112 bundleInfo : ${{ fromJson(needs.find-packages.outputs.bundles) }}
144113
145114 steps :
146- - name : Check out source code
147- uses : actions/checkout@v4
148-
149- - name : Enable Corepack
150- run : corepack enable
151-
152- - name : Use Node.js 💻
153- uses : actions/setup-node@v4
115+ - name : Initialize Repo
116+ uses : ./.github/actions/src/init
154117 with :
155- node-version-file : .node-version
156- cache : yarn
157-
158- - name : Install Dependencies
159- run : yarn workspaces focus ${{ matrix.bundleInfo.name }}
118+ package-name : ${{ matrix.bundleInfo.name }}
160119
161120 - name : Build Bundle
162121 run : |
@@ -197,17 +156,46 @@ jobs:
197156 - tabs
198157
199158 steps :
200- - name : Check out source code
201- uses : actions/checkout@v4
159+ - name : Initialize Repo
160+ uses : ./.github/actions/src/init
161+ with :
162+ package-name : ' @sourceacademy/modules-devserver'
163+ playwright : true
202164
203- - name : Enable Corepack
204- run : corepack enable
165+ - name : Run tests
166+ run : |
167+ cd ./devserver
168+ yarn test
169+
170+ - name : Run Auxillary Tasks
171+ run : |
172+ cd ./devserver
173+ yarn tsc
205174
206- - name : Use Node.js 💻
207- uses : actions/setup-node@v4
175+ docserver :
176+ name : Docs Server Tests
177+ runs-on : ubuntu-latest
178+ needs : libraries
179+ steps :
180+ - name : Initialize Repo
181+ uses : ./.github/actions/src/init
208182 with :
209- node-version-file : .node-version
210- cache : yarn
183+ package-name : ' @sourceacademy/modules-docserver'
211184
212- - name : Install Dependencies
213- run : yarn workspaces focus @sourceacademy/modules-devserver
185+ - name : Build Docs
186+ run : |
187+ cd ./docs
188+ yarn build
189+
190+ repo-tasks :
191+ name : Repo Wide Tasks
192+ runs-on : ubuntu-latest
193+
194+ steps :
195+ - name : Initialize Repo
196+ uses : ./.github/actions/src/init
197+ with :
198+ package-name : ' @sourceacademy/modules'
199+
200+ - name : Lint Everything
201+ run : yarn lint:all
0 commit comments