Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
ci: Enhance cross-platform test matrix for GitHub workflows
trohitga749b0ee4f54
diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.ymlindex e34e74c2..975ffffb 100644--- a/.github/actions/setup/action.yml+++ b/.github/actions/setup/action.yml@@ -6,9 +6,10 @@# - uses: ./.github/actions/setup# with:# node-version: '22'+# python-version: '3.11'name: 'Setup MachinaOS Environment'-description: 'Setup Node.js, Python, and uv.'+description: 'Setup Node.js, Python, and uv for cross-platform builds.'inputs:node-version:@@ -34,3 +35,11 @@ runs:- name: Install uvuses: astral-sh/setup-uv@v4++ - name: Verify installations+ shell: bash+ run: |+ echo "Node.js: $(node --version)"+ echo "npm: $(npm --version)"+ echo "Python: $(python --version)"+ echo "uv: $(uv --version)"diff --git a/.github/workflows/predeploy.yml b/.github/workflows/predeploy.ymlindex 59c7ea1f..9b6db6c6 100644--- a/.github/workflows/predeploy.yml+++ b/.github/workflows/predeploy.yml@@ -16,12 +16,18 @@ jobs:- name: Setup environmentuses: ./.github/actions/setup+ - name: Install dependencies+ run: npm install+- name: Build all servicesrun: npm run build- name: Lint clientrun: cd client && npm run lint+ - name: TypeScript check+ run: cd client && npx tsc --noEmit+docker-build:runs-on: ubuntu-lateststeps:@@ -106,6 +112,13 @@ jobs:matrix:os: [ubuntu-latest, macos-latest, windows-latest]node-version: [20, 22]+ python-version: ['3.11', '3.12']+ exclude:+ # Reduce matrix size - test Python 3.11 only on ubuntu, 3.12 on all+ - os: macos-latest+ python-version: '3.11'+ - os: windows-latest+ python-version: '3.11'steps:- name: Checkoutuses: actions/checkout@v4@@ -115,6 +128,10 @@ jobs:uses: ./.github/actions/setupwith:node-version: ${{ matrix.node-version }}+ python-version: ${{ matrix.python-version }}++ - name: Install root dependencies+ run: npm install --ignore-scripts- name: Pack npm packagerun: npm pack@@ -124,6 +141,7 @@ jobs:run: |npm install -g machinaos-*.tgzmachinaos --help+ machinaos --version- name: Build (install client deps, build client, setup Python venv)shell: bash@@ -135,22 +153,63 @@ jobs:INSTALL_PATH=$(npm root -g)/machinaosecho "Installed to: $INSTALL_PATH"- test -f "$INSTALL_PATH/.env" && echo ".env exists"- test -d "$INSTALL_PATH/client/dist" && echo "client/dist/ built"- test -d "$INSTALL_PATH/server/.venv" && echo "server/.venv/ created"+ # Check essential files exist+ test -f "$INSTALL_PATH/.env" && echo ".env exists" || echo ".env missing"+ test -d "$INSTALL_PATH/client/dist" && echo "client/dist/ built" || (echo "client/dist/ missing" && exit 1)+ test -d "$INSTALL_PATH/server/.venv" && echo "server/.venv/ created" || (echo "server/.venv/ missing" && exit 1)++ # Verify Python venv is functional+ if [[ "$RUNNER_OS" == "Windows" ]]; then+ "$INSTALL_PATH/server/.venv/Scripts/python" --version+ else+ "$INSTALL_PATH/server/.venv/bin/python" --version+ fi- - name: Test machinaos start+ - name: Test machinaos start (Unix)+ if: runner.os != 'Windows'shell: bashrun: |machinaos start &PID=$!- sleep 10+ # Wait for services to start+ for i in {1..15}; do+ if curl -sf http://localhost:3010/health > /dev/null 2>&1; then+ echo "Backend healthy after $((i*2))s"+ break+ fi+ sleep 2+ doneif kill -0 $PID 2>/dev/null; thenecho "machinaos start: OK - process running"- kill $PID 2>/dev/null || true+ machinaos stop || kill $PID 2>/dev/null || trueelseecho "machinaos start: FAILED - process exited"exit 1fi++ - name: Test machinaos start (Windows)+ if: runner.os == 'Windows'+ shell: pwsh+ run: |+ $job = Start-Job -ScriptBlock { machinaos start }+ Start-Sleep -Seconds 15++ # Check if backend is responding+ try {+ $response = Invoke-WebRequest -Uri "http://localhost:3010/health" -UseBasicParsing -TimeoutSec 5+ Write-Host "Backend healthy: $($response.StatusCode)"+ } catch {+ Write-Host "Backend not responding (may still be starting)"+ }++ if ($job.State -eq "Running") {+ Write-Host "machinaos start: OK - process running"+ Stop-Job $job+ Remove-Job $job+ } else {+ Write-Host "machinaos start: FAILED - job state: $($job.State)"+ Receive-Job $job+ exit 1+ }