Skip to content

fix(security): production hardening — credential storage, connection … #160

fix(security): production hardening — credential storage, connection …

fix(security): production hardening — credential storage, connection … #160

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
security-events: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
cache: 'pip'
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Lint with ruff
run: ruff check src/ tests/
- name: Format check
run: ruff format --check src/ tests/
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
cache: 'pip'
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Type check with mypy
run: mypy src/ai_bom/ --ignore-missing-imports
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run tests with coverage
run: pytest -v --cov=ai_bom --cov-report=term-missing --cov-report=xml
- name: Check coverage threshold
if: matrix.python-version == '3.12'
run: |
coverage report --fail-under=80
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
files: coverage.xml
flags: ai-bom
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
cache: 'pip'
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run pip-audit
run: pip-audit --strict --desc --local
- name: Run AI-BOM self-scan (SARIF)
run: |
ai-bom scan . --format sarif -o ai-bom-results.sarif --quiet || true
- name: Upload SARIF results
if: github.event_name == 'push'
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
sarif_file: ai-bom-results.sarif
continue-on-error: true