Test and generate report #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and generate report | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
workflow_dispatch: | |
# Add permissions configuration | |
permissions: | |
contents: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: openagent | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11.5' | |
- name: Install poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry config virtualenvs.create false | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y postgresql-client libpq-dev | |
poetry install | |
poetry add pytest pytest-xdist | |
- name: Run tests | |
continue-on-error: true | |
env: | |
# Database settings | |
DB_CONNECTION: postgresql+psycopg://postgres:password@localhost:5432/openagent | |
# LLM provider settings | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
GOOGLE_GEMINI_API_KEY: ${{ secrets.GOOGLE_GEMINI_API_KEY }} | |
OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }} | |
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
# Optional API keys | |
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }} | |
MORALIS_API_KEY: ${{ secrets.MORALIS_API_KEY }} | |
ROOTDATA_API_KEY: ${{ secrets.ROOTDATA_API_KEY }} | |
COINGECKO_API_KEY: ${{ secrets.COINGECKO_API_KEY }} | |
# RSS3 API URLs | |
RSS3_DATA_API: https://gi.rss3.io | |
RSS3_SEARCH_API: https://devnet.rss3.io/search | |
run: | | |
pwd | |
ls -la | |
cd tests | |
poetry run python run_test.py | |
- name: Commit and push report | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# Switch to docs branch | |
git fetch origin docs || git fetch origin main | |
git checkout docs || git checkout -b docs | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
# Check if file exists | |
ls -la tests/compatible-models.mdx || echo "Report file not found!" | |
# Add all changes (including new files) | |
git add -A | |
# Show pending changes | |
git status | |
# Create commit with timestamp | |
git commit -m "docs: update compatibility test report" || echo "No changes to commit" | |
# Push changes to docs branch | |
git push origin docs | |