Skip to content

fix(pack-update): 修复 ootb TS2353 + defaultBindingEnabled 契约(含 #62) #176

fix(pack-update): 修复 ootb TS2353 + defaultBindingEnabled 契约(含 #62)

fix(pack-update): 修复 ootb TS2353 + defaultBindingEnabled 契约(含 #62) #176

Workflow file for this run

name: ootb
on:
push:
branches: [main, refactor/**]
pull_request:
branches: [main, refactor/**]
jobs:
smoke:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
# 默认 CI Node 唯一来源: 仓库根 .node-version(与 npm-publish 共用)。
# db-server 需 ≥22.13(node:sqlite 无 flag);npm-run-all2@9 要求
# ^22.22.2 || ^24.15.0 || >=26 —— 当前钉 24(GHA 解析到 ≥24.15)。
node-version-file: .node-version
cache: npm
- name: Install root deps
shell: pwsh
run: npm ci --no-audit --no-fund
- name: Build all workspaces
shell: pwsh
run: npm run build --workspaces --if-present
- name: Seed configs/ from configs-default/
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path configs | Out-Null
Get-ChildItem -Path configs-default -Filter *.json | ForEach-Object {
$dest = Join-Path configs $_.Name
if (-not (Test-Path $dest)) { Copy-Item $_.FullName $dest }
}
- name: Run check-ootb
shell: pwsh
env:
SFMC_ROOT: ${{ github.workspace }}
run: npm run check-ootb
- name: Run smoke-modules (against temporary db-server)
shell: pwsh
env:
SFMC_ROOT: ${{ github.workspace }}
run: |
$port = if ($env:DB_PORT) { $env:DB_PORT } else { '3001' }
if (Get-NetTCPConnection -LocalPort $port -ErrorAction SilentlyContinue) {
Get-NetTCPConnection -LocalPort $port | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
Start-Sleep -Seconds 2
}
$db = Start-Process -FilePath node -ArgumentList "db-server/dist/index.js" -WorkingDirectory $PWD -WindowStyle Hidden -RedirectStandardOutput "db-server/_smoke.out" -RedirectStandardError "db-server/_smoke.err" -PassThru
try {
$ready = $false
for ($i=0; $i -lt 40; $i++) {
try {
$r = Invoke-WebRequest -UseBasicParsing "http://127.0.0.1:$port/api/health" -TimeoutSec 2
if ($r.StatusCode -eq 200) { $ready = $true; break }
} catch {}
Start-Sleep -Milliseconds 300
}
if (-not $ready) { throw "db-server not ready" }
npm run smoke-modules
} finally {
Stop-Process -Id $db.Id -Force -ErrorAction SilentlyContinue
Remove-Item -Force db-server/_smoke.out,db-server/_smoke.err -ErrorAction SilentlyContinue
}