Merge pull request #5 from NetDevAutomate/fix/ci-typecheck-and-audit #124
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| python-version: "3.12" | |
| - run: uv sync --all-packages | |
| - run: uv run ruff check . | |
| - run: uv run ruff format --check . | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| python-version: "3.12" | |
| - run: uv sync --all-packages --all-extras | |
| - run: cd packages/agent-session-tools && uv run pyright src/ | |
| - run: cd packages/studyctl && uv run pyright src/ | |
| sast: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| python-version: "3.12" | |
| - run: uv sync --all-packages | |
| - name: Run bandit (SAST) | |
| run: uv run bandit --recursive --skip B101,B104,B105,B106,B107,B108,B110,B310,B404,B602,B603,B606,B607,B608 packages/ | |
| audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| python-version: "3.12" | |
| - run: uv sync --all-packages | |
| - name: Audit dependencies for known vulnerabilities | |
| run: uv audit | |
| release-consistency: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| python-version: "3.12" | |
| - run: python scripts/check-release-consistency.py | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: uv sync --all-packages --group dev | |
| - run: uv run pytest --tb=short -m "not integration and not e2e and not live_provider" --cov=packages --cov-report=term-missing | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| python-version: "3.12" | |
| - run: ./scripts/build-release.sh | |
| install-smoke: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| python-version: "3.12" | |
| - run: ./scripts/build-release.sh | |
| - name: Install built wheel without optional extras | |
| run: | | |
| uv venv /tmp/studyctl-smoke | |
| uv pip install --python /tmp/studyctl-smoke/bin/python dist/studyctl-*.whl | |
| - name: Smoke-test installed CLI entry points | |
| run: | | |
| export PATH="/tmp/studyctl-smoke/bin:$PATH" | |
| ./scripts/smoke-installed-cli.sh |