Skip to content

feat: add system resource monitoring with TUI and install integration #2181

feat: add system resource monitoring with TUI and install integration

feat: add system resource monitoring with TUI and install integration #2181

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
pull-requests: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install -U pip
pip install -e ".[dev]"
- name: Lint with ruff
run: ruff check . --output-format=github
- name: Check formatting with black
run: black --check . --exclude "(venv|\.venv|build|dist)"
- name: Type check with mypy
run: mypy cortex --ignore-missing-imports --no-error-summary || true
continue-on-error: true
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -U pip
pip install -e ".[dev]"
- name: Run tests with coverage
env:
ANTHROPIC_API_KEY: "test-key-for-ci"
OPENAI_API_KEY: "test-key-for-ci"
run: |
pytest tests/ -v --tb=short \
--cov=cortex \
--cov-report=xml \
--cov-report=term-missing \
--cov-fail-under=0 \
--timeout=60 \
--ignore=tests/integration
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.python-version }}
fail_ci_if_error: false
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install -U pip
pip install -e ".[security]"
- name: Run bandit security scan
run: bandit -r cortex -ll -ii --format json --output bandit-report.json || true
- name: Check for known vulnerabilities
run: safety check --json --output safety-report.json || true
continue-on-error: true
- name: Upload security reports
uses: actions/upload-artifact@v4
if: always()
with:
name: security-reports
path: |
bandit-report.json
safety-report.json
build:
name: Build Package
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install -U pip
pip install -e ".[dev]" twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/