Skip to content

Merge changes for v0.2 release #4

Merge changes for v0.2 release

Merge changes for v0.2 release #4

Workflow file for this run

name: CI-Win
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "v*"
jobs:
pyinstaller_api:
name: PyInstaller API Service Compilation
runs-on: windows-11-desktop
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Inspect Python version
run: python --version
- name: Install Git
run: |
$installer_url = "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe"
Invoke-WebRequest -Uri $installer_url -OutFile "GitInstaller.exe"
Start-Process -FilePath "GitInstaller.exe" -Args "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS='icons,ext\reg\shellhere,assoc,assoc_sh'" -Wait
Remove-Item "GitInstaller.exe"
# Add Git to PATH
$gitPath = "C:\Program Files\Git\cmd"
$env:PATH = "$gitPath;$env:PATH"
[Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::Machine)
# Output the new PATH to a step output
echo "PATH=$env:PATH" >> $env:GITHUB_ENV
# Verify Git installation
git --version
shell: powershell
- name: Verify Git in PATH
run: |
Write-Host "Current PATH: $env:PATH"
$gitPath = (Get-Command git -ErrorAction SilentlyContinue).Path
if ($gitPath) {
Write-Host "Git found at: $gitPath"
} else {
Write-Host "Git not found in PATH"
exit 1
}
shell: powershell
- name: Inspect git version
run: |
git --version
- name: Remove cloud-only modules and start compiling API service
run: |
$ErrorActionPreference = "Stop"
.\scripts\compile_api_exe.ps1
shell: powershell
- name: Validate api.exe is healthy
run: |
$env:OWL_WORKERS=1
$process = Start-Process -NoNewWindow -FilePath ".\services\api\dist\api\api.exe" -PassThru
Start-Sleep -Seconds 10
Write-Output "API process ID: $($process.Id)"
Get-Process
Test-NetConnection -ComputerName localhost -Port 6969
$response = Invoke-WebRequest -Uri http://localhost:6969/api/health -UseBasicParsing
if ($response.StatusCode -eq 200) {
Write-Output "API is healthy"
} else {
throw "API is not healthy"
}
$processId = (Get-Process -Name api -ErrorAction SilentlyContinue).Id
if ($null -ne $processId) {
Stop-Process -Id $processId -Force
} else {
Write-Output "API process not found."
}
shell: powershell
pyinstaller_docio:
name: PyInstaller DocIO Service Compilation
runs-on: windows-11-desktop
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Install Microsoft Visual C++ Redistributable
run: |
Invoke-WebRequest -Uri "https://aka.ms/vs/16/release/vc_redist.x64.exe" -OutFile "vc_redist.x64.exe"
Start-Process -FilePath "./vc_redist.x64.exe" -ArgumentList "/quiet", "/install" -NoNewWindow -Wait
- name: Install Git
run: |
$installer_url = "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe"
Invoke-WebRequest -Uri $installer_url -OutFile "GitInstaller.exe"
Start-Process -FilePath "GitInstaller.exe" -Args "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS='icons,ext\reg\shellhere,assoc,assoc_sh'" -Wait
Remove-Item "GitInstaller.exe"
# Add Git to PATH
$gitPath = "C:\Program Files\Git\cmd"
$env:PATH = "$gitPath;$env:PATH"
[Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::Machine)
# Output the new PATH to a step output
echo "PATH=$env:PATH" >> $env:GITHUB_ENV
# Verify Git installation
git --version
shell: powershell
- name: Verify Git in PATH
run: |
Write-Host "Current PATH: $env:PATH"
$gitPath = (Get-Command git -ErrorAction SilentlyContinue).Path
if ($gitPath) {
Write-Host "Git found at: $gitPath"
} else {
Write-Host "Git not found in PATH"
exit 1
}
shell: powershell
- name: Remove cloud-only modules and start compiling DocIO service
run: |
$ErrorActionPreference = "Stop"
.\scripts\compile_docio_exe.ps1
shell: powershell
- name: Validate docio.exe is healthy
run: |
$env:DOCIO_WORKERS=1
$process = Start-Process -NoNewWindow -FilePath ".\services\docio\dist\docio\docio.exe" -PassThru
Start-Sleep -Seconds 10
Write-Output "DocIO process ID: $($process.Id)"
Get-Process
Test-NetConnection -ComputerName localhost -Port 6979
$response = Invoke-WebRequest -Uri http://localhost:6979/health -UseBasicParsing
if ($response.StatusCode -eq 200) {
Write-Output "DocIO is healthy"
} else {
throw "DocIO is not healthy"
}
$processId = (Get-Process -Name docio -ErrorAction SilentlyContinue).Id
if ($null -ne $processId) {
Stop-Process -Id $processId -Force
} else {
Write-Output "DocIO process not found."
}
shell: powershell