Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

remove debug

remove debug #279

Workflow file for this run

name: Migration Test
on:
push:
jobs:
migration-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: vultisig-plugin
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.2'
- name: Download go-wrappers
run: |
git clone https://github.com/vultisig/go-wrappers.git ../go-wrappers
- name: Create test config
run: |
cat > dca.json <<EOF
{
"server": {
"host": "localhost",
"port": 8080,
"jwt_secret": "test-secret"
},
"database": {
"dsn": "postgres://myuser:mypassword@localhost:5432/vultisig-plugin?sslmode=disable"
},
"redis": {
"host": "localhost",
"port": "6379"
},
"block_storage_config": {
"host": "http://localhost:9000",
"region": "us-east-1",
"access_key": "minioadmin",
"secret": "minioadmin",
"bucket": "vultisig-verifier"
},
"plugin": {},
"datadog": {
"host": "localhost",
"port": "8125"
},
"type": "dca",
"version": "0.1.0",
"rpc_url": "https://example.com",
"uniswap": {
"v2_router": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
"deadline": 1000
}
}
EOF
- name: Build dca binary
run: |
export LD_LIBRARY_PATH=../go-wrappers/includes/linux/:$LD_LIBRARY_PATH
go build -o dca cmd/dca/server/*.go
- name: Run dca and check migrations
run: |
export LD_LIBRARY_PATH=../go-wrappers/includes/linux/:$LD_LIBRARY_PATH
export VS_CONFIG_NAME=dca
# Start dca in background
./dca &
DCA_PID=$!
# Give it time to run migrations
sleep 10
# Check if process is still running
if ! kill -0 $DCA_PID 2>/dev/null; then
echo "DCA process failed to start"
exit 1
fi
# Check if migrations ran successfully by verifying tables exist
PGPASSWORD=mypassword psql -h localhost -U myuser -d vultisig-plugin -c "\dt" | grep -E "(plugin_policies|time_triggers) | wc -l" > /dev/null
if [ $? -ne 0 ]; then
echo "Migrations did not run successfully - expected tables not found"
kill $DCA_PID
exit 1
fi
echo "All migrations ran successfully!"
# Stop dca
kill $DCA_PID
- name: Check migration integrity
run: |
# Verify goose migrations table exists and has entries
PGPASSWORD=mypassword psql -h localhost -U myuser -d vultisig-plugin -c "SELECT COUNT(*) FROM goose_db_version;" | grep -E "[0-9]+" > /dev/null
if [ $? -ne 0 ]; then
echo "Goose migrations table not found or empty"
exit 1
fi
echo "Migration integrity check passed!"
- name: Check schema updates
run: |
# Dump current schema
PGPASSWORD=mypassword pg_dump -h localhost -U myuser -d vultisig-plugin \
--schema-only \
--no-comments \
--no-owner \
--quote-all-identifiers \
-T public.goose_db_version \
-T public.goose_db_version_id_seq | sed \
-e '/^--.*/d' \
-e '/^SET /d' \
-e '/^SELECT pg_catalog./d' \
-e 's/"public"\.//' | awk '/./ { e=0 } /^$$/ { e += 1 } e <= 1' \
> ./current_schema.sql
# Compare with repository schema
if ! diff -u ./storage/postgres/schema/schema.sql ./current_schema.sql; then
echo "Schema has changed but schema.sql was not updated!"
echo "Please run 'make dump-schema CONFIG=config-plugin.yaml' to update the schema file."
exit 1
fi
echo "Schema is up to date!"