feat: containerized api example (#63) #27
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: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -e {0} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - name: Build and test ak-py | |
| working-directory: ak-py | |
| run: | | |
| set -e | |
| ./build.sh | |
| uv run pytest -s | |
| cli-e2e-test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -e {0} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - name: Build ak-py | |
| working-directory: ak-py | |
| run: | | |
| set -e | |
| ./build.sh | |
| - name: Run CLI examples | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| run: | | |
| set -e | |
| for example in examples/cli/* examples/cli/a2a/*; do | |
| if [ -d "$example" ] && [ -f "$example/build.sh" ]; then | |
| echo "=== Running build for $example ===" | |
| (cd "$example" && ./build.sh local) | |
| echo "=== Running tests for $example ===" | |
| (cd "$example" && uv run pytest -s) | |
| fi | |
| done | |
| api-e2e-test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -e {0} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - name: Build ak-py | |
| working-directory: ak-py | |
| run: | | |
| set -e | |
| ./build.sh | |
| - name: Run CLI examples | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| run: | | |
| set -e | |
| for example in examples/api/* examples/api/a2a/*; do | |
| if [ -d "$example" ] && [ -f "$example/build.sh" ]; then | |
| echo "=== Running build for $example ===" | |
| (cd "$example" && ./build.sh local) | |
| echo "=== Running tests for $example ===" | |
| (cd "$example" && uv run pytest -s) | |
| fi | |
| done | |
| containerized-e2e-test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -e {0} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - name: Build ak-py | |
| working-directory: ak-py | |
| run: | | |
| set -e | |
| ./build.sh | |
| - name: Run Containerized Examples | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| run: | | |
| set -e | |
| for example in examples/containerized/* examples/containerized/a2a/*; do | |
| if [ -d "$example" ] && [ -f "$example/build.sh" ]; then | |
| echo "=== Running build for $example ===" | |
| (cd "$example" && ./build.sh local) | |
| echo "=== Running tests for $example ===" | |
| (cd "$example" && uv run pytest -s) | |
| fi | |
| done |