Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,125 @@ jobs:
exit 1
fi
echo "Binary test passed"

build-windows:
needs: check
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Python dependencies and build
shell: pwsh
run: |
python -m pip install --upgrade pip setuptools pyinstaller

# Install Poetry using pip for consistency
pip install poetry==1.4.0
poetry config virtualenvs.create false
poetry install --no-root

# Build binary with PyInstaller (PowerShell backticks and Windows ';' separators)
pyinstaller holmes_cli.py `
--name holmes `
--add-data "holmes/plugins/runbooks/*;holmes/plugins/runbooks" `
--add-data "holmes/plugins/prompts/*;holmes/plugins/prompts" `
--add-data "holmes/plugins/toolsets/*;holmes/plugins/toolsets" `
--add-data "holmes/plugins/toolsets/coralogix*;holmes/plugins/toolsets/coralogix" `
--add-data "holmes/plugins/toolsets/grafana*;holmes/plugins/toolsets/grafana" `
--add-data "holmes/plugins/toolsets/internet*;holmes/plugins/toolsets/internet" `
--add-data "holmes/plugins/toolsets/opensearch*;holmes/plugins/toolsets/opensearch" `
--add-data "holmes/plugins/toolsets/prometheus*;holmes/plugins/toolsets/prometheus" `
--hidden-import=tiktoken_ext.openai_public `
--hidden-import=tiktoken_ext `
--hidden-import=litellm.llms.tokenizers `
--hidden-import=litellm.litellm_core_utils.tokenizers `
--collect-data litellm
dir dist

- name: Run tests
shell: powershell
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
poetry run pytest -m "not llm"

- name: Test the binary
shell: powershell
run: |
& "dist\holmes\holmes.exe" version
if ($LASTEXITCODE -ne 0) {
Write-Host "Binary test failed"
exit 1
}
Write-Host "Binary test passed"

build-macos:
needs: check
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies and build
run: |
python -m pip install --upgrade pip setuptools pyinstaller

# Install Poetry using curl (consistent with Linux)
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.0
poetry config virtualenvs.create false
poetry install --no-root

# Install macOS system dependencies
brew install unixodbc

pyinstaller holmes_cli.py \
--name holmes \
--add-data 'holmes/plugins/runbooks/*:holmes/plugins/runbooks' \
--add-data 'holmes/plugins/prompts/*:holmes/plugins/prompts' \
--add-data 'holmes/plugins/toolsets/*:holmes/plugins/toolsets' \
--add-data 'holmes/plugins/toolsets/coralogix*:holmes/plugins/toolsets/coralogix' \
--add-data 'holmes/plugins/toolsets/grafana*:holmes/plugins/toolsets/grafana' \
--add-data 'holmes/plugins/toolsets/internet*:holmes/plugins/toolsets/internet' \
--add-data 'holmes/plugins/toolsets/opensearch*:holmes/plugins/toolsets/opensearch' \
--add-data 'holmes/plugins/toolsets/prometheus*:holmes/plugins/toolsets/prometheus' \
--hidden-import=tiktoken_ext.openai_public \
--hidden-import=tiktoken_ext \
--hidden-import=litellm.llms.tokenizers \
--hidden-import=litellm.litellm_core_utils.tokenizers \
--collect-data litellm
ls dist

- name: Run tests
shell: bash
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
poetry run pytest -m "not llm"

- name: Test the binary
shell: bash
run: |
dist/holmes/holmes version
if [ $? -ne 0 ]; then
echo "Binary test failed"
exit 1
fi
echo "Binary test passed"
Loading