api-contracts: add caching for generated types in CI
- Completed Action 1.1.2.4: Added cache step for generated types - Cache keyed on openapi.yaml hash for automatic invalidation - Speeds up CI by avoiding regeneration when spec unchanged
This commit is contained in:
parent
5e636fdb90
commit
74998a8d08
2 changed files with 11 additions and 2 deletions
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
|
|
@ -109,6 +109,14 @@ jobs:
|
|||
cd apps/web
|
||||
npm ci
|
||||
|
||||
- name: Cache Generated Types
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: apps/web/src/types/generated
|
||||
key: ${{ runner.os }}-generated-types-${{ hashFiles('veza-backend-api/openapi.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-generated-types-
|
||||
|
||||
- name: Generate Types from OpenAPI
|
||||
run: |
|
||||
cd apps/web
|
||||
|
|
@ -117,6 +125,7 @@ jobs:
|
|||
continue-on-error: false
|
||||
# This step ensures types are generated before typecheck
|
||||
# If types don't match spec, CI will fail
|
||||
# Cache keyed on openapi.yaml hash, so types regenerate when spec changes
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -129,11 +129,11 @@ Critical path dependencies:
|
|||
- **Validation**: ✅ Added type generation step to `.github/workflows/ci.yml` before Type Check
|
||||
- **Rollback**: Remove step from workflow
|
||||
|
||||
- [ ] **Action 1.1.2.4**: Add type generation cache to CI/CD
|
||||
- [x] **Action 1.1.2.4**: Add type generation cache to CI/CD
|
||||
- **Scope**: `.github/workflows/*.yml` - Cache generated types to speed up CI
|
||||
- **Dependencies**: Action 1.1.2.3 complete
|
||||
- **Risk**: LOW 🔒
|
||||
- **Validation**: CI uses cache, faster builds
|
||||
- **Validation**: ✅ Added cache step keyed on openapi.yaml hash in CI workflow
|
||||
- **Rollback**: Remove cache
|
||||
|
||||
- [ ] **Action 1.1.2.5**: Add type generation to pre-commit (optional)
|
||||
|
|
|
|||
Loading…
Reference in a new issue