diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 00000000..89bfa7c7 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,52 @@ +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: cache poetry install + uses: actions/cache@v3 + id: cache-poetry + with: + path: ~/.local + key: poetry-1.7.1-0 + + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true + + - name: cache deps + id: cache-deps + uses: actions/cache@v3 + with: + path: .venv + key: pydeps-${{ hashFiles('**/poetry.lock') }} + + + - name: Install dependencies + run: poetry install --no-interaction --no-root + if: steps.cache-deps.outputs.cache-hit != 'true' + + - name: Test with pytest + run: | + source .venv/bin/activate + pytest diff --git a/pyproject.toml b/pyproject.toml index 890da9a3..47c58ac1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,9 @@ pytest = "^7.4.3" addopts = [ "--import-mode=importlib", ] - +pythonpath = [ + "src" +] [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/src/coffee/__init__.py b/src/coffee/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/run.py b/src/coffee/run.py similarity index 100% rename from src/run.py rename to src/coffee/run.py diff --git a/tests/test_helm_runner.py b/tests/test_helm_runner.py index 5d66076c..a0ed525f 100644 --- a/tests/test_helm_runner.py +++ b/tests/test_helm_runner.py @@ -5,7 +5,7 @@ import pytest -from run import CliHelmRunner, BbqHelmTest, HelmSut, HelmResult, RidiculousBenchmark, quantize_stars +from coffee.run import CliHelmRunner, BbqHelmTest, HelmSut, HelmResult, RidiculousBenchmark, quantize_stars def test_cli_helm_runner_command():