Skip to content

Blender Agent Framework and Notebook #51

Blender Agent Framework and Notebook

Blender Agent Framework and Notebook #51

Workflow file for this run

# Copyright(C) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: GAIA CLI Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
permissions:
contents: read
jobs:
gaia-cli-pytest:
runs-on: windows-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
steps:
- uses: actions/checkout@v4
- name: Download and Install Miniforge
run: |
Invoke-WebRequest -Uri "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe" -OutFile "miniforge3.exe"
Start-Process -FilePath "miniforge3.exe" -ArgumentList "/S", "/D=$env:GITHUB_WORKSPACE\miniforge3" -Wait
- name: Initialize Conda
run: |
Write-Host "Step 1: Get conda path"
$condaPath = "$env:GITHUB_WORKSPACE\miniforge3"
$env:Path = "$condaPath;$condaPath\Scripts;$env:Path"
Write-Host "Step 2: Initialize conda for both shells"
& "$condaPath\Scripts\conda.exe" init powershell
& "$condaPath\Scripts\conda.exe" init cmd.exe
Write-Host "Step 3: Create the environment at system level"
& "$condaPath\Scripts\conda.exe" create -n gaiaenv python=3.10 -y
- name: Install GAIA dependencies
run: |
Write-Host "Step 1: Activate conda environment"
& "$env:GITHUB_WORKSPACE\miniforge3\shell\condabin\conda-hook.ps1"
conda activate gaiaenv
Write-Host "Step 2: Install dependencies"
python -m pip install --upgrade pip
pip install -e .[clip,joker,rag,talk,dev]
Write-Host "Step 3: Verify installation"
$gaiaPath = Get-Command gaia -ErrorAction SilentlyContinue
if (-not $gaiaPath) {
Write-Host "Error: gaia not installed correctly"
Write-Host "Current PATH: $env:Path"
exit 1
}
Write-Host "Found gaia at: $($gaiaPath.Source)"
python -m pip check
- name: Lint with Black
uses: psf/black@stable
with:
options: "--check --verbose --config pyproject.toml"
src: "./installer ./plot ./src ./tests"
- name: PyLint
run: |
Write-Host "Step 1: Activate conda environment"
& "$env:GITHUB_WORKSPACE\miniforge3\shell\condabin\conda-hook.ps1"
conda activate gaiaenv
Write-Host "Step 2: Install pylint"
pip install pylint
Write-Host "Step 3: Run pylint"
& ".\util\lint.ps1" -RunPylint
- name: Install Ollama
shell: cmd
run: |
curl -L https://ollama.com/download/OllamaSetup.exe -o OllamaSetup.exe --progress-bar
echo Ollama download complete. Starting installation.
start /wait OllamaSetup.exe /VERYSILENT /SUPPRESSMSGBOXES /SP- /LOG="llama_install.log"
echo "Ollama installation log:"
type llama_install.log
echo "PATH=C:\Users\runneradmin\AppData\Local\Programs\Ollama;%PATH%" >> $GITHUB_ENV
del OllamaSetup.exe
- name: Verify Ollama Installation
shell: cmd
run: |
if exist "C:\Users\runneradmin\AppData\Local\Programs\Ollama\ollama.exe" (
echo "Ollama installed successfully."
) else (
echo "Ollama installation failed. Executable not found."
exit 1
)
set PATH=%PATH%;C:\Users\runneradmin\AppData\Local\Programs\Ollama
ollama --version
- uses: FedericoCarboni/setup-ffmpeg@v3
id: setup-ffmpeg
- name: Set GAIA Mode
shell: cmd
run: |
- name: Test GAIA
timeout-minutes: 20
env:
HUGGINGFACE_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}
HF_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}
GAIA_MODE: GENERIC
run: |
Write-Host "Activate and verify Conda environment"
$env:Path = "$env:GITHUB_WORKSPACE\miniforge3;$env:GITHUB_WORKSPACE\miniforge3\Scripts;$env:Path"
& "$env:GITHUB_WORKSPACE\miniforge3\shell\condabin\conda-hook.ps1"
conda activate gaiaenv
cmd /c set_generic_mode.bat
echo GAIA_MODE=%GAIA_MODE%
Write-Host "Verify Python environment"
python -c "import sys; print(sys.executable)"
Write-Host "Verify NumPy is available"
python -c "import numpy; print(f'NumPy version: {numpy.__version__}'); print(f'NumPy path: {numpy.__file__}')"
Write-Host "Find gaia executable location"
$gaiaPath = Get-Command gaia -ErrorAction SilentlyContinue
if (-not $gaiaPath) {
Write-Host "Error: Cannot find gaia executable in PATH"
Write-Host "Current PATH: $env:Path"
exit 1
}
Write-Host "Found gaia at: $($gaiaPath.Source)"
Write-Host "Running test_gaia.py"
python tests\test_gaia.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_gaia.py failed with exit code $LASTEXITCODE"
}
Write-Host "Running test_llama_index.py"
python tests\test_llama_index.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_llama_index.py failed with exit code $LASTEXITCODE"
}
Write-Host "Running test_asr.py"
python tests\unit\test_asr.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_asr.py failed with exit code $LASTEXITCODE"
}
Write-Host "Running test_tts.py"
python tests\unit\test_tts.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_tts.py failed with exit code $LASTEXITCODE"
}
Write-Host "Running test_rag.py"
python tests\test_rag.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_rag.py failed with exit code $LASTEXITCODE"
}