mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 17:50:13 +00:00
ci(e2e): prebuild dashboard before backend health check
The GitHub runner can spend more than the readiness window compiling go run ./cmd/dashboard, leaving dashboard.log empty while the backend has not started yet. Build the dashboard binary during preparation and health-check only the actual server startup. Keep README instructions aligned with CI. Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba> Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
This commit is contained in:
co-authored by
naiba/CloudCode
cloudcode
parent
11e2f2ca80
commit
3db5041c58
@@ -75,6 +75,7 @@ jobs:
|
||||
printf '<!doctype html><title>user e2e</title>\n' > cmd/dashboard/user-dist/index.html
|
||||
go install github.com/swaggo/swag/cmd/swag@latest
|
||||
"$(go env GOPATH)/bin/swag" init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
||||
go build -o /tmp/nezha-dashboard ./cmd/dashboard
|
||||
|
||||
- name: Start backend
|
||||
working-directory: nezha
|
||||
@@ -82,7 +83,7 @@ jobs:
|
||||
GIN_MODE: release
|
||||
run: |
|
||||
mkdir -p data
|
||||
nohup go run ./cmd/dashboard -c data/config.yaml -db data/sqlite.db \
|
||||
nohup /tmp/nezha-dashboard -c data/config.yaml -db data/sqlite.db \
|
||||
> /tmp/dashboard.log 2>&1 &
|
||||
echo $! > /tmp/dashboard.pid
|
||||
|
||||
|
||||
@@ -30,12 +30,13 @@ printf '<!doctype html><title>admin e2e</title>\n' > cmd/dashboard/admin-dist/in
|
||||
printf '<!doctype html><title>user e2e</title>\n' > cmd/dashboard/user-dist/index.html
|
||||
go install github.com/swaggo/swag/cmd/swag@latest
|
||||
"$(go env GOPATH)/bin/swag" init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
||||
go build -o /tmp/nezha-dashboard ./cmd/dashboard
|
||||
|
||||
NZ_LISTENHOST=127.0.0.1 NZ_LISTENPORT=8008 \
|
||||
NZ_JWTSECRETKEY=e2e-jwt-secret-key-min-32-chars-long-ok \
|
||||
NZ_AGENTSECRETKEY=e2e-agent-secret-32-bytes-long-ok \
|
||||
NZ_SITENAME=nezha-e2e GIN_MODE=release \
|
||||
go run ./cmd/dashboard -c data/config.yaml -db data/sqlite.db
|
||||
/tmp/nezha-dashboard -c data/config.yaml -db data/sqlite.db
|
||||
```
|
||||
|
||||
Then back in this repo:
|
||||
|
||||
Reference in New Issue
Block a user