Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 2
updates:
# Monitor Python dependencies in pyproject.toml
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "python"
commit-message:
prefix: "deps"
include: "scope"
reviewers:
- "HenriquesLab/taskrepo-maintainers"
groups:
# Group minor and patch updates together
python-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"

# Monitor GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
include: "scope"
reviewers:
- "HenriquesLab/taskrepo-maintainers"
274 changes: 274 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
name: CI

on:
push:
branches: [main]
paths:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
- 'uv.lock'
- '.github/workflows/ci.yml'

pull_request:
branches: [main]
paths:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
- 'uv.lock'
- '.github/workflows/ci.yml'

workflow_dispatch:
inputs:
python_version:
description: 'Python version to test'
required: false
default: 'all'
type: choice
options:
- 'all'
- '3.10'
- '3.11'
- '3.12'

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 1
UV_SYSTEM_PYTHON: 1

jobs:
# Job 1: Lint and type checking
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: 'latest'
enable-cache: true

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: lint-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
restore-keys: |
lint-${{ runner.os }}-

- name: Install dependencies
run: |
uv sync --frozen --extra dev

- name: Run ruff format check
run: |
echo "🎨 Checking code formatting..."
uv run ruff format --check .
echo "βœ… Format check passed"

- name: Run ruff linting
run: |
echo "πŸ” Running linting checks..."
uv run ruff check .
echo "βœ… Linting passed"

- name: Run mypy type checking
continue-on-error: true
run: |
echo "πŸ”Ž Running type checking (informational only)..."
uv run mypy src/taskrepo || echo "⚠️ Type checking found issues (non-blocking)"

# Job 2: Test matrix across Python versions
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
python-version: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.python_version != 'all') && fromJson(format('["{0}"]', github.event.inputs.python_version)) || fromJson('["3.10", "3.11", "3.12"]') }}

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: 'latest'
enable-cache: true

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: test-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
restore-keys: |
test-${{ runner.os }}-${{ matrix.python-version }}-

- name: Install dependencies
run: |
uv sync --frozen --extra dev

- name: Run unit tests
run: |
echo "πŸ§ͺ Running unit tests..."
uv run pytest tests/unit -v
echo "βœ… Unit tests passed"

- name: Run integration tests
run: |
echo "πŸ§ͺ Running integration tests..."
# Allow empty test collection (exit code 5)
uv run pytest tests/integration -v || [ $? -eq 5 ] && echo "βœ… Integration tests passed (or no tests found)"

# Job 3: Coverage reporting
coverage:
name: Coverage Report
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 15

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: 'latest'
enable-cache: true

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: coverage-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
restore-keys: |
coverage-${{ runner.os }}-

- name: Install dependencies
run: |
uv sync --frozen --extra dev

- name: Run tests with coverage
run: |
echo "πŸ“Š Running full test suite with coverage..."
uv run pytest tests/ -v --cov=taskrepo --cov-report=term-missing --cov-report=xml
echo "βœ… Coverage report generated"

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
retention-days: 30

# Job 4: Build verification
build:
name: Build Package
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: 'latest'
enable-cache: true

- name: Install dependencies
run: |
uv sync --frozen --extra dev

- name: Build package
run: |
echo "πŸ“¦ Building package..."
uv build
echo "βœ… Package built successfully"

- name: Verify package metadata
run: |
echo "πŸ” Verifying package contents..."
ls -lh dist/
uv run python -m tarfile -l dist/*.tar.gz
echo "βœ… Package verification complete"

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-packages
path: dist/
retention-days: 7

# Summary job
ci-summary:
name: CI Summary
runs-on: ubuntu-latest
needs: [lint, test, coverage, build]
if: always()

steps:
- name: Generate summary
run: |
echo "## πŸš€ CI Pipeline Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Lint & Type Check | ${{ needs.lint.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Tests | ${{ needs.test.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Coverage | ${{ needs.coverage.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Build | ${{ needs.build.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

ALL_PASSED=${{ needs.lint.result == 'success' && needs.test.result == 'success' && needs.coverage.result == 'success' && needs.build.result == 'success' }}

if [[ "$ALL_PASSED" == "true" ]]; then
echo "πŸŽ‰ **All CI checks passed!**" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ **Some CI checks failed - please review the logs above**" >> $GITHUB_STEP_SUMMARY
fi
16 changes: 13 additions & 3 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ on:
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"
workflow_dispatch: # Enable manual triggering for testing
inputs:
pr_number:
description: 'PR number to review'
required: true
type: number

jobs:
claude-review:
Expand All @@ -19,6 +25,11 @@ jobs:
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

runs-on: ubuntu-latest

# Prevent multiple simultaneous reviews on the same PR
concurrency:
group: claude-review-${{ github.event.pull_request.number || inputs.pr_number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
Expand All @@ -29,7 +40,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0 # Full git history for better PR review context

- name: Run Claude Code Review
id: claude-review
Expand All @@ -38,7 +49,7 @@ jobs:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
PR NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}

Please review this pull request and provide feedback on:
- Code quality and best practices
Expand All @@ -54,4 +65,3 @@ jobs:
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'

Loading
Loading