Skip to content

Commit abf9b6b

Browse files
blackflame007claude
andcommitted
Add GitHub Actions CI/CD pipeline
- Create basic CI workflow for automated testing and code quality - Run tests on Python 3.12 and 3.13 - Automated linting with ruff (check + format) - Type checking with mypy - Test execution with pytest - Coverage reporting with codecov integration - Caching for faster builds - Fix core.py formatting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2ef4039 commit abf9b6b

File tree

2 files changed

+67
-3
lines changed

2 files changed

+67
-3
lines changed

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.12", "3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install Poetry
25+
uses: snok/install-poetry@v1
26+
with:
27+
version: latest
28+
virtualenvs-create: true
29+
virtualenvs-in-project: true
30+
31+
- name: Load cached venv
32+
id: cached-poetry-dependencies
33+
uses: actions/cache@v3
34+
with:
35+
path: .venv
36+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
37+
38+
- name: Install dependencies
39+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
40+
run: poetry install --no-interaction --no-root
41+
42+
- name: Install project
43+
run: poetry install --no-interaction
44+
45+
- name: Lint with ruff
46+
run: |
47+
poetry run ruff check src tests
48+
poetry run ruff format --check src tests
49+
50+
- name: Type check with mypy
51+
run: poetry run mypy src
52+
53+
- name: Test with pytest
54+
run: poetry run pytest tests/ -v --tb=short
55+
56+
- name: Test coverage
57+
run: poetry run pytest tests/ --cov=ghostrider --cov-report=xml
58+
59+
- name: Upload coverage to Codecov
60+
if: matrix.python-version == '3.12'
61+
uses: codecov/codecov-action@v3
62+
with:
63+
file: ./coverage.xml
64+
fail_ci_if_error: false

src/ghostrider/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def _monitor_platform(self, platform_name: str, platform: Any) -> None:
7070
messages = await platform.receive_messages()
7171

7272
if messages:
73-
print(f"📥 Received {len(messages)} new message(s) " f"from {platform_name}")
73+
print(f"📥 Received {len(messages)} new message(s) from {platform_name}")
7474

7575
# Create message batch
7676
batch = MessageBatch(
@@ -112,7 +112,7 @@ async def _process_message_batch(self, batch: MessageBatch) -> None:
112112
f"Tags: {', '.join(result.context_tags) if result.context_tags else 'none'}"
113113
)
114114
else:
115-
print(f"❌ Failed to process message " f"{result.message_id[:8]}...: {result.error}")
115+
print(f"❌ Failed to process message {result.message_id[:8]}...: {result.error}")
116116

117117
# TODO: Implement actions based on priority
118118
await self._handle_processed_messages(batch, results)
@@ -132,7 +132,7 @@ async def _handle_processed_messages(self, batch: MessageBatch, results: Any) ->
132132
print(f"🚨 HIGH PRIORITY MESSAGE from {message.platform.value}:")
133133
print(f" From: {message.author.name}")
134134
print(f" Content: {message.content[:100]}...")
135-
print(f" Priority: {message.priority.value} " f"(score: {message.urgency_score:.2f})")
135+
print(f" Priority: {message.priority.value} (score: {message.urgency_score:.2f})")
136136
if message.context_tags:
137137
print(f" Tags: {', '.join(message.context_tags)}")
138138
print()

0 commit comments

Comments
 (0)