Bootstrap #17
Workflow file for this run
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: Test | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - "README.md" | |
| - "**/*.md" | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "README.md" | |
| - "**/*.md" | |
| permissions: | |
| contents: read | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install openapi-python-client | |
| run: uv tool install openapi-python-client==0.28.3 | |
| - name: Regenerate SDK from committed openapi.json | |
| run: | | |
| uv run --no-project python scripts/prepare_openapi.py \ | |
| openapi.json /tmp/openapi.filtered.json | |
| rm -rf src/agent_platform/ | |
| openapi-python-client generate \ | |
| --path /tmp/openapi.filtered.json \ | |
| --config config.yaml \ | |
| --custom-template-path templates/ \ | |
| --meta uv \ | |
| --output-path src/ \ | |
| --overwrite | |
| cp templates/__init__.py.static src/agent_platform/__init__.py | |
| rm /tmp/openapi.filtered.json | |
| - name: Install SDK + dev deps | |
| run: | | |
| python3 -m venv /tmp/sdk-venv | |
| /tmp/sdk-venv/bin/pip install --quiet -e . "pytest>=8,<9" "python-dotenv>=1,<2" | |
| - name: Smoke import | |
| run: /tmp/sdk-venv/bin/python -c "from agent_platform import Client, AsyncClient; Client(api_key='hk-smoke', base_url='http://x'); print('SDK install + import OK')" | |
| - name: Unit tests | |
| run: /tmp/sdk-venv/bin/pytest tests/ -m "not integration" -v | |
| - name: Collect integration tests | |
| run: /tmp/sdk-venv/bin/pytest tests/integration --collect-only -m integration -q | |
| integration-live: | |
| if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| needs: unit | |
| env: | |
| HAI_API_KEY_TEST: ${{ secrets.HAI_API_KEY_TEST }} | |
| HAI_API_BASE_URL_TEST: "https://agp.hcompany.ai" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install openapi-python-client | |
| run: uv tool install openapi-python-client==0.28.3 | |
| - name: Regenerate SDK from committed openapi.json | |
| run: | | |
| uv run --no-project python scripts/prepare_openapi.py \ | |
| openapi.json /tmp/openapi.filtered.json | |
| rm -rf src/agent_platform/ | |
| openapi-python-client generate \ | |
| --path /tmp/openapi.filtered.json \ | |
| --config config.yaml \ | |
| --custom-template-path templates/ \ | |
| --meta uv \ | |
| --output-path src/ \ | |
| --overwrite | |
| cp templates/__init__.py.static src/agent_platform/__init__.py | |
| rm /tmp/openapi.filtered.json | |
| - name: Install SDK | |
| run: | | |
| python3 -m venv /tmp/sdk-venv | |
| /tmp/sdk-venv/bin/pip install --quiet --index-url https://pypi.org/simple \ | |
| -e . "pytest>=8,<9" "python-dotenv>=1,<2" | |
| - name: Run fast integration tier | |
| if: env.HAI_API_KEY_TEST != '' | |
| run: /tmp/sdk-venv/bin/pytest tests/integration -m "integration and not slow" -v --tb=short |