diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..5cbf939 --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,23 @@ +name: Run Tests +on: + push: {} +env: + RUNNER_TOOL_CACHE: /toolcache +jobs: + run-tests: + runs-on: python + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_JOHN_PRIVATE_KEY }} + - name: Install poetry + run: | + python3 -m pip install poetry==2.3.4 + - name: Install the project dependencies + run: | + python3 -m poetry install + python3 -m poetry env info + - name: Run the automated tests + run: | + python3 -m poetry run python -m pytest tests diff --git a/pyproject.toml b/pyproject.toml index 9ebe280..f781d91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ dependencies = [ [virtualenvs] in-project = true +create = true [tool.alembic] script_location = "%(here)s/migrations" diff --git a/tests/pytest.ini b/tests/pytest.ini index ce95952..61009ea 100644 --- a/tests/pytest.ini +++ b/tests/pytest.ini @@ -3,6 +3,7 @@ log_cli = 1 log_cli_level = INFO log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s) log_cli_date_format=%Y-%m-%d %H:%M:%S +pythonpath = ../app env = DATABASE_FILE=testdb.sqlite DATABASE_URL=sqlite:///testdb.sqlite?cache=shared