Skip to content

Commit

Permalink
Add schema check to github/uv CI
Browse files Browse the repository at this point in the history
  • Loading branch information
augray committed Dec 13, 2024
1 parent 0b5d487 commit a401da5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 34 deletions.
20 changes: 0 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ commands:
working_directory: ./sematic/ui
command: npm run lint

validate-schemas:
description: Validates all dev resource schemas are up-to-date and consistent
steps:
- run:
name: Check DB Schema
command: make migrate_up_sqlite && make update-schema && git diff --exit-code
installation-tests:
description: Do a test of installing sematic via wheel
steps:
Expand Down Expand Up @@ -100,16 +94,6 @@ jobs:
at: /home/circleci
- do-static-analysis

schemas:
docker:
- image: $SEMATIC_CI_IMAGE
auth:
username: $SEMATIC_DOCKERHUB_USER
password: $SEMATIC_DOCKERHUB_PASSWORD
steps:
- attach_workspace:
at: /home/circleci
- validate-schemas
installation:
docker:
- image: $SEMATIC_CI_IMAGE
Expand Down Expand Up @@ -191,9 +175,6 @@ workflows:
- lint:
requires:
- init
- schemas:
requires:
- init
- installation:
requires:
- init
Expand All @@ -206,6 +187,5 @@ workflows:
- finalize:
requires:
- lint
- schemas
- integration-test
- fe-unit-tests
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
run: |
source .venv/bin/activate
pytest
- name: Check Schemas
run: make migrate_up_sqlite && make update-schema && git diff --exit-code
- name: Wheel
run: |
make ui
Expand Down
18 changes: 4 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ migrate_up_rds:
cd sematic; DATABASE_URL=${DATABASE_URL} dbmate -s db/schema.sql.pg up

migrate_up_sqlite:
bazel run //sematic/db:migrate -- up --verbose --env local --schema-file ${PWD}/sematic/db/schema.sql.sqlite
source .venv/bin/activate && python3 ./sematic/db/migrate.py up --verbose --env local --schema-file ${PWD}/sematic/db/schema.sql.sqlite

migrate_down_sqlite:
bazel run //sematic/db:migrate -- down --verbose --env local --schema-file ${PWD}/sematic/db/schema.sql.sqlite
source .venv/bin/activate && python3 ./sematic/db/migrate.py down --verbose --env local --schema-file ${PWD}/sematic/db/schema.sql.sqlite

clear_sqlite:
sqlite3 ~/.sematic/db.sqlite3 < sematic/db/scripts/clear_all.sql
Expand Down Expand Up @@ -41,20 +41,10 @@ py-sync:

.PHONY: update-schema
update-schema:
bazel run //sematic/db:migrate -- dump --schema-file ${PWD}/sematic/db/schema.sql.sqlite
source .venv/bin/activate && python3 ./sematic/db/migrate.py dump --schema-file ${PWD}/sematic/db/schema.sql.sqlite

# this is not supported on Mac because some of the dependencies that need to be pulled
# do not have a release version for Mac
refresh-dependencies:
ifeq ($(UNAME_S),Linux)
bazel run //requirements:requirements3_8.update
bazel run //requirements:requirements3_9.update
bazel run //requirements:requirements3_10.update
bazel run //requirements:requirements3_11.update
else
echo "${RED}Refreshing dependencies should only be done from Linux${NO_COLOR}"
exit 1
endif
uv lock

.PHONY: ui
ui: sematic/ui/node_modules/.build_timestamp
Expand Down

0 comments on commit a401da5

Please sign in to comment.