From ce982b0575601169fb0b134e8e41076c4d0ed6d4 Mon Sep 17 00:00:00 2001 From: anthonychen000 Date: Thu, 26 Feb 2026 03:25:28 -0500 Subject: [PATCH 1/3] initial commit --- .github/workflows/python-ci.yml | 39 +++++++++++++++++++++++++++++++++ .gitignore | 0 Dockerfile | 12 ++++++++++ pyproject.toml | 15 +++++++++++++ requirements.txt | 0 scripts/run_pipeline.py | 0 6 files changed, 66 insertions(+) create mode 100644 .github/workflows/python-ci.yml create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 pyproject.toml create mode 100644 requirements.txt create mode 100644 scripts/run_pipeline.py diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml new file mode 100644 index 0000000..e1c0df7 --- /dev/null +++ b/.github/workflows/python-ci.yml @@ -0,0 +1,39 @@ + +name: POSM Pipeline CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: 'pip' + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install ruff pytest + # pip install -r requirements.txt (Uncomment when you add this file) + + - name: Lint and Format with Ruff + run: | + # Fails the build if there are syntax errors or undefined names + ruff check . + # Fails the build if the code is not formatted properly + ruff format --check . + + - name: Run Unit Tests + run: | + pytest tests/ \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3b8ce0d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.11-slim + +WORKDIR /app + +COPY requirements.txt . + +RUN pip install --upgrade pip && \ + pip install -r requirements.txt + +COPY . . + +CMD ["python", "scripts/run_pipeline.py"] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2773801 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[tool.ruff] +# Set the maximum line length +line-length = 100 +# Assume Python 3.11 +target-version = "py311" + +[tool.ruff.lint] +# E: pycodestyle errors, F: Pyflakes (syntax errors), I: isort (import sorting) +select = ["E", "F", "I"] + +[tool.pytest.ini_options] +# Define where the test suite lives +testpaths = ["tests"] +# Add detailed output to the test logs +addopts = "-v" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/scripts/run_pipeline.py b/scripts/run_pipeline.py new file mode 100644 index 0000000..e69de29 From b6a3f577a94b3a9d5fe5679a6ef3d595f9833fe8 Mon Sep 17 00:00:00 2001 From: anthonychen000 Date: Thu, 26 Feb 2026 03:30:25 -0500 Subject: [PATCH 2/3] Add placeholder test to trigger CI pipeline --- tests/mock_test.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/mock_test.py diff --git a/tests/mock_test.py b/tests/mock_test.py new file mode 100644 index 0000000..bfe0b80 --- /dev/null +++ b/tests/mock_test.py @@ -0,0 +1,6 @@ +def test_placeholder(): + """ + A temporary placeholder test to ensure the GitHub Actions CI pipeline + runs successfully. Real pipeline tests will be added here later. + """ + assert True \ No newline at end of file From c623315d96e79ad27ffd5d6a97d6afae43c940e3 Mon Sep 17 00:00:00 2001 From: anthonychen000 Date: Thu, 26 Feb 2026 03:36:24 -0500 Subject: [PATCH 3/3] Fix Ruff formatting and ensure Pytest passes --- .gitignore | 1 + requirements.txt | 2 ++ .../mock_test.cpython-313-pytest-8.3.5.pyc | Bin 0 -> 782 bytes tests/mock_test.py | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 tests/__pycache__/mock_test.cpython-313-pytest-8.3.5.pyc diff --git a/.gitignore b/.gitignore index e69de29..2eea525 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e69de29..6e31701 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1,2 @@ +ruff +pytest \ No newline at end of file diff --git a/tests/__pycache__/mock_test.cpython-313-pytest-8.3.5.pyc b/tests/__pycache__/mock_test.cpython-313-pytest-8.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..848fa7cee34686a6a909802be456ef189d494316 GIT binary patch literal 782 zcmZ8fy>HV%6n_^d{cw{K2^Ls5A&}~UxJ9raKtzCmMyf-m84tMfhmiS~~R7SftKv%Bbg zgE5TB2o$MpYuD2)3cGF9p)hXU0=05X0`ISb?8S3nZ91qu{AOQJVHYA{t3Cio9s^>> z-r+n3*k8Dw0m#Xr>sredES~%?h$Rc`!g4Zh=WyH(I;R)@kQ$y9 zQZZH0La>-mrAWBKtTxn0%5z;RPR*3l*Qt3^9?@ZJQkiS|;w>%Gf{QfgzA7=H%Q)s* zPf8)G0o~_JEDP#(nx3RW&?8P+lJJC1IW`u|a5eDXpKda(xia+LR#EK)+IndAg0}Ua z7nLIuF=f{y%_fK{l-(TG<;difQc~IL(L}0@nTUVHHFD-S1}(dR=&0$u-2_e91MM!F zQu{PKz_B`HxtYqmil;meU&^@5cy4s~u4E#XSr!&jXQ88^!%W5>BIgc@%Jyq&S1wL< zv9Eh9eH+yoT>8-MpN+mgJRhBpK8-GF>wFi@umpltyLMEj!lb#jUB`DB-He*u2h9e! z(m?SOl^Sl>mnpkC&nfp$)boFU>N$S{m0f$1$)ptgnYw{tP3;;wmmVSHH^66@L5K8f Fz&`><%|`$L literal 0 HcmV?d00001 diff --git a/tests/mock_test.py b/tests/mock_test.py index bfe0b80..bbca82c 100644 --- a/tests/mock_test.py +++ b/tests/mock_test.py @@ -1,6 +1,6 @@ def test_placeholder(): """ - A temporary placeholder test to ensure the GitHub Actions CI pipeline + A temporary placeholder test to ensure the GitHub Actions CI pipeline runs successfully. Real pipeline tests will be added here later. """ - assert True \ No newline at end of file + assert True