From 03f88bc6f288c63c3a6d79ecb9ab912329313b2b Mon Sep 17 00:00:00 2001 From: vreddy <304414667+vreddy-commits@users.noreply.github.com> Date: Tue, 14 Jul 2026 20:43:13 +0530 Subject: [PATCH 1/6] Add CI workflow for Python project This CI workflow runs on pushes to the main branch and pull requests. It sets up Python 3.12, installs dependencies, performs linting, formatting checks, type checks, runs tests, and uploads a coverage report. --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2734e38 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + ci: + runs-on: ubuntu-latest + timeout-minutes: 3 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + + - name: Install package with dev dependencies + run: pip install -e ".[dev]" + + - name: Lint + run: ruff check src/ sim/ + + - name: Format check + run: ruff format --check src/ sim/ + + - name: Type check + run: pyright src/ + + - name: Test + run: pytest -v --tb=short --cov=src/cyberhosp --cov-report=xml --cov-report=term tests/ + + - name: Upload coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage.xml + if-no-files-found: error From a77e417343a065971e804bd38d821fda5d30a990 Mon Sep 17 00:00:00 2001 From: vreddy <304414667+vreddy-commits@users.noreply.github.com> Date: Tue, 14 Jul 2026 20:44:16 +0530 Subject: [PATCH 2/6] Create .gitkeep --- sim/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 sim/.gitkeep diff --git a/sim/.gitkeep b/sim/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/sim/.gitkeep @@ -0,0 +1 @@ + From 833990404ee9e13cebf343679472b97fe96985cf Mon Sep 17 00:00:00 2001 From: vreddy <304414667+vreddy-commits@users.noreply.github.com> Date: Tue, 14 Jul 2026 20:45:17 +0530 Subject: [PATCH 3/6] Add Pyright and update dev dependencies Added Pyright configuration for type checking. --- pyproject.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index cae73c3..58a2b9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ dev = [ "ruff>=0.5.0", "pytest>=8.0", "pytest-cov>=5.0", + "pyright>=1.1.0", ] [tool.ruff] @@ -36,3 +37,15 @@ target-version = "py312" [tool.ruff.lint] select = ["E", "F", "I", "N", "W", "UP"] + +[tool.pyright] +pythonVersion = "3.12" +typeCheckingMode = "basic" +reportUnknownParameterType = false +reportMissingTypeStubs = false + +[tool.pytest.ini_options] +testpaths = ["tests"] + +[tool.coverage.run] +source = ["cyberhosp"] From 90f1c1ef1cda8bb6792dd989c95e5ac8866ea896 Mon Sep 17 00:00:00 2001 From: vreddy <304414667+vreddy-commits@users.noreply.github.com> Date: Tue, 14 Jul 2026 20:45:46 +0530 Subject: [PATCH 4/6] Implement integration test for FHIRAdapter inheritance Added a test to verify FHIRAdapter inherits from EHRAdapter. --- tests/test_integration.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index d8d294d..8c46282 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,5 +1,15 @@ """Integration layer tests.""" +from cyberhosp.integration.base import EHRAdapter, EHRConfig +from cyberhosp.integration.fhir import FHIRAdapter + class TestEHRAdapter: - pass + def test_fhir_adapter_inherits_ehradapter(self) -> None: + config = EHRConfig( + vendor="test", + base_url="https://example.com/fhir", + auth_method="oauth2", + api_version="R4", + ) + assert isinstance(FHIRAdapter(config), EHRAdapter) From 636afa0d08b083a396c6ec51f235e7b5e934590d Mon Sep 17 00:00:00 2001 From: vreddy <304414667+vreddy-commits@users.noreply.github.com> Date: Tue, 14 Jul 2026 20:46:06 +0530 Subject: [PATCH 5/6] Update test_monitor.py --- tests/test_monitor.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_monitor.py b/tests/test_monitor.py index cef7c60..df4725a 100644 --- a/tests/test_monitor.py +++ b/tests/test_monitor.py @@ -1,5 +1,14 @@ """Audit and monitoring tests.""" +from cyberhosp.monitor.analyzer import BehaviorAnalyzer +from cyberhosp.monitor.audit import AuditPipeline + class TestAuditPipeline: - pass + def test_audit_pipeline_instantiable(self) -> None: + assert type(AuditPipeline()) is AuditPipeline + + +class TestBehaviorAnalyzer: + def test_behavior_analyzer_instantiable(self) -> None: + assert type(BehaviorAnalyzer()) is BehaviorAnalyzer From 92445d38ab4d4beb7887086ae31f3c665cc36da3 Mon Sep 17 00:00:00 2001 From: vreddy <304414667+vreddy-commits@users.noreply.github.com> Date: Tue, 14 Jul 2026 20:46:36 +0530 Subject: [PATCH 6/6] Add CI and badge links to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7b8143d..3fe18cf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # CyberHosp +[![CI](https://github.com/dhedhialy/cyberhosp/actions/workflows/ci.yml/badge.svg)](https://github.com/dhedhialy/cyberhosp/actions/workflows/ci.yml) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](LICENSE) [![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue)](pyproject.toml) [![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)