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 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 diff --git a/requirements.txt b/requirements.txt index 70b9f39..e35eafc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,7 @@ streamlit pandas plotly -requests \ No newline at end of file +requests +ruff +pytest +matplotlib \ No newline at end of file