Skip to content

Commit 2cf4ddb

Browse files
gabrocheleaujochem-brouweracolytec3
authored
monorepo: add tsc to ci (#3661)
* monorepo: add tsc to ci * monorepo: attempt fixing yml config * add tsc / typecheck to ci * add eth-tests step * fix type issues * remove extraneous file * update vitest to 2.1 * add submodule key to typecheck job * more ci fixes * add proper return value --------- Co-authored-by: Jochem Brouwer <[email protected]> Co-authored-by: acolytec3 <[email protected]>
1 parent 4da6647 commit 2cf4ddb

File tree

12 files changed

+230
-140
lines changed

12 files changed

+230
-140
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,12 @@ jobs:
194194
uses: ./.github/workflows/lint.yml
195195
with:
196196
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
197-
197+
198+
typecheck:
199+
needs: [build, checkout-submodules]
200+
uses: ./.github/workflows/typecheck.yml
201+
with:
202+
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
203+
submodule-cache-key: ${{ needs.checkout-submodules.outputs.submodule-cache-key }}
204+
205+

.github/workflows/typecheck.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Typecheck (tsc)
2+
on:
3+
workflow_call:
4+
inputs:
5+
dep-cache-key:
6+
required: true
7+
type: string
8+
submodule-cache-key:
9+
required: true
10+
type: string
11+
workflow_dispatch:
12+
inputs:
13+
dep-cache-key:
14+
required: false
15+
default: 'none'
16+
submodule-cache-key:
17+
required: false
18+
default: 'none'
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-typecheck
22+
cancel-in-progress: true
23+
24+
jobs:
25+
typecheck:
26+
runs-on: ubuntu-latest
27+
steps:
28+
# We clone the repo and submodules if triggered from work-flow dispatch
29+
- if: inputs.submodule-cache-key == 'none'
30+
uses: actions/checkout@v4
31+
32+
# We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key)
33+
- if: inputs.dep-cache-key != 'none'
34+
uses: actions/cache/restore@v4
35+
id: dep-cache
36+
with:
37+
path: ${{github.workspace}}
38+
key: ${{ inputs.dep-cache-key }}
39+
40+
- name: Use Node.js 20
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20
44+
cache: 'npm'
45+
46+
- name: Install Dependencies (if not restored from cache)
47+
if: steps.dep-cache.outputs.cache-hit != 'true'
48+
run: npm ci
49+
working-directory: ${{ github.workspace }}
50+
51+
- if: inputs.submodule-cache-key != 'none'
52+
uses: actions/cache/restore@v4
53+
name: Initialize ethereum-tests
54+
id: submodules-cache
55+
with:
56+
path: ${{github.workspace}}/packages/ethereum-tests
57+
key: ${{ inputs.submodule-cache-key}}
58+
fail-on-cache-miss: true
59+
60+
61+
- run: npm run tsc --workspaces
62+
working-directory: ${{ github.workspace }}

0 commit comments

Comments
 (0)