API 계약 CI 추가
This commit is contained in:
parent
250787cb18
commit
1881fe50bd
5 changed files with 70 additions and 5 deletions
58
.github/workflows/api-contract.yml
vendored
Normal file
58
.github/workflows/api-contract.yml
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
name: API contract
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "apps/api/**"
|
||||
- "apps/web/src/lib/api.gen.ts"
|
||||
- "apps/web/scripts/generate-api-types.mjs"
|
||||
- "apps/web/package.json"
|
||||
- "apps/web/package-lock.json"
|
||||
- ".github/workflows/api-contract.yml"
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "apps/api/**"
|
||||
- "apps/web/src/lib/api.gen.ts"
|
||||
- "apps/web/scripts/generate-api-types.mjs"
|
||||
- "apps/web/package.json"
|
||||
- "apps/web/package-lock.json"
|
||||
- ".github/workflows/api-contract.yml"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
api-types:
|
||||
name: OpenAPI type drift
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install API dependencies
|
||||
working-directory: apps/api
|
||||
run: python -m pip install -r requirements.txt
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: npm
|
||||
cache-dependency-path: apps/web/package-lock.json
|
||||
|
||||
- name: Install web dependencies
|
||||
working-directory: apps/web
|
||||
run: npm ci
|
||||
|
||||
- name: Check generated API types
|
||||
working-directory: apps/web
|
||||
run: npm run check:api-types
|
||||
Loading…
Add table
Add a link
Reference in a new issue