|
| 1 | +name: CI-Win |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + tags: |
| 11 | + - "v*" |
| 12 | + |
| 13 | +jobs: |
| 14 | + pyinstaller_api: |
| 15 | + name: PyInstaller API Service Compilation |
| 16 | + runs-on: windows-11-desktop |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + python-version: ["3.10"] |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout code |
| 23 | + uses: actions/checkout@v2 |
| 24 | + |
| 25 | + - name: Set up Python |
| 26 | + uses: actions/setup-python@v2 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.python-version }} |
| 29 | + |
| 30 | + - name: Inspect Python version |
| 31 | + run: python --version |
| 32 | + |
| 33 | + - name: Install Git |
| 34 | + run: | |
| 35 | + $installer_url = "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe" |
| 36 | + Invoke-WebRequest -Uri $installer_url -OutFile "GitInstaller.exe" |
| 37 | + Start-Process -FilePath "GitInstaller.exe" -Args "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS='icons,ext\reg\shellhere,assoc,assoc_sh'" -Wait |
| 38 | + Remove-Item "GitInstaller.exe" |
| 39 | +
|
| 40 | + # Add Git to PATH |
| 41 | + $gitPath = "C:\Program Files\Git\cmd" |
| 42 | + $env:PATH = "$gitPath;$env:PATH" |
| 43 | + [Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::Machine) |
| 44 | +
|
| 45 | + # Output the new PATH to a step output |
| 46 | + echo "PATH=$env:PATH" >> $env:GITHUB_ENV |
| 47 | +
|
| 48 | + # Verify Git installation |
| 49 | + git --version |
| 50 | + shell: powershell |
| 51 | + |
| 52 | + - name: Verify Git in PATH |
| 53 | + run: | |
| 54 | + Write-Host "Current PATH: $env:PATH" |
| 55 | + $gitPath = (Get-Command git -ErrorAction SilentlyContinue).Path |
| 56 | + if ($gitPath) { |
| 57 | + Write-Host "Git found at: $gitPath" |
| 58 | + } else { |
| 59 | + Write-Host "Git not found in PATH" |
| 60 | + exit 1 |
| 61 | + } |
| 62 | + shell: powershell |
| 63 | + |
| 64 | + - name: Inspect git version |
| 65 | + run: | |
| 66 | + git --version |
| 67 | +
|
| 68 | + - name: Remove cloud-only modules and start compiling API service |
| 69 | + run: | |
| 70 | + $ErrorActionPreference = "Stop" |
| 71 | + .\scripts\compile_api_exe.ps1 |
| 72 | + shell: powershell |
| 73 | + |
| 74 | + - name: Validate api.exe is healthy |
| 75 | + run: | |
| 76 | + $env:OWL_WORKERS=1 |
| 77 | + $process = Start-Process -NoNewWindow -FilePath ".\services\api\dist\api\api.exe" -PassThru |
| 78 | + Start-Sleep -Seconds 10 |
| 79 | + Write-Output "API process ID: $($process.Id)" |
| 80 | + Get-Process |
| 81 | + Test-NetConnection -ComputerName localhost -Port 6969 |
| 82 | + $response = Invoke-WebRequest -Uri http://localhost:6969/api/health -UseBasicParsing |
| 83 | + if ($response.StatusCode -eq 200) { |
| 84 | + Write-Output "API is healthy" |
| 85 | + } else { |
| 86 | + throw "API is not healthy" |
| 87 | + } |
| 88 | + $processId = (Get-Process -Name api -ErrorAction SilentlyContinue).Id |
| 89 | + if ($null -ne $processId) { |
| 90 | + Stop-Process -Id $processId -Force |
| 91 | + } else { |
| 92 | + Write-Output "API process not found." |
| 93 | + } |
| 94 | + shell: powershell |
| 95 | + |
| 96 | + pyinstaller_docio: |
| 97 | + name: PyInstaller DocIO Service Compilation |
| 98 | + runs-on: windows-11-desktop |
| 99 | + strategy: |
| 100 | + matrix: |
| 101 | + python-version: ["3.10"] |
| 102 | + |
| 103 | + steps: |
| 104 | + - name: Checkout code |
| 105 | + uses: actions/checkout@v2 |
| 106 | + |
| 107 | + - name: Set up Python |
| 108 | + uses: actions/setup-python@v2 |
| 109 | + with: |
| 110 | + python-version: ${{ matrix.python-version }} |
| 111 | + |
| 112 | + - name: Display Python version |
| 113 | + run: python --version |
| 114 | + |
| 115 | + - name: Install Microsoft Visual C++ Redistributable |
| 116 | + run: | |
| 117 | + Invoke-WebRequest -Uri "https://aka.ms/vs/16/release/vc_redist.x64.exe" -OutFile "vc_redist.x64.exe" |
| 118 | + Start-Process -FilePath "./vc_redist.x64.exe" -ArgumentList "/quiet", "/install" -NoNewWindow -Wait |
| 119 | +
|
| 120 | + - name: Install Git |
| 121 | + run: | |
| 122 | + $installer_url = "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe" |
| 123 | + Invoke-WebRequest -Uri $installer_url -OutFile "GitInstaller.exe" |
| 124 | + Start-Process -FilePath "GitInstaller.exe" -Args "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS='icons,ext\reg\shellhere,assoc,assoc_sh'" -Wait |
| 125 | + Remove-Item "GitInstaller.exe" |
| 126 | +
|
| 127 | + # Add Git to PATH |
| 128 | + $gitPath = "C:\Program Files\Git\cmd" |
| 129 | + $env:PATH = "$gitPath;$env:PATH" |
| 130 | + [Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::Machine) |
| 131 | +
|
| 132 | + # Output the new PATH to a step output |
| 133 | + echo "PATH=$env:PATH" >> $env:GITHUB_ENV |
| 134 | +
|
| 135 | + # Verify Git installation |
| 136 | + git --version |
| 137 | + shell: powershell |
| 138 | + |
| 139 | + - name: Verify Git in PATH |
| 140 | + run: | |
| 141 | + Write-Host "Current PATH: $env:PATH" |
| 142 | + $gitPath = (Get-Command git -ErrorAction SilentlyContinue).Path |
| 143 | + if ($gitPath) { |
| 144 | + Write-Host "Git found at: $gitPath" |
| 145 | + } else { |
| 146 | + Write-Host "Git not found in PATH" |
| 147 | + exit 1 |
| 148 | + } |
| 149 | + shell: powershell |
| 150 | + |
| 151 | + - name: Remove cloud-only modules and start compiling DocIO service |
| 152 | + run: | |
| 153 | + $ErrorActionPreference = "Stop" |
| 154 | + .\scripts\compile_docio_exe.ps1 |
| 155 | + shell: powershell |
| 156 | + |
| 157 | + - name: Validate docio.exe is healthy |
| 158 | + run: | |
| 159 | + $env:DOCIO_WORKERS=1 |
| 160 | + $process = Start-Process -NoNewWindow -FilePath ".\services\docio\dist\docio\docio.exe" -PassThru |
| 161 | + Start-Sleep -Seconds 10 |
| 162 | + Write-Output "DocIO process ID: $($process.Id)" |
| 163 | + Get-Process |
| 164 | + Test-NetConnection -ComputerName localhost -Port 6979 |
| 165 | + $response = Invoke-WebRequest -Uri http://localhost:6979/health -UseBasicParsing |
| 166 | + if ($response.StatusCode -eq 200) { |
| 167 | + Write-Output "DocIO is healthy" |
| 168 | + } else { |
| 169 | + throw "DocIO is not healthy" |
| 170 | + } |
| 171 | + $processId = (Get-Process -Name docio -ErrorAction SilentlyContinue).Id |
| 172 | + if ($null -ne $processId) { |
| 173 | + Stop-Process -Id $processId -Force |
| 174 | + } else { |
| 175 | + Write-Output "DocIO process not found." |
| 176 | + } |
| 177 | + shell: powershell |
0 commit comments