ci: verify database-backed deployment API

This commit is contained in:
kuaifan 2026-08-10 23:13:50 +00:00
parent 3d917997a1
commit 0d320c2d89
2 changed files with 16 additions and 1 deletions

View File

@ -63,7 +63,7 @@ wait_for_services() {
}
check_installation() {
local port prefix user_count migration_status
local port prefix user_count migration_status expected_version setting_response
wait_for_services
port="$(env_value APP_PORT)"
@ -71,6 +71,16 @@ check_installation() {
--retry 30 --retry-delay 2 --retry-connrefused \
"http://127.0.0.1:${port}/health" >/dev/null
expected_version="$(jq -r '.version' package.json)"
setting_response="$(curl --fail --silent --show-error \
--retry 5 --retry-delay 2 --retry-connrefused \
"http://127.0.0.1:${port}/api/system/setting")"
jq -e --arg expected_version "$expected_version" '
.ret == 1
and .data.reg == "open"
and .data.server_version == $expected_version
' <<<"$setting_response" >/dev/null
prefix="$(table_prefix)"
user_count="$(printf 'SELECT COUNT(*) FROM `%susers`;\n' "$prefix" | db_exec | tr -d '[:space:]')"
if [[ ! "$user_count" =~ ^[1-9][0-9]*$ ]]; then

View File

@ -102,6 +102,11 @@ jobs:
- name: Install v1.6.89
run: sudo ./cmd install
- name: Reload v1.6.89 services
run: |
sudo ./cmd restart php
sudo ./cmd up
- name: Seed upgrade sentinel
run: |
"$RUNNER_TEMP/deployment-regression.sh" check-installation