Merge Agentspan agent SDK into conductor-python #1119
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: Continuous Integration | |
| on: [pull_request, workflow_dispatch] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| env: | |
| COVERAGE_DIR: .coverage-reports | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest pytest-cov coverage | |
| - name: Verify agents import without extras installed | |
| id: agent_base_import | |
| continue-on-error: true | |
| run: | | |
| python -c "import conductor.ai.agents" | |
| - name: Install agents extra | |
| run: | | |
| pip install -e '.[agents]' | |
| pip install pytest-asyncio | |
| - name: Prepare coverage directory | |
| run: | | |
| mkdir -p ${{ env.COVERAGE_DIR }} | |
| - name: Run unit tests | |
| id: unit_tests | |
| continue-on-error: true | |
| env: | |
| CONDUCTOR_AUTH_KEY: ${{ secrets.CONDUCTOR_AUTH_KEY }} | |
| CONDUCTOR_AUTH_SECRET: ${{ secrets.CONDUCTOR_AUTH_SECRET }} | |
| CONDUCTOR_SERVER_URL: ${{ secrets.CONDUCTOR_SERVER_URL }} | |
| COVERAGE_FILE: ${{ env.COVERAGE_DIR }}/.coverage.unit | |
| run: | | |
| coverage run -m pytest tests/unit -v | |
| - name: Run backward compatibility tests | |
| id: bc_tests | |
| continue-on-error: true | |
| env: | |
| CONDUCTOR_AUTH_KEY: ${{ secrets.CONDUCTOR_AUTH_KEY }} | |
| CONDUCTOR_AUTH_SECRET: ${{ secrets.CONDUCTOR_AUTH_SECRET }} | |
| CONDUCTOR_SERVER_URL: ${{ secrets.CONDUCTOR_SERVER_URL }} | |
| COVERAGE_FILE: ${{ env.COVERAGE_DIR }}/.coverage.bc | |
| run: | | |
| coverage run -m pytest tests/backwardcompatibility -v | |
| - name: Run serdeser tests | |
| id: serdeser_tests | |
| continue-on-error: true | |
| env: | |
| CONDUCTOR_AUTH_KEY: ${{ secrets.CONDUCTOR_AUTH_KEY }} | |
| CONDUCTOR_AUTH_SECRET: ${{ secrets.CONDUCTOR_AUTH_SECRET }} | |
| CONDUCTOR_SERVER_URL: ${{ secrets.CONDUCTOR_SERVER_URL }} | |
| COVERAGE_FILE: ${{ env.COVERAGE_DIR }}/.coverage.serdeser | |
| run: | | |
| coverage run -m pytest tests/serdesertest -v | |
| - name: Generate coverage report | |
| id: coverage_report | |
| run: | | |
| coverage combine ${{ env.COVERAGE_DIR }}/.coverage.* | |
| coverage report | |
| coverage xml -o coverage.xml | |
| - name: Verify coverage file | |
| id: verify_coverage | |
| if: always() | |
| run: | | |
| if [ ! -s coverage.xml ]; then | |
| echo "coverage.xml is empty or does not exist" | |
| ls -la coverage.xml ${{ env.COVERAGE_DIR }} || true | |
| exit 1 | |
| fi | |
| echo "coverage.xml exists and is not empty" | |
| - name: Upload coverage to Codecov | |
| if: always() && steps.verify_coverage.outcome == 'success' | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: coverage.xml | |
| - name: Check test results | |
| if: steps.unit_tests.outcome == 'failure' || steps.bc_tests.outcome == 'failure' || steps.serdeser_tests.outcome == 'failure' || steps.agent_base_import.outcome == 'failure' | |
| run: exit 1 |