ci: prevent supabase test collisions

This commit is contained in:
2025-05-30 08:46:23 +01:00
parent 69c8d1e2a7
commit 2bd56e3935

View File

@@ -36,19 +36,22 @@ test_unit:
test_db: test_db:
needs: [deps, check_types, check_style] needs: [deps, check_types, check_style]
dependencies: [deps] dependencies: [deps]
script: <<-SUPABASE_DB_SCRIPT before_script:
npx supabase db diff -f dummy_migration - mkdir ${CI_COMMIT_SHA}
git add -N supabase/migrations - cp -r ./* ${CI_COMMIT_SHA}/
if ! git diff --exit-code --quiet supabase/migrations; then script:
echo "Supabase migrations and schema are not in sync. See diff below:" - cd ${CI_COMMIT_SHA}
git diff supabase/migrations - npx supabase db diff -f dummy_migration
exit 1 - git add -N supabase/migrations
fi - >
if ! git diff --exit-code --quiet supabase/migrations; then
npx supabase db start echo "Supabase migrations and schema are not in sync. See diff below:"
npx supabase db reset git diff supabase/migrations
npx supabase db lint exit 1
SUPABASE_DB_SCRIPT fi
- npx supabase db start
- npx supabase db reset
- npx supabase db lint
after_script: after_script:
- npx supabase stop - npx supabase stop