Skip to content

Add newline to end to runbook #5

Add newline to end to runbook

Add newline to end to runbook #5

# this runs on every commit/PR to test that we are properly building binaries that work
# we test this on each commit/PR to catch build problems early
name: Build and test HolmesGPT
on: [push, pull_request, workflow_dispatch]
jobs:
check:
name: Pre-commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Install dependencies
run: poetry install --no-interaction --no-root
- uses: pre-commit/action@v3.0.1
build:
needs: check
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies and build
# if you change something here, you must also change it in .github/workflows/build-binaries-and-brew.yaml
run: |
python -m pip install --upgrade pip setuptools pyinstaller
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.0
poetry config virtualenvs.create false
poetry install --no-root
sudo apt-get install -y binutils
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 \
--hiddenimport litellm.llms.tokenizers \
--hiddenimport 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"