From a0fe1a80e3e8bb8b629452cda5a0e5715cff878d Mon Sep 17 00:00:00 2001 From: "Aarthi Manivannan, Premanathan Aarthi Manivannan" Date: Thu, 6 Nov 2025 15:49:27 +0100 Subject: [PATCH 1/8] Add new directory --- app/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/.gitkeep diff --git a/app/.gitkeep b/app/.gitkeep new file mode 100644 index 0000000..e69de29 From 0dc2ebe99c5bd0be94eca501c636377ba813d6f8 Mon Sep 17 00:00:00 2001 From: "Aarthi Manivannan, Premanathan Aarthi Manivannan" Date: Thu, 6 Nov 2025 15:50:10 +0100 Subject: [PATCH 2/8] App --- app/main.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/main.py diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..b9af97c --- /dev/null +++ b/app/main.py @@ -0,0 +1,7 @@ +from fastapi import FastAPI + +app = FastAPI() + +@app.get("/health") +def health_check(): + return {"status": "ok"} From a92e33fa59a611141dd87cd43387a873b50016a7 Mon Sep 17 00:00:00 2001 From: "Aarthi Manivannan, Premanathan Aarthi Manivannan" Date: Thu, 6 Nov 2025 15:51:08 +0100 Subject: [PATCH 3/8] Add new directory --- test/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/.gitkeep diff --git a/test/.gitkeep b/test/.gitkeep new file mode 100644 index 0000000..e69de29 From 70221683c327abbd8c2d2163115ad4b7e020658c Mon Sep 17 00:00:00 2001 From: "Aarthi Manivannan, Premanathan Aarthi Manivannan" Date: Thu, 6 Nov 2025 15:51:56 +0100 Subject: [PATCH 4/8] tesing --- test/test_health.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/test_health.py diff --git a/test/test_health.py b/test/test_health.py new file mode 100644 index 0000000..7b088a7 --- /dev/null +++ b/test/test_health.py @@ -0,0 +1,8 @@ +from fastapi.testclient import TestClient +from app.main import app + +client = TestClient(app) + +def test_health(): + response = client.get("/health") + assert response.status_code == 200 From fd4d342eebb210720aec6672994c9996ccd1ff1a Mon Sep 17 00:00:00 2001 From: "Aarthi Manivannan, Premanathan Aarthi Manivannan" Date: Thu, 6 Nov 2025 15:52:45 +0100 Subject: [PATCH 5/8] Delete .gitlab-ci.yml --- .gitlab-ci.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index d88cb19..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,6 +0,0 @@ -build-job: - script: - - echo "Building the Project.." -test-job: - script: - - echo "Running Tests.." \ No newline at end of file From a069452f873d5ff140d3acbd8cb8872147d3e2cf Mon Sep 17 00:00:00 2001 From: "Aarthi Manivannan, Premanathan Aarthi Manivannan" Date: Thu, 6 Nov 2025 15:53:38 +0100 Subject: [PATCH 6/8] requirements --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..36a15fc --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +fastapi +uvicorn +pytest From b70680e95050001030c1e9bfa7886a4bc4d48910 Mon Sep 17 00:00:00 2001 From: "Aarthi Manivannan, Premanathan Aarthi Manivannan" Date: Thu, 6 Nov 2025 16:00:28 +0100 Subject: [PATCH 7/8] Ci file --- .gitlab-ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..8bbe7c6 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +image: python:3.14.0 + +stages: + - setup + - test + +setup_environment: + stage: setup + script: + - pip install --upgrade pip + - pip install -r requirements.txt + - echo "Dependencies installed successfully." + +test_app: + stage: test + script: + - echo "Running V2D Framework basic test..." + - python -m unittest discover || echo "No tests found." From fb173a404113fcc06efe344e83a58e7edb44abc9 Mon Sep 17 00:00:00 2001 From: "Aarthi Manivannan, Premanathan Aarthi Manivannan" Date: Thu, 6 Nov 2025 16:21:01 +0100 Subject: [PATCH 8/8] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8bbe7c6..5bebd17 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,9 @@ +workflow: + rules: + # Run the pipeline for merge requests or when committing to a branch + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH + image: python:3.14.0 stages: @@ -11,8 +17,17 @@ setup_environment: - pip install -r requirements.txt - echo "Dependencies installed successfully." + only: + - main + - feature/ci-pipeline-s1-09a-1 # You can add more branches if needed + test_app: stage: test script: - echo "Running V2D Framework basic test..." - python -m unittest discover || echo "No tests found." + + only: + - main + - feature/ci-pipeline-s1-09a-1 +