Skip to content

Replace Trivy with OSV-Scanner and switch docs from pipx to uv #15

Replace Trivy with OSV-Scanner and switch docs from pipx to uv

Replace Trivy with OSV-Scanner and switch docs from pipx to uv #15

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
permissions:
contents: read
security-events: write
actions: read
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run ruff linting
run: |
ruff check
- name: Run ruff formatting check
run: |
ruff format --check
- name: Run mypy type checking
run: |
mypy src/
- name: Run tests with coverage
run: |
pytest --cov --cov-report=xml --cov-report=term-missing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
pip install safety detect-secrets bandit
- name: Run bandit security linter
run: |
bandit -r src/ -c pyproject.toml
- name: Run safety check
run: |
safety check || true
- name: Run secret detection
run: |
detect-secrets scan --baseline .secrets.baseline
osv-scan:
name: OSV-Scanner Vulnerability Scan
uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.3.8
permissions:
actions: read
contents: read
security-events: write
build:
name: Build Package
runs-on: ubuntu-latest
needs: [test, security, osv-scan]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/