chore(deps-dev): update fastapi requirement (#3060) #3743
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: Policy Validation | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| policies: ${{ steps.filter.outputs.policies }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| with: | |
| filters: | | |
| policies: | |
| - '**/*.yaml' | |
| - '**/*.yml' | |
| - 'agent-governance-python/agent-os/src/agent_os/policies/**' | |
| validate-policies: | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.policies == 'true' | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.11" | |
| - name: Install consolidated v4 packages (local, --no-deps) | |
| # The deprecated shim packages (agent-primitives, agent-os, ...) all | |
| # declare a hard dep on agent-governance-toolkit-core>=4.0, which is | |
| # not yet on PyPI. Pre-install the local consolidated packages with | |
| # --no-deps so the subsequent shim installs resolve without pip | |
| # reaching out to PyPI for the unpublished names. | |
| run: | | |
| pip install --no-cache-dir --no-deps \ | |
| -e agent-governance-python/agent-governance-toolkit-core \ | |
| -e agent-governance-python/agent-governance-toolkit-cli \ | |
| -e agent-governance-python/agent-governance-toolkit-integrations \ | |
| -e agent-governance-python/agent-governance-toolkit-protocols | |
| - name: Install agent-primitives (local sibling) | |
| run: pip install --no-cache-dir -e agent-governance-python/agent-primitives | |
| - name: Install agent-os-kernel | |
| working-directory: agent-governance-python/agent-os | |
| run: | | |
| pip install --no-cache-dir -e ".[dev]" | |
| pip install --no-cache-dir --require-hashes -r "$GITHUB_WORKSPACE/agent-governance-python/requirements/ci-yaml.txt" | |
| - name: Find and validate policy files | |
| run: | | |
| EXIT_CODE=0 | |
| echo "::group::Validating policy files" | |
| for f in $(find . -name '*.yaml' -o -name '*.yml' \ | |
| | grep -i policy \ | |
| | grep -v 'charts/.*/templates/' \ | |
| | grep -v 'node_modules/' \ | |
| | sort); do | |
| echo "--- Validating: $f ---" | |
| python -m agent_os.policies.cli validate "$f" || EXIT_CODE=1 | |
| done | |
| echo "::endgroup::" | |
| exit "$EXIT_CODE" | |
| test-policies: | |
| runs-on: ubuntu-latest | |
| needs: [changes, validate-policies] | |
| if: always() && needs.validate-policies.result != 'failure' | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| if: needs.changes.outputs.policies == 'true' | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| if: needs.changes.outputs.policies == 'true' | |
| with: | |
| python-version: "3.11" | |
| - name: Install consolidated v4 packages (local, --no-deps) | |
| if: needs.changes.outputs.policies == 'true' | |
| # The deprecated shim packages (agent-primitives, agent-os, ...) all | |
| # declare a hard dep on agent-governance-toolkit-core>=4.0, which is | |
| # not yet on PyPI. Pre-install the local consolidated packages with | |
| # --no-deps so the subsequent shim installs resolve without pip | |
| # reaching out to PyPI for the unpublished names. | |
| run: | | |
| pip install --no-cache-dir --no-deps \ | |
| -e agent-governance-python/agent-governance-toolkit-core \ | |
| -e agent-governance-python/agent-governance-toolkit-cli \ | |
| -e agent-governance-python/agent-governance-toolkit-integrations \ | |
| -e agent-governance-python/agent-governance-toolkit-protocols | |
| - name: Install agent-primitives (local sibling) | |
| if: needs.changes.outputs.policies == 'true' | |
| run: pip install --no-cache-dir -e agent-governance-python/agent-primitives | |
| - name: Install agent-os-kernel | |
| if: needs.changes.outputs.policies == 'true' | |
| working-directory: agent-governance-python/agent-os | |
| run: | | |
| pip install --no-cache-dir -e ".[dev]" | |
| pip install --no-cache-dir --require-hashes -r "$GITHUB_WORKSPACE/agent-governance-python/requirements/ci-policy-test.txt" | |
| - name: Run policy CLI tests | |
| if: needs.changes.outputs.policies == 'true' | |
| working-directory: agent-governance-python/agent-os | |
| run: pytest tests/test_policy_cli.py -v --tb=short | |
| - name: Skip (no policy changes) | |
| if: needs.changes.outputs.policies != 'true' | |
| run: echo "No policy file changes detected, skipping." |