feat: add comprehensive AGENT guide for Python MCP Template #3
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: Unit Tests | |
| on: | |
| push: | |
| branches: [agent_md] | |
| pull_request: | |
| branches: [agent_md] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| COVERAGE_FAIL_UNDER: "80" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install project and test deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . pytest coverage bandit | |
| - name: Run tests with coverage | |
| run: | | |
| coverage run -m pytest -q --junitxml=pytest-report.xml | |
| - name: Coverage report (fail under ${{ env.COVERAGE_FAIL_UNDER }}%) | |
| run: | | |
| coverage report -m --fail-under=$COVERAGE_FAIL_UNDER | |
| coverage xml | |
| coverage html | |
| - name: Security scan (Bandit) | |
| run: | | |
| bash scripts/security_scan_bandit.sh | |
| - name: Upload artifacts (coverage and reports) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-and-coverage-reports | |
| path: | | |
| coverage.xml | |
| htmlcov | |
| pytest-report.xml | |
| bandit-report.txt | |
| bandit_exit_code.txt | |
| - name: Fail if Bandit found issues | |
| run: | | |
| bash scripts/security_fail_if_issues.sh |