|
| 1 | +name: Windows Testbox |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + testbox_id: |
| 7 | + type: string |
| 8 | + description: "Testbox session ID" |
| 9 | + required: true |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +env: |
| 15 | + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" |
| 16 | + |
| 17 | +jobs: |
| 18 | + windows: |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + name: windows |
| 22 | + runs-on: blacksmith-16vcpu-windows-2025 |
| 23 | + timeout-minutes: 90 |
| 24 | + defaults: |
| 25 | + run: |
| 26 | + shell: bash |
| 27 | + steps: |
| 28 | + - name: Begin Testbox |
| 29 | + uses: useblacksmith/begin-testbox@d0e04585c26905fdd92c94a09c159544c7ee1b67 |
| 30 | + with: |
| 31 | + testbox_id: ${{ inputs.testbox_id }} |
| 32 | + |
| 33 | + - name: Checkout |
| 34 | + uses: actions/checkout@v6 |
| 35 | + with: |
| 36 | + fetch-depth: 1 |
| 37 | + fetch-tags: false |
| 38 | + persist-credentials: false |
| 39 | + submodules: false |
| 40 | + |
| 41 | + - name: Try to exclude workspace from Windows Defender |
| 42 | + shell: pwsh |
| 43 | + run: | |
| 44 | + $cmd = Get-Command Add-MpPreference -ErrorAction SilentlyContinue |
| 45 | + if (-not $cmd) { |
| 46 | + Write-Host "Add-MpPreference not available, skipping Defender exclusions." |
| 47 | + exit 0 |
| 48 | + } |
| 49 | +
|
| 50 | + try { |
| 51 | + Add-MpPreference -ExclusionPath "$env:GITHUB_WORKSPACE" -ErrorAction Stop |
| 52 | + Add-MpPreference -ExclusionProcess "node.exe" -ErrorAction Stop |
| 53 | + Write-Host "Defender exclusions applied." |
| 54 | + } catch { |
| 55 | + Write-Warning "Failed to apply Defender exclusions, continuing. $($_.Exception.Message)" |
| 56 | + } |
| 57 | +
|
| 58 | + - name: Setup Node.js |
| 59 | + uses: actions/setup-node@v6 |
| 60 | + with: |
| 61 | + node-version: 24.x |
| 62 | + check-latest: false |
| 63 | + |
| 64 | + - name: Setup pnpm + cache store |
| 65 | + id: pnpm-cache |
| 66 | + uses: ./.github/actions/setup-pnpm-store-cache |
| 67 | + with: |
| 68 | + pnpm-version: "10.33.0" |
| 69 | + cache-key-suffix: "windows-testbox-node24" |
| 70 | + use-restore-keys: "false" |
| 71 | + use-actions-cache: "true" |
| 72 | + |
| 73 | + - name: Capture Node path |
| 74 | + run: | |
| 75 | + node_bin="$(dirname "$(node -p 'process.execPath')")" |
| 76 | + if command -v cygpath >/dev/null 2>&1; then |
| 77 | + node_bin="$(cygpath -u "$node_bin")" |
| 78 | + fi |
| 79 | + echo "NODE_BIN=$node_bin" >> "$GITHUB_ENV" |
| 80 | +
|
| 81 | + - name: Install dependencies |
| 82 | + env: |
| 83 | + CI: true |
| 84 | + run: | |
| 85 | + export PATH="$NODE_BIN:$PATH" |
| 86 | + node -v |
| 87 | + npm -v |
| 88 | + pnpm -v |
| 89 | + pnpm install --frozen-lockfile --prefer-offline --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true --config.side-effects-cache=true || pnpm install --frozen-lockfile --prefer-offline --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true --config.side-effects-cache=true |
| 90 | +
|
| 91 | + - name: Save pnpm store cache |
| 92 | + if: steps.pnpm-cache.outputs.cache-enabled == 'true' && steps.pnpm-cache.outputs.cache-hit != 'true' |
| 93 | + uses: actions/cache/save@v5 |
| 94 | + continue-on-error: true |
| 95 | + with: |
| 96 | + path: ${{ steps.pnpm-cache.outputs.store-path }} |
| 97 | + key: ${{ steps.pnpm-cache.outputs.primary-key }} |
| 98 | + |
| 99 | + - name: Hydrate Testbox provider env helper |
| 100 | + shell: bash |
| 101 | + env: |
| 102 | + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 103 | + ANTHROPIC_API_KEY_OLD: ${{ secrets.ANTHROPIC_API_KEY_OLD }} |
| 104 | + ANTHROPIC_API_TOKEN: ${{ secrets.ANTHROPIC_API_TOKEN }} |
| 105 | + CEREBRAS_API_KEY: ${{ secrets.CEREBRAS_API_KEY }} |
| 106 | + DEEPINFRA_API_KEY: ${{ secrets.DEEPINFRA_API_KEY }} |
| 107 | + FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }} |
| 108 | + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} |
| 109 | + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} |
| 110 | + GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} |
| 111 | + KIMI_API_KEY: ${{ secrets.KIMI_API_KEY }} |
| 112 | + MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }} |
| 113 | + MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} |
| 114 | + MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }} |
| 115 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 116 | + OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} |
| 117 | + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} |
| 118 | + QWEN_API_KEY: ${{ secrets.QWEN_API_KEY }} |
| 119 | + TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }} |
| 120 | + XAI_API_KEY: ${{ secrets.XAI_API_KEY }} |
| 121 | + ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }} |
| 122 | + Z_AI_API_KEY: ${{ secrets.Z_AI_API_KEY }} |
| 123 | + run: bash scripts/ci-hydrate-testbox-env.sh |
| 124 | + |
| 125 | + - name: Run Testbox |
| 126 | + uses: useblacksmith/run-testbox@5ca05834db1d3813554d1dd109e5f2087a8d7cbc |
| 127 | + if: always() |
| 128 | + env: |
| 129 | + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" |
0 commit comments