67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: https://github.com/actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Cache pip packages
|
|
uses: https://github.com/actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -e ".[dev]"
|
|
|
|
- name: Run linting
|
|
run: |
|
|
ruff check src/
|
|
|
|
- name: Run type checking
|
|
run: |
|
|
mypy src/
|
|
|
|
- name: Run tests
|
|
run: |
|
|
pytest tests/ -v
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: https://github.com/actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -e .
|
|
|
|
- name: Verify import
|
|
run: |
|
|
python -c "import memory_manager; print(memory_manager.__version__)"
|
|
|
|
- name: Verify CLI
|
|
run: |
|
|
memory --version |