|
| 1 | +# This file is managed by ServiceBot plugin - Semaphore. The content in this file is created using a common |
| 2 | +# template and configurations in service.yml. |
| 3 | +# Any modifications made to version, name, agent, and global_job_config will be overwritten by the generated |
| 4 | +# content in nightly runs. Code changes made to the remaining sections will not be affected. |
| 5 | +version: v1.0 |
| 6 | +name: win32-x64-build-test |
| 7 | +agent: |
| 8 | + machine: |
| 9 | + type: s1-prod-windows |
| 10 | + |
| 11 | +auto_cancel: |
| 12 | + running: |
| 13 | + when: "branch != 'main'" |
| 14 | + |
| 15 | +execution_time_limit: |
| 16 | + hours: 1 |
| 17 | + |
| 18 | +queue: |
| 19 | + - when: "branch != 'main'" |
| 20 | + processing: parallel |
| 21 | + |
| 22 | +blocks: |
| 23 | + - name: "Build & Test (win32 x64)" |
| 24 | + dependencies: [] |
| 25 | + skip: |
| 26 | + when: "change_in(['/release.svg', '/.versions/next.txt'], {pipeline_file: 'ignore', branch_range: '$SEMAPHORE_GIT_COMMIT_RANGE', default_branch: 'main'})" |
| 27 | + task: |
| 28 | + prologue: |
| 29 | + commands: |
| 30 | + - checkout |
| 31 | + - make ci-bin-sem-cache-restore |
| 32 | + - $Env:PATH += ";C:\Program Files\Git\bin" |
| 33 | + - $Env:PATH += ";C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64" |
| 34 | + # Ensure npm and npx are available |
| 35 | + - npm --version |
| 36 | + - npx --version |
| 37 | + - choco install gh -y |
| 38 | + - $Env:PATH += ";C:\Program Files\GitHub CLI\" |
| 39 | + - gh --version |
| 40 | + - | |
| 41 | + if (Test-Path "$HOME/.gh-token") { |
| 42 | + $Env:GH_TOKEN = Get-Content "$HOME/.gh-token" -Raw | ForEach-Object { $_.Trim() } |
| 43 | + if ([string]::IsNullOrEmpty($Env:GH_TOKEN)) { |
| 44 | + Write-Error "Token file exists but is empty" |
| 45 | + exit 1 |
| 46 | + } |
| 47 | + gh config set prompt disabled |
| 48 | + $Env:GH_TOKEN | gh auth login --with-token |
| 49 | + gh auth status |
| 50 | + } else { |
| 51 | + Write-Error "Token file not found at $HOME/.gh-token" |
| 52 | + exit 1 |
| 53 | + } |
| 54 | + - | |
| 55 | + if ($Env:SEMAPHORE_ORGANIZATION_URL -like "*.semaphoreci.com") { |
| 56 | + Write-Output "Skipping Vault setup for Semaphore CI" |
| 57 | + } else { |
| 58 | + $Env:VAULT_ADDR = "https://vault.cireops.gcp.internal.confluent.cloud" |
| 59 | + $token = $(vault write -field=token "auth/semaphore_self_hosted/login" role="default" jwt="$Env:SEMAPHORE_OIDC_TOKEN") |
| 60 | + vault login -no-print token=$token |
| 61 | + } |
| 62 | + - $E2E_USERNAME = $(vault kv get -field=E2E_USERNAME v1/ci/kv/vscodeextension/testing) |
| 63 | + - Set-Content -Path .env -Value "E2E_USERNAME=$E2E_USERNAME" |
| 64 | + - $E2E_PASSWORD = $(vault kv get -field=E2E_PASSWORD v1/ci/kv/vscodeextension/testing) |
| 65 | + - Add-Content -Path .env -Value "E2E_PASSWORD=$E2E_PASSWORD" |
| 66 | + jobs: |
| 67 | + - name: "Build & Test (win32 x64)" |
| 68 | + commands: |
| 69 | + - npm ci --prefer-offline --include=dev |
| 70 | + - npx playwright install |
| 71 | + - npx gulp build |
| 72 | + - npx gulp test |
| 73 | + - npx gulp functional |
| 74 | + matrix: |
| 75 | + - env_var: VSCODE_VERSION |
| 76 | + values: ["stable", "insiders"] |
| 77 | + epilogue: |
| 78 | + always: |
| 79 | + commands: |
| 80 | + - Remove-Item .env -ErrorAction SilentlyContinue |
| 81 | + # Windows version of store-test-results-to-semaphore |
| 82 | + - | |
| 83 | + $TestResultFile = Join-Path -Path $PWD -ChildPath "TEST-result.xml" |
| 84 | + if (Test-Path $TestResultFile) { |
| 85 | + Write-Output "Publishing test results from $TestResultFile" |
| 86 | + test-results publish $TestResultFile --force |
| 87 | + } else { |
| 88 | + Write-Output "Test results not found at $TestResultFile" |
| 89 | + } |
| 90 | +
|
| 91 | +after_pipeline: |
| 92 | + task: |
| 93 | + jobs: |
| 94 | + - name: Publish Test Results to Semaphore |
| 95 | + commands: |
| 96 | + - test-results gen-pipeline-report || echo "Could not publish pipeline test result report due to probably no test results to publish" |
0 commit comments