Skip to content

Commit

Permalink
FIXUP: Add db comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyMcCormick committed Nov 7, 2024
1 parent edb1df6 commit b2f80ff
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/compare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

jobs:
build:
compare:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -51,13 +51,25 @@ jobs:
ref: main
path: main-branch

- name: Run felis diff on changed files
- name: Run felis diff on the schema files
run: |
cd $GITHUB_WORKSPACE
for file in ${{ env.CHANGED_FILES }}; do
echo "Diff for $file:"
echo "Schema diff for $file:"
MAIN_FILE=main-branch/${{ env.SCHEMA_DIR }}/$file
CURRENT_FILE=current-ref/${{ env.SCHEMA_DIR }}/$file
echo "Comparing $MAIN_FILE to $CURRENT_FILE"
felis diff $MAIN_FILE $CURRENT_FILE
done
- name: Run felis diff of schema file against database
run: |
cd $GITHUB_WORKSPACE
for file in ${{ env.CHANGED_FILES }}; do
echo "Database diff for $file:"
MAIN_FILE=main-branch/${{ env.SCHEMA_DIR }}/$file
DB_URL=sqlite:///$(basename ${MAIN_FILE%.yaml}).db
felis create $MAIN_FILE --engine-url $DB_URL
CURRENT_FILE=current-ref/${{ env.SCHEMA_DIR }}/$file
echo "Comparing $DB_URL to $CURRENT_FILE"
felis diff --engine-url $DB_URL $CURRENT_FILE
done

0 comments on commit b2f80ff

Please sign in to comment.