diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index a065218..f39e039 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -104,9 +104,16 @@ jobs: fi docker buildx inspect --bootstrap + lockfile_sha="$(sha256sum uv.lock | awk '{ print $1 }')" + image_usable() { docker run --rm "${CI_GOLDEN_REF}:${GOLDEN_TAG}" \ - bash -c '/app/.venv/bin/ruff --version >/dev/null && /app/.venv/bin/python -m pytest --version >/dev/null' + bash -c " + test -f /app/uv.lock + test \"\$(sha256sum /app/uv.lock | awk '{ print \$1 }')\" = '${lockfile_sha}' + /app/.venv/bin/ruff --version >/dev/null + /app/.venv/bin/python -m pytest --version >/dev/null + " } if ! docker buildx imagetools inspect "${CI_GOLDEN_REF}:${GOLDEN_TAG}" >/dev/null 2>&1 || ! image_usable; then diff --git a/docker/Dockerfile b/docker/Dockerfile index eb36b12..1837414 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -52,6 +52,7 @@ RUN uv sync --frozen --no-install-project --dev FROM base AS ci-deps-base COPY --from=ci-deps-build /app/.venv /app/.venv +COPY pyproject.toml uv.lock ./ ENV PATH="/app/.venv/bin:${PATH}" \ PYTHONPATH=/workspace/src \