Repository navigation
fix: zip-slip + i18n 缺口 + updater 结果契约 DRY(审查 8d206ff) #146
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| # db-server 在模块加载时 import node:sqlite,22.5–22.12 需 --experimental-sqlite; | |
| # npm-run-all2@9 等 dev 依赖要求 ≥22.22.2。22.22 同时满足两者。 | |
| node-version: "22.22" | |
| 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 | |
| } |