@@ -45,78 +45,77 @@ jobs:
4545 docs : ${{ steps.filter.outputs.docs || steps.filter.outputs.workflows }}
4646 playwright : ${{ steps.filter.outputs.devserver || steps.filter.outputs.libraries || steps.filter.outputs.tabs }}
4747
48-
4948 test :
5049 name : Verify that all tests, linting, type-checking and building succeeds.
5150 runs-on : ubuntu-latest
5251
5352 # execute after the paths-filter job is done
5453 needs : paths-filter
5554 steps :
56- - name : Check out source code
57- uses : actions/checkout@v4
58- with :
59- submodules : recursive
60-
61- - name : Enable Corepack
62- run : corepack enable
63-
64- - name : Use Node.js 💻
65- uses : actions/setup-node@v4
66- with :
67- node-version-file : .node-version
68- cache : yarn
55+ - name : Check out source code
56+ uses : actions/checkout@v4
57+ with :
58+ submodules : recursive
59+
60+ - name : Enable Corepack
61+ run : corepack enable
62+
63+ - name : Use Node.js 💻
64+ uses : actions/setup-node@v4
65+ with :
66+ node-version-file : .node-version
67+ cache : yarn
6968
7069 # For whatever reason, repotools refuses to install correctly, so we have to install it separately and
7170 # build it in its entirety before proceeding with installing everything else
72- - name : Setup Repotools
73- run : yarn workspaces focus @sourceacademy/modules-repotools && yarn workspaces foreach -A --include "@sourceacademy/modules-repotools" run build
71+ - name : Setup Repotools
72+ run : yarn workspaces focus @sourceacademy/modules-repotools && yarn workspaces foreach -A --include "@sourceacademy/modules-repotools" run build
73+
74+ - name : Install dependencies
75+ run : yarn install --immutable
7476
75- - name : Install dependencies
76- run : yarn install --immutable
77+ - name : Install Playwright
78+ if : needs.paths-filter.outputs.playwright == 'true'
79+ run : yarn playwright install --with-deps
7780
78- - name : Install Playwright
79- if : needs.paths-filter.outputs.playwright == 'true'
80- run : yarn playwright install --with-deps
81+ - name : Run tsc for libraries
82+ if : needs.paths-filter.outputs.libraries == 'true'
83+ run : yarn workspaces foreach -ptW --from "./lib/*" run tsc
8184
82- - name : Run tsc for libraries
83- if : needs.paths-filter.outputs.libraries == 'true'
84- run : yarn workspaces foreach -ptW --from "./lib/*" run tsc
85+ - name : Run build for libraries
86+ run : yarn workspaces foreach -ptW --from "./lib/*" run build
8587
86- - name : Run build for libraries
87- run : yarn workspaces foreach -ptW --from "./lib/*" run build
88+ - name : Run test for libraries
89+ if : needs.paths-filter.outputs.libraries == 'true'
90+ run : yarn test:libs
8891
89- - name : Run test for libraries
90- if : needs.paths-filter.outputs.libraries == 'true'
91- run : yarn test:libs
92+ - name : Build and run tsc for bundles and tabs
93+ if : needs.paths-filter.outputs.bundles == 'true' || needs.paths-filter.outputs.tabs == 'true'
94+ run : yarn workspaces foreach -j 5 -ptW --from "./src/{bundles,tabs}/*" run build --tsc
9295
93- - name : Build and run tsc for bundles and tabs
94- if : needs.paths-filter.outputs.bundles == 'true' || needs.paths-filter.outputs.tabs == 'true'
95- run : yarn workspaces foreach -j 5 -ptW --from "./src/{ bundles,tabs} /*" run build --tsc
96+ - name : Test bundles
97+ if : needs.paths-filter.outputs.bundles == 'true'
98+ run : yarn workspaces foreach -j 5 -ptW --from "./src/bundles/*" run test
9699
97- - name : Test bundles
98- if : needs.paths-filter.outputs.bundles == 'true'
99- run : yarn workspaces foreach -j 5 -ptW --from "./src/bundles /*" run test
100+ - name : Test tabs
101+ if : needs.paths-filter.outputs.tabs == 'true'
102+ run : yarn workspaces foreach -j 5 -ptW --from "./src/tabs /*" run test
100103
101- - name : Test tabs
102- if : needs.paths-filter.outputs.tabs == 'true'
103- run : yarn workspaces foreach -j 5 -ptW --from "./src/tabs/*" run test
104+ - name : Build manifest
105+ if : needs.paths-filter.outputs.devserver == 'true'
106+ run : yarn buildtools manifest
104107
105- - name : Build manifest
106- if : needs.paths-filter.outputs.devserver == 'true'
107- run : yarn buildtools manifest
108+ - name : Build Docs Server
109+ if : needs.paths-filter.outputs.docs == 'true'
110+ run : yarn workspaces foreach -A --include "@sourceacademy/modules-docserver" run build
108111
109- - name : Build Docs Server
110- if : needs.paths-filter.outputs.docs == 'true'
111- run : yarn workspaces foreach -A --include "@sourceacademy/modules-docserver" run build
112-
113- - name : Run tsc for Dev Server
114- if : needs.paths-filter.outputs.devserver == 'true'
115- run : yarn tsc:devserver
112+ - name : Run tsc for Dev Server
113+ if : needs.paths-filter.outputs.devserver == 'true'
114+ run : yarn tsc:devserver
116115
117- - name : Test Dev Server
118- if : needs.paths-filter.outputs.devserver == 'true'
119- run : yarn test:devserver
116+ - name : Test Dev Server
117+ if : needs.paths-filter.outputs.devserver == 'true'
118+ run : yarn test:devserver
120119
121- - name : Lint Everything
122- run : yarn buildtools lintglobal
120+ - name : Lint Everything
121+ run : yarn buildtools lintglobal
0 commit comments