Skip to content
Closed

dev #72

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: dev checks

on:
pull_request:
branches: [ dev ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv sync

- name: Run tests with pytest
run: |
make check-with-coverage

- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: false
65 changes: 0 additions & 65 deletions .github/workflows/fuzz.yml

This file was deleted.

16 changes: 5 additions & 11 deletions .github/workflows/test.yml → .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Tests
name: pre-release checks

on:
push:
branches: [ main, 'claude/*' ]
pull_request:
branches: [ main ]

Expand All @@ -25,19 +23,15 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install uv
uv sync

- name: Run tests with pytest
run: |
pytest -v --tb=short

- name: Run tests with coverage
if: matrix.python-version == '3.11'
run: |
pytest --cov=bb --cov-report=term --cov-report=xml
make check-with-coverage

- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
tmp/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
Expand Down
53 changes: 50 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help check check-with-coverage check-fuzz clean
.PHONY: help check check-with-coverage check-fuzz check-review clean wip

# Default target - show help
help: ## Show this help message with all available targets
Expand All @@ -13,7 +13,7 @@ check: ## Run pytest tests
@echo "Running Tests with pytest"
@echo "========================================"
@echo ""
@pytest -v tests/
@uv run pytest -v tests/

check-with-coverage: ## Run pytest with coverage reporting (generates htmlcov/)
@echo "========================================"
Expand All @@ -24,7 +24,7 @@ check-with-coverage: ## Run pytest with coverage reporting (generates htmlcov/)
@pip3 install coverage pytest-cov --quiet 2>/dev/null || true
@echo ""
@echo "Running pytest with coverage..."
@pytest --cov=bb --cov=aston --cov-report=term --cov-report=html tests/
@uv run pytest --cov=bb --cov=bonafide --cov-report=term --cov-report=xml --cov-report=html tests/
@echo ""
@echo "✓ HTML coverage report generated in htmlcov/index.html"

Expand All @@ -50,6 +50,13 @@ check-fuzz: ## Run comprehensive fuzz tests (corpus, mutation, generative)
@echo ""
@echo "✓ All fuzz tests passed!"

check-review: ## Check GitHub PR review comments (requires gh CLI and authenticated GitHub)
@echo "======================================="
@echo "Checking GitHub PR Review Comments"
@echo "======================================="
@echo ""
@./bin/github-review-threads.py

clean: ## Clean up generated files (htmlcov/, .coverage, __pycache__)
@echo "Cleaning up generated files..."
@rm -rf htmlcov/
Expand All @@ -58,3 +65,43 @@ clean: ## Clean up generated files (htmlcov/, .coverage, __pycache__)
@find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
@find . -type f -name "*.pyc" -delete 2>/dev/null || true
@echo "✓ Cleanup complete"

cosmit: ## Format code with ruff, lint with --fix, and commit if changes
@echo "======================================="
@echo "Running cosmit: format, lint, and commit"
@echo "======================================="
@echo ""
@echo "[1/3] Running ruff format..."
@uv run ruff format --config pyproject.toml
@echo ""
@echo "[2/3] Running ruff check with --fix on main source files..."
@uv run ruff check --fix --config pyproject.toml
@echo ""
@echo "[3/3] Checking for changes and committing..."
@if git diff --quiet; then \
echo "No changes detected, skipping commit."; \
else \
echo "Changes detected, creating cosmit commit..."; \
git add .; \
git commit -m "cosmit"; \
echo "✓ cosmit commit created"; \
fi

wip: ## Work In Progress: format, lint, add all files (including untracked), commit with emoji, and push
@echo "======================================="
@echo "Running WIP: format, lint, commit, and push"
@echo "======================================="
@echo ""
@echo "[1/4] Running ruff format on all files..."
@uv run ruff format --config pyproject.toml || true
@echo ""
@echo "[2/4] Running ruff check with --fix on all files..."
@uv run ruff check --fix --config pyproject.toml || true
@echo ""
@echo "[3/4] Adding all files (including untracked) and creating WIP commit..."
@git add -A
@git commit -m "🚧 WIP: Work in progress" --no-verify
@echo ""
@echo "[4/4] Pushing with --force and --no-verify..."
@git push --force --no-verify
@echo "✓ WIP commit created and pushed with emoji 🚧"
Loading