test: 恢复双模式权限测试门禁 #142
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-test: | |
| name: 构建 + 分层测试 | |
| runs-on: windows-latest | |
| timeout-minutes: 20 | |
| env: | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v4 | |
| - name: 检出官方插件仓库(UI Smoke 夹具) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: FlappiBakuse/NexusPipeline-Plugins | |
| ref: main | |
| path: NexusPipeline-Plugins | |
| - name: 安装 .NET 8 SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: 安装 Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: 管理员完整性自检 | |
| shell: pwsh | |
| run: | | |
| $groups = & whoami /groups 2>&1 | |
| $status = $LASTEXITCODE | |
| $text = ($groups -join "`n") | |
| Write-Output $text | |
| if ($status -ne 0 -or $text -notmatch 'S-1-16-(?:12288|16384)\b') { | |
| Write-Error "Windows runner 未处于 Administrator / High Integrity 或 System Integrity。" | |
| exit 2 | |
| } | |
| Write-Output "[权限] 已确认 High/System Integrity。" | |
| - name: 安装 Playwright 依赖 | |
| working-directory: tests/e2e | |
| shell: cmd | |
| run: npm ci | |
| - name: Administrator 默认门禁(Unit + Component + Web + Docs + Syntax + Build) | |
| shell: cmd | |
| run: node tests\run.mjs admin default | |
| - name: Administrator Playwright UI Smoke | |
| shell: cmd | |
| env: | |
| NEXUS_TIME_SCALE: "10" | |
| run: node tests\run.mjs admin ui | |
| - name: 上传 Playwright 失败诊断 | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-test-results | |
| path: tests/e2e/test-results | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| system-tests: | |
| name: Windows System Smoke | |
| runs-on: windows-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v4 | |
| - name: 安装 .NET 8 SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: 安装 Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: 管理员完整性自检 | |
| shell: pwsh | |
| run: | | |
| $groups = & whoami /groups 2>&1 | |
| $status = $LASTEXITCODE | |
| $text = ($groups -join "`n") | |
| Write-Output $text | |
| if ($status -ne 0 -or $text -notmatch 'S-1-16-(?:12288|16384)\b') { | |
| Write-Error "Windows runner 未处于 Administrator / High Integrity 或 System Integrity。" | |
| exit 2 | |
| } | |
| Write-Output "[权限] 已确认 High/System Integrity。" | |
| - name: Administrator System Smoke | |
| shell: cmd | |
| env: | |
| NEXUS_TIME_SCALE: "10" | |
| run: node tests\run.mjs admin system | |
| - name: 上传 System Smoke 失败诊断 | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: system-smoke-results | |
| path: | | |
| tests/system/runtime-* | |
| tests/e2e/test-results | |
| if-no-files-found: ignore | |
| retention-days: 7 |