201 lines
6.4 KiB
YAML
201 lines
6.4 KiB
YAML
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
inputs:
|
|
branch:
|
|
description: "Branch to test"
|
|
required: true
|
|
default: "main"
|
|
type: string
|
|
|
|
name: Live Provider Tests
|
|
|
|
jobs:
|
|
check-fork:
|
|
runs-on: ubuntu-latest
|
|
# Skip entire workflow for PRs from forks (they don't have access to secrets)
|
|
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
|
|
steps:
|
|
- run: echo "Not a fork PR - proceeding with smoke tests"
|
|
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
needs: check-fork
|
|
outputs:
|
|
code: ${{ steps.filter.outputs.code }}
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
|
|
with:
|
|
ref: ${{ github.event.inputs.branch || github.ref }}
|
|
fetch-depth: 0
|
|
|
|
- name: Check for code changes
|
|
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # pin@v3
|
|
id: filter
|
|
with:
|
|
base: ${{ github.event.before || github.event.pull_request.base.sha }}
|
|
filters: |
|
|
code:
|
|
- '!documentation/**'
|
|
|
|
build-binary:
|
|
name: Build Release Binary
|
|
runs-on: ubuntu-latest
|
|
needs: changes
|
|
if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch'
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
|
|
with:
|
|
ref: ${{ github.event.inputs.branch || github.ref }}
|
|
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
sudo apt update -y
|
|
sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev
|
|
|
|
- name: Cache Rust dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Build Release Binary for Smoke Tests
|
|
run: |
|
|
cargo build --release
|
|
|
|
- name: Upload Binary for Smoke Tests
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: goose-binary
|
|
path: target/release/goose
|
|
retention-days: 1
|
|
|
|
smoke-tests:
|
|
name: Smoke Tests
|
|
runs-on: ubuntu-latest
|
|
needs: build-binary
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
|
|
with:
|
|
ref: ${{ github.event.inputs.branch || github.ref }}
|
|
|
|
- name: Download Binary
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: goose-binary
|
|
path: target/release
|
|
|
|
- name: Make Binary Executable
|
|
run: chmod +x target/release/goose
|
|
|
|
- name: Run Smoke Tests with Provider Script
|
|
env:
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
|
|
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
|
|
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
|
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
|
|
TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
|
|
HOME: /tmp/goose-home
|
|
GOOSE_DISABLE_KEYRING: 1
|
|
SKIP_BUILD: 1
|
|
run: |
|
|
# Ensure the HOME directory structure exists
|
|
mkdir -p $HOME/.local/share/goose/sessions
|
|
mkdir -p $HOME/.config/goose
|
|
|
|
# Run the provider test script (binary already built and downloaded)
|
|
bash scripts/test_providers.sh
|
|
|
|
- name: Run MCP Tests
|
|
env:
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
|
|
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
|
|
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
|
TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
|
|
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
|
|
HOME: /tmp/goose-home
|
|
GOOSE_DISABLE_KEYRING: 1
|
|
SKIP_BUILD: 1
|
|
run: |
|
|
bash scripts/test_mcp.sh
|
|
|
|
- name: Run Subrecipe Tests
|
|
env:
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
GOOSE_PROVIDER: anthropic
|
|
GOOSE_MODEL: claude-sonnet-4-5-20250929
|
|
HOME: /tmp/goose-home
|
|
GOOSE_DISABLE_KEYRING: 1
|
|
SKIP_BUILD: 1
|
|
run: |
|
|
bash scripts/test_subrecipes.sh
|
|
|
|
- name: Set up Python (for error proxy)
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install uv (for error proxy)
|
|
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # pin@v6
|
|
|
|
- name: Run Compaction Tests
|
|
env:
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
GOOSE_PROVIDER: anthropic
|
|
GOOSE_MODEL: claude-sonnet-4-5-20250929
|
|
HOME: /tmp/goose-home
|
|
GOOSE_DISABLE_KEYRING: 1
|
|
SKIP_BUILD: 1
|
|
run: |
|
|
bash scripts/test_compaction.sh
|
|
|
|
smoke-tests-code-exec:
|
|
name: Smoke Tests (Code Execution)
|
|
runs-on: ubuntu-latest
|
|
needs: build-binary
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
|
|
with:
|
|
ref: ${{ github.event.inputs.branch || github.ref }}
|
|
|
|
- name: Download Binary
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: goose-binary
|
|
path: target/release
|
|
|
|
- name: Make Binary Executable
|
|
run: chmod +x target/release/goose
|
|
|
|
- name: Run Provider Tests (Code Execution Mode)
|
|
env:
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
|
|
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
|
|
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
|
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
|
|
TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
|
|
HOME: /tmp/goose-home
|
|
GOOSE_DISABLE_KEYRING: 1
|
|
SKIP_BUILD: 1
|
|
run: |
|
|
mkdir -p $HOME/.local/share/goose/sessions
|
|
mkdir -p $HOME/.config/goose
|
|
bash scripts/test_providers.sh --code-exec
|