From 1c89a509a3bbf6c475bbf48199aff6148f958ed6 Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 10 Jan 2025 19:42:59 +0100 Subject: [PATCH] Set standard app directory in container --- .forgejo/workflows/test.yaml | 23 ++++++++++------------- Containerfile | 4 ++-- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml index abdd97b..a56a9ce 100644 --- a/.forgejo/workflows/test.yaml +++ b/.forgejo/workflows/test.yaml @@ -11,21 +11,18 @@ on: jobs: test: runs-on: container - container: - image: code.philo.ydns.eu/philorg/python-ci - volumes: - - "uv_cache:/root/.cache/uv" - - "ca-cert:/etc/containers/certs.d" steps: - - name: Echo env - if: ${{ inputs.verbose }} - run: | - echo '${{ toJSON(env) }}' - - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Install app with 'uv pip install' - run: uv pip install --python=$UV_PROJECT_ENVIRONMENT --no-deps . + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v4 + with: + version: "0.5.16" + + - name: Install + run: uv sync - name: Run tests (API call) - run: pytest -s tests/basic.py + run: .venv/bin/pytest -s tests/basic.py diff --git a/Containerfile b/Containerfile index 1d0db97..0cbdc9e 100644 --- a/Containerfile +++ b/Containerfile @@ -2,10 +2,10 @@ FROM docker.io/library/python:alpine COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ -COPY . /src +COPY . /app # Sync the project into a new environment, using the frozen lockfile -WORKDIR /src +WORKDIR /app RUN uv pip install --system .