Skip to content

Commit

Permalink
monorepo: add tsc to ci (#3661)
Browse files Browse the repository at this point in the history
* 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 <jochembrouwer96@gmail.com>
Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 13, 2024
1 parent 4da6647 commit 2cf4ddb
Show file tree
Hide file tree
Showing 12 changed files with 230 additions and 140 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,12 @@ jobs:
uses: ./.github/workflows/lint.yml
with:
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}


typecheck:
needs: [build, checkout-submodules]
uses: ./.github/workflows/typecheck.yml
with:
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
submodule-cache-key: ${{ needs.checkout-submodules.outputs.submodule-cache-key }}


62 changes: 62 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Typecheck (tsc)
on:
workflow_call:
inputs:
dep-cache-key:
required: true
type: string
submodule-cache-key:
required: true
type: string
workflow_dispatch:
inputs:
dep-cache-key:
required: false
default: 'none'
submodule-cache-key:
required: false
default: 'none'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-typecheck
cancel-in-progress: true

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
# We clone the repo and submodules if triggered from work-flow dispatch
- if: inputs.submodule-cache-key == 'none'
uses: actions/checkout@v4

# We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key)
- if: inputs.dep-cache-key != 'none'
uses: actions/cache/restore@v4
id: dep-cache
with:
path: ${{github.workspace}}
key: ${{ inputs.dep-cache-key }}

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install Dependencies (if not restored from cache)
if: steps.dep-cache.outputs.cache-hit != 'true'
run: npm ci
working-directory: ${{ github.workspace }}

- if: inputs.submodule-cache-key != 'none'
uses: actions/cache/restore@v4
name: Initialize ethereum-tests
id: submodules-cache
with:
path: ${{github.workspace}}/packages/ethereum-tests
key: ${{ inputs.submodule-cache-key}}
fail-on-cache-miss: true


- run: npm run tsc --workspaces
working-directory: ${{ github.workspace }}
Loading

0 comments on commit 2cf4ddb

Please sign in to comment.