Skip to content

armgit / ARTEX

Public Imported from GitHub
0

ARTEX - AI autonomous penetration testing system (English translation; upstream: Autumn-27/ARTEX, AGPL-3.0)

ci: build a dedicated database for the online index scripts

BaaRai5463ea437545
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d28bb4c..28c0030 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -49,15 +49,18 @@ jobs:
# keeps the database state deterministic.
run: go test -p 1 ./...
- name: online index scripts
- # Apply and roll back scripts/sql against a database that holds the
- # schema. The job-level artextest database stays empty (every package
- # that opens the database uses its own suffixed one); the db package's
- # artextest_db has the full schema after the step above.
+ # Apply and roll back scripts/sql on a database built here from
+ # db/schema.sql and db/migrations. The job-level artextest database
+ # never gets the schema (packages use suffixed databases), and cached
+ # test results mean no test database is guaranteed to exist.
env:
- ARTEX_PG_DSN: postgres://artex:testpass@localhost:5432/artextest_db?sslmode=disable
+ SQL_DSN: postgres://artex:testpass@localhost:5432/artextest_sqlscripts?sslmode=disable
run: |
- psql "$ARTEX_PG_DSN" -X -v ON_ERROR_STOP=1 -f scripts/sql/20261115-task-query-indexes.sql
- psql "$ARTEX_PG_DSN" -X -v ON_ERROR_STOP=1 -f scripts/sql/20261115-task-query-indexes.rollback.sql
+ psql "$ARTEX_PG_DSN" -X -v ON_ERROR_STOP=1 -c 'CREATE DATABASE artextest_sqlscripts'
+ psql "$SQL_DSN" -X -q -v ON_ERROR_STOP=1 -f db/schema.sql
+ for f in db/migrations/*.sql; do psql "$SQL_DSN" -X -q -v ON_ERROR_STOP=1 -f "$f"; done
+ psql "$SQL_DSN" -X -v ON_ERROR_STOP=1 -f scripts/sql/20261115-task-query-indexes.sql
+ psql "$SQL_DSN" -X -v ON_ERROR_STOP=1 -f scripts/sql/20261115-task-query-indexes.rollback.sql
- name: go test -race
# Race detector on the packages that pass under -race today. ./server
# joined once its suite was checked with -race against postgres and its