Skip to content

Commit 5199821

Browse files
feat: update github workflows
1 parent eeccd81 commit 5199821

6 files changed

Lines changed: 12 additions & 64 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Run flake8
2929
run: |
3030
flake8 src/ main.py --count --select=E9,F63,F7,F82 --show-source --statistics
31-
flake8 src/ main.py --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
flake8 src/ main.py --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
3232
3333
- name: Check code formatting with black
3434
run: |
@@ -59,24 +59,11 @@ jobs:
5959
run: |
6060
python -m pip install --upgrade pip
6161
pip install -r requirements.txt
62-
pip install -r requirements-test.txt
62+
pip install pytest pytest-cov
6363
64-
- name: Run unit tests
64+
- name: Run tests
6565
run: |
66-
pytest tests/unit/ -v --cov=src --cov-report=xml --cov-report=term
67-
68-
- name: Run integration tests
69-
run: |
70-
pytest tests/integration/ -v || true
71-
continue-on-error: true
72-
73-
- name: Upload coverage to Codecov
74-
uses: codecov/codecov-action@v3
75-
with:
76-
file: ./coverage.xml
77-
flags: unittests
78-
name: codecov-umbrella
79-
fail_ci_if_error: false
66+
pytest tests/ -v
8067
8168
docker-build:
8269
name: Build Docker Image
@@ -94,6 +81,7 @@ jobs:
9481
context: .
9582
push: false
9683
tags: gitlab-issues-analyzer:test
84+
load: true
9785
cache-from: type=registry,ref=gitlab-issues-analyzer:latest
9886
cache-to: type=inline
9987

‎.github/workflows/docker-publish.yml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ jobs:
4141
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4242
tags: |
4343
type=ref,event=branch
44-
type=ref,event=pr
4544
type=semver,pattern={{version}}
46-
type=semver,pattern={{major}}.{{minor}}
47-
type=sha,prefix={{branch}}-
4845
type=raw,value=latest,enable={{is_default_branch}}
4946
5047
- name: Build and push Docker image

‎.github/workflows/release.yml‎

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎main.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
from src.analyzer import IssueAnalyzer
2020
from src.config import load_config, validate_config
2121
from src.email_sender import EmailSender
22-
from src.exceptions import AnalysisError, ConfigurationError, EmailError, GitLabAPIError
22+
from src.exceptions import (AnalysisError, ConfigurationError, EmailError,
23+
GitLabAPIError)
2324
from src.gitlab_client import GitLabClient
2425
from src.monitor import IssueMonitor
2526
from src.reporter import generate_email_report

‎tests/e2e/test_full_workflow.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def test_complete_workflow_webhook_to_analysis_to_email(
2323
"""TC-E2E-001: Complete workflow: webhook → analysis → email."""
2424
from src.analyzer import IssueAnalyzer # type: ignore
2525
from src.email_sender import EmailSender # type: ignore
26+
from src.gitlab_client import GitLabClient # type: ignore
2627
from src.monitor import IssueMonitor # type: ignore
2728
from src.reporter import generate_email_report # type: ignore
28-
from src.gitlab_client import GitLabClient # type: ignore
2929

3030
# Step 1: Process webhook
3131
gitlab_client = GitLabClient("https://gitlab.com", "test-token", "123456")
@@ -91,9 +91,9 @@ def test_complete_workflow_polling_to_analysis_to_email(
9191
"""TC-E2E-002: Complete workflow: polling → analysis → email."""
9292
from src.analyzer import IssueAnalyzer # type: ignore
9393
from src.email_sender import EmailSender # type: ignore
94+
from src.gitlab_client import GitLabClient # type: ignore
9495
from src.monitor import IssueMonitor # type: ignore
9596
from src.reporter import generate_email_report # type: ignore
96-
from src.gitlab_client import GitLabClient # type: ignore
9797

9898
# Step 1: Poll for new issues
9999
gitlab_client = GitLabClient("https://gitlab.com", "test-token", "123456")
@@ -167,8 +167,8 @@ def test_complete_workflow_polling_to_analysis_to_email(
167167
def test_handle_error_in_workflow_gracefully(self, sample_webhook_payload):
168168
"""TC-E2E-003: Handle error in workflow gracefully."""
169169
from src.analyzer import AnalysisError, IssueAnalyzer # type: ignore
170-
from src.monitor import IssueMonitor # type: ignore
171170
from src.gitlab_client import GitLabClient # type: ignore
171+
from src.monitor import IssueMonitor # type: ignore
172172

173173
# Process webhook successfully
174174
gitlab_client = GitLabClient("https://gitlab.com", "test-token", "123456")

‎tests/unit/test_reporter.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
import pytest
1414

15-
from src.reporter import format_html_email, format_text_email, generate_email_report
15+
from src.reporter import (format_html_email, format_text_email,
16+
generate_email_report)
1617

1718

1819
class TestReporter:

0 commit comments

Comments
 (0)