0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00

chore(data-exploration): add CI scripts to check if schema files are built (#13960)

* chore(data-exploration): add CI scripts to check if schema files are built

* remove timestamp

* Update snapshots

* Update snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Marius Andra 2023-01-27 23:24:10 +01:00 committed by GitHub
parent 64ede2f881
commit 1795652f9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -129,6 +129,10 @@ jobs:
run: |
mypy .
- name: Check if "schema.py" is up to date
run: |
npm run schema:build:python && git diff --exit-code
check-migrations:
needs: changes
timeout-minutes: 5

View File

@ -44,6 +44,9 @@ jobs:
- name: Generate logic types and run typescript with strict
run: pnpm typegen:write && pnpm typescript:check
- name: Check if "schema.json" is up to date
run: pnpm schema:build:json && git diff --exit-code
jest-setup:
# Split the tests into multiple chunks
runs-on: ubuntu-latest

View File

@ -32,7 +32,7 @@
"build:esbuild": "node frontend/build.mjs",
"schema:build": "pnpm run schema:build:json && pnpm run schema:build:python",
"schema:build:json": "ts-json-schema-generator -f tsconfig.json --path 'frontend/src/*.ts' --type 'QuerySchema' --no-type-check > frontend/src/queries/schema.json && prettier --write frontend/src/queries/schema.json",
"schema:build:python": "datamodel-codegen --collapse-root-models --input frontend/src/queries/schema.json --input-file-type jsonschema --output posthog/schema.py && black posthog/schema.py",
"schema:build:python": "datamodel-codegen --collapse-root-models --disable-timestamp --input frontend/src/queries/schema.json --input-file-type jsonschema --output posthog/schema.py && black posthog/schema.py",
"packages:build": "pnpm packages:build:apps-common && pnpm packages:build:lemon-ui",
"packages:build:apps-common": "cd frontend/@posthog/apps-common && pnpm i && pnpm build",
"packages:build:lemon-ui": "cd frontend/@posthog/lemon-ui && pnpm i && pnpm build",

View File

@ -1,6 +1,5 @@
# generated by datamodel-codegen:
# filename: schema.json
# timestamp: 2023-01-26T17:24:56+00:00
from __future__ import annotations