Merge branch 'preview-url' into release-candidate #248
This file contains hidden or 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: CI | |
| permissions: | |
| contents: read | |
| on: [push, pull_request, workflow_call] | |
| jobs: | |
| ruff: | |
| name: Ruff | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Sync dev dependencies | |
| run: uv sync --group dev | |
| - name: Run Ruff | |
| run: | | |
| uv run ruff check . | |
| uv run ruff format --check . | |
| dev-tests: | |
| name: Full test suite on dev stack (Python 3.13) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Create CI .env | |
| run: | | |
| cat > .env <<'EOF' | |
| CLIMATECLAW_INSTANCE_NAME=ci | |
| CLIMATECLAW_FILE_LOGGING=0 | |
| CLIMATECLAW_OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} | |
| CLIMATECLAW_MCP_REQUEST_TIMEOUT_SEC=20 | |
| CLIMATECLAW_CACHE_PATH=/ci-path/cache | |
| CLIMATECLAW_MONGODB_USER=ci-user | |
| CLIMATECLAW_MONGODB_PASSWORD=ci-psswrd | |
| CLIMATECLAW_MONGODB_DATABASE_NAME=ci-db | |
| EOF | |
| - name: Sync dependencies | |
| run: uv sync --group dev --group test --group type | |
| - name: Start dev stack | |
| run: | | |
| ./dev.sh up code-server web-search-server -d --wait --build --remove-orphans || { | |
| docker compose ps -a | |
| docker compose logs web-search-server | |
| docker compose logs code-server | |
| exit 1 | |
| } | |
| - name: Run mypy | |
| run: uv run --group type mypy | |
| - name: Run pytest | |
| run: uv run --group test pytest | |
| - name: Tear down dev stack | |
| if: always() | |
| run: ./dev.sh down -v | |
| prod-smoke: | |
| name: Production smoke test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Create CI .env | |
| run: | | |
| cat > .env <<'EOF' | |
| CLIMATECLAW_INSTANCE_NAME=ci | |
| CLIMATECLAW_FILE_LOGGING=0 | |
| CLIMATECLAW_CACHE_PATH=/ci-path/cache | |
| CLIMATECLAW_MONGODB_USER=ci-user | |
| CLIMATECLAW_MONGODB_PASSWORD=ci-psswrd | |
| CLIMATECLAW_MONGODB_DATABASE_NAME=ci-db | |
| CLIMATECLAW_OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} | |
| EOF | |
| - name: Build production base image | |
| run: docker compose --profile build-only build climateclaw-base | |
| - name: Start production stack | |
| run: | | |
| docker compose \ | |
| -f docker-compose.yml \ | |
| -f docker-compose.ci.yml \ | |
| up climateclaw code-server web-search-server \ | |
| -d --wait --build --remove-orphans || { | |
| docker ps -a | |
| docker compose \ | |
| -f docker-compose.yml \ | |
| -f docker-compose.ci.yml \ | |
| logs climateclaw mongodb code-server web-search-server litellm | |
| exit 1 | |
| } | |
| - name: Show running services | |
| run: docker compose ps | |
| - name: Smoke check public surface | |
| run: | | |
| curl -f http://localhost:8502/healthz | |
| - name: Tear down production stack | |
| if: always() | |
| run: docker compose down -v |