feat(pip): add PolicyClient for RFC-005 PDP integration (Option B) (#10) #25
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: Integration Tests | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - 'capiscio_mcp/**' | |
| - 'tests/**' | |
| - '.github/workflows/integration-tests.yml' | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - 'capiscio_mcp/**' | |
| - 'tests/**' | |
| - '.github/workflows/integration-tests.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| integration-tests: | |
| name: Integration Tests with capiscio-core | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout MCP repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: capiscio-mcp-python | |
| - name: Checkout capiscio-core | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: capiscio/capiscio-core | |
| path: capiscio-core | |
| token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Build capiscio binary | |
| working-directory: capiscio-core | |
| run: | | |
| go build -o bin/capiscio ./cmd/capiscio | |
| chmod +x bin/capiscio | |
| echo "Built capiscio binary:" | |
| ls -la bin/capiscio | |
| ./bin/capiscio --version | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Install SDK dependencies | |
| working-directory: capiscio-mcp-python | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev,mcp]" | |
| - name: Export capiscio binary path | |
| run: | | |
| echo "CAPISCIO_BINARY_PATH=${{ github.workspace }}/capiscio-core/bin/capiscio" >> $GITHUB_ENV | |
| echo "CAPISCIO_CORE_ADDR=" >> $GITHUB_ENV | |
| - name: Run unit tests with coverage | |
| working-directory: capiscio-mcp-python | |
| run: | | |
| pytest tests/ -v --tb=short --cov=capiscio_mcp --cov-report=xml --cov-report=term | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: capiscio-mcp-python/coverage.xml | |
| flags: integrationtests | |
| name: codecov-integration | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| summary: | |
| name: Integration Tests Summary | |
| needs: [integration-tests] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check results | |
| run: | | |
| if [ "${{ needs.integration-tests.result }}" != "success" ]; then | |
| echo "❌ Integration tests failed" | |
| exit 1 | |
| fi | |
| echo "✅ Integration tests passed!" | |
| - name: Add PR comment | |
| if: github.event_name == 'pull_request' && needs.integration-tests.result == 'success' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '✅ Integration tests passed! capiscio-core gRPC tests working.' | |
| }) |