From 2bd56e3935782784f7ba5c6e46c17b6fde3f7fec Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Fri, 30 May 2025 08:46:23 +0100 Subject: [PATCH] ci: prevent supabase test collisions --- .gitlab-ci.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b23096..999b5a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,19 +36,22 @@ test_unit: test_db: needs: [deps, check_types, check_style] dependencies: [deps] - script: <<-SUPABASE_DB_SCRIPT - npx supabase db diff -f dummy_migration - git add -N supabase/migrations - if ! git diff --exit-code --quiet supabase/migrations; then - echo "Supabase migrations and schema are not in sync. See diff below:" - git diff supabase/migrations - exit 1 - fi - - npx supabase db start - npx supabase db reset - npx supabase db lint - SUPABASE_DB_SCRIPT + before_script: + - mkdir ${CI_COMMIT_SHA} + - cp -r ./* ${CI_COMMIT_SHA}/ + script: + - cd ${CI_COMMIT_SHA} + - npx supabase db diff -f dummy_migration + - git add -N supabase/migrations + - > + if ! git diff --exit-code --quiet supabase/migrations; then + echo "Supabase migrations and schema are not in sync. See diff below:" + git diff supabase/migrations + exit 1 + fi + - npx supabase db start + - npx supabase db reset + - npx supabase db lint after_script: - npx supabase stop