9fc3597317
工程保障地基:每次 push / PR 自动跑回归,防止改动悄悄破坏现有功能。 - go:4 模块 build + vet + test(bus 用内嵌 NATS,无需外部服务) - web:desktop/frontend + admin 各跑 npm ci + tsc --noEmit(矩阵并行) - py:mcp-py pip install -e . + sandbox 守卫测试(pytest,缺则 fallback harness) 带 concurrency 取消旧运行、npm/pip/go 缓存。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
71 lines
2.0 KiB
YAML
71 lines
2.0 KiB
YAML
name: CI
|
||
|
||
on:
|
||
push:
|
||
branches: [main, dev]
|
||
pull_request:
|
||
branches: [main, dev]
|
||
|
||
# 同一分支新 push 取消上一次未完成的运行,省 CI 时间。
|
||
concurrency:
|
||
group: ci-${{ github.ref }}
|
||
cancel-in-progress: true
|
||
|
||
jobs:
|
||
go:
|
||
name: Go · build + vet + test
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- uses: actions/setup-go@v5
|
||
with:
|
||
go-version: "1.25"
|
||
cache-dependency-path: "**/go.sum"
|
||
- name: build + vet + test(4 模块;bus 用内嵌 NATS,无需外部服务)
|
||
run: |
|
||
set -e
|
||
for m in sundynix-shared sundynix-gateway sundynix-dispatcher sundynix-mcp-go; do
|
||
echo "::group::$m"
|
||
(cd "$m" && go build ./... && go vet ./... && go test ./...)
|
||
echo "::endgroup::"
|
||
done
|
||
|
||
web:
|
||
name: Frontend · tsc
|
||
runs-on: ubuntu-latest
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
dir: [sundynix-desktop/frontend, sundynix-admin]
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- uses: actions/setup-node@v4
|
||
with:
|
||
node-version: "20"
|
||
cache: npm
|
||
cache-dependency-path: ${{ matrix.dir }}/package-lock.json
|
||
- name: install + typecheck
|
||
working-directory: ${{ matrix.dir }}
|
||
run: |
|
||
npm ci
|
||
npx tsc --noEmit
|
||
|
||
py:
|
||
name: mcp-py · sandbox guard
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- uses: actions/setup-python@v5
|
||
with:
|
||
python-version: "3.11"
|
||
cache: pip
|
||
- name: install + test(无 Docker 时测降级路径)
|
||
working-directory: sundynix-mcp-py
|
||
run: |
|
||
python -m pip install --upgrade pip
|
||
python -m pip install -e . pytest
|
||
PYTHONPATH=src:tests python -m pytest tests/ -q || \
|
||
PYTHONPATH=src:tests python -c "import test_sandbox as t; \
|
||
fns=[getattr(t,n) for n in dir(t) if n.startswith('test_')]; \
|
||
[ (f(),print('PASS',f.__name__)) for f in fns ]; print(f'{len(fns)} passed')"
|