Skip to content

Nightly Test and Build #2

Nightly Test and Build

Nightly Test and Build #2

# LinaPro nightly health test and multi-platform Docker image publishing workflow.
# GitHub cron uses UTC. 16:00 UTC is 00:00 Asia/Shanghai.
# LinaPro 夜间健康测试与多平台 Docker 镜像发布工作流。
# GitHub cron 使用 UTC,16:00 UTC 对应北京时间 00:00。
name: Nightly Test and Build
on:
# Run the full nightly verification and image publishing chain every day.
# 每天运行完整夜间验证与镜像发布链路。
schedule:
- cron: "0 16 * * *"
# Allow maintainers to run the nightly chain manually for release diagnostics.
# 允许维护者为发布诊断手动运行夜间链路。
workflow_dispatch:
# The top-level workflow only needs repository read access; the image job narrows in write access locally.
# 顶层工作流只需要读取仓库;镜像 job 会在自身范围内声明写包权限。
permissions:
contents: read
# Keep nightly runs serialized so image tags and artifacts are not produced by overlapping runs.
# 保持夜间任务串行,避免重叠运行同时产出镜像标签和 artifact。
concurrency:
group: "${{ github.workflow }} @ nightly"
cancel-in-progress: false
jobs:
# Verifies host-only command entry points on Windows without loading official plugins.
# 在 Windows 上验证宿主模式命令入口,不加载官方插件。
windows-command-smoke:
name: Windows command smoke (host-only)
uses: ./.github/workflows/reusable-windows-command-smoke.yml
with:
plugins: "0"
# Runs Go tests in host-only mode to catch core backend regressions.
# 以宿主模式运行 Go 测试,捕获核心后端回归。
backend-unit-tests:
name: Go unit tests (host-only)
uses: ./.github/workflows/reusable-backend-unit-tests.yml
with:
plugins: "0"
# Runs frontend unit tests for the default workspace without plugin submodules.
# 在不初始化插件 submodule 的情况下运行默认工作台前端单测。
frontend-unit-tests:
name: Frontend unit tests (host-only)
uses: ./.github/workflows/reusable-frontend-unit-tests.yml
# Verifies Windows command entry points when official plugin sources are present.
# 在官方插件源码存在时验证 Windows 命令入口。
plugin-windows-command-smoke:
name: Windows command smoke (plugin-full)
uses: ./.github/workflows/reusable-windows-command-smoke.yml
with:
submodules: recursive
plugins: "1"
# Runs Go tests with recursive submodules and plugin-full mode enabled.
# 递归初始化 submodule 并以插件完整模式运行 Go 测试。
plugin-backend-unit-tests:
name: Go unit tests (plugin-full)
uses: ./.github/workflows/reusable-backend-unit-tests.yml
with:
submodules: recursive
plugins: "1"
# Runs frontend unit tests with official plugin workspace files available.
# 在官方插件工作区文件可用时运行前端单测。
plugin-frontend-unit-tests:
name: Frontend unit tests (plugin-full)
uses: ./.github/workflows/reusable-frontend-unit-tests.yml
with:
submodules: recursive
# Builds a host-only backend artifact and verifies its health/login/plugin-list behavior.
# 构建宿主模式后端产物,并验证健康检查、登录和插件列表行为。
host-only-build-smoke:
name: Host-only build smoke
uses: ./.github/workflows/reusable-host-only-build-smoke.yml
with:
artifact-name: nightly-host-only-build-smoke-log
retention-days: 14
# Runs browser E2E against the host-only development stack.
# 面向宿主模式开发栈运行浏览器 E2E。
host-only-e2e-tests:
name: E2E tests (host-only)
uses: ./.github/workflows/reusable-e2e-tests.yml
with:
start-command: make dev plugins=0
test-command: pnpm test:host
artifact-name: nightly-host-only-e2e-report
retention-days: 14
# Runs browser E2E with official plugin tests required and plugin-full services enabled.
# 以插件完整服务运行浏览器 E2E,并要求官方插件测试存在。
plugin-full-e2e-tests:
name: E2E tests (plugin-full)
uses: ./.github/workflows/reusable-e2e-tests.yml
with:
submodules: recursive
require-plugin-e2e: true
start-command: make dev plugins=1
test-command: pnpm test
artifact-name: nightly-plugin-full-e2e-report
retention-days: 14
# Starts the backend in Redis-backed cluster mode and checks the coordination path.
# 以 Redis 支撑的集群模式启动后端,并检查协调链路。
redis-cluster-smoke:
name: Redis cluster smoke
uses: ./.github/workflows/reusable-redis-cluster-smoke.yml
with:
artifact-name: nightly-redis-cluster-smoke-log
retention-days: 14
# Publishes the nightly image only after every host-only, plugin-full, E2E, and Redis gate passes.
# 仅在所有宿主、插件完整、E2E 和 Redis 门禁通过后发布 nightly 镜像。
nightly-image:
name: Build and publish nightly image
needs:
- windows-command-smoke
- backend-unit-tests
- frontend-unit-tests
- plugin-windows-command-smoke
- plugin-backend-unit-tests
- plugin-frontend-unit-tests
- host-only-build-smoke
- host-only-e2e-tests
- plugin-full-e2e-tests
- redis-cluster-smoke
# Image publication needs package write access, while other jobs stay read-only.
# 镜像发布需要包写权限,其他 job 保持只读权限。
permissions:
contents: read
packages: write
uses: ./.github/workflows/reusable-image-publish.yml
with:
image-name: linapro
platforms: linux/amd64,linux/arm64
tag-mode: nightly
floating-tag: nightly
plugins: "1"