From 1c2efd956d8a607aba81450d0c802a4736f18303 Mon Sep 17 00:00:00 2001 From: Hanghai Li Date: Fri, 27 Feb 2026 14:34:36 -0500 Subject: [PATCH 1/4] Move GitHub Actions workflow to correct path --- .github/workflows/tests.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..45849b1 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: tests + +on: + pull_request: + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Lint (ruff) + run: | + ruff check . + + - name: Run tests + run: | + pytest -q + \ No newline at end of file From e78d4f775eda3dff772e6b708a49de5709f5cbe5 Mon Sep 17 00:00:00 2001 From: Hanghai Li Date: Fri, 27 Feb 2026 14:38:10 -0500 Subject: [PATCH 2/4] Add conftest to fix pytest imports --- conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..4fa2d80 --- /dev/null +++ b/conftest.py @@ -0,0 +1,8 @@ +import sys +from pathlib import Path + +# Ensure the project root is on sys.path so tests can import utils.py +PROJECT_ROOT = Path(__file__).resolve().parent +if str(PROJECT_ROOT) not in sys.path: + sys.path.insert(0, str(PROJECT_ROOT)) + \ No newline at end of file From 6893743a857842a4b9f275677fac7bfd3377cffd Mon Sep 17 00:00:00 2001 From: Hanghai Li Date: Fri, 27 Feb 2026 14:43:59 -0500 Subject: [PATCH 3/4] Add ruff and pytest to requirements for CI --- requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 70b9f39..a6a383a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ streamlit pandas plotly -requests \ No newline at end of file +requests +ruff +pytest \ No newline at end of file From 93694ce626fe59380634d0ca6a3d4275e8e3baf2 Mon Sep 17 00:00:00 2001 From: Hanghai Li Date: Fri, 27 Feb 2026 14:45:32 -0500 Subject: [PATCH 4/4] Add matplotlib for CI tests --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a6a383a..e35eafc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ pandas plotly requests ruff -pytest \ No newline at end of file +pytest +matplotlib \ No newline at end of file