diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b5e86e9..6544228 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -38,10 +38,8 @@ jobs: - name: Run unit tests run: | - docker run --rm -v "$PWD":/app -w /app python:3.13-alpine sh -c " - pip install --no-cache-dir -r requirements-dev.txt && - pytest -v - " + docker build --target test -t adguard-cidre:test . + docker run --rm adguard-cidre:test pytest -v - name: Check deprecation warnings run: | diff --git a/Dockerfile b/Dockerfile index 3e7b7c3..cb697c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.13-alpine +FROM python:3.13-alpine AS base ENV TZ=Europe/Paris @@ -11,4 +11,11 @@ WORKDIR /app COPY blocklist_scheduler.py . +FROM base AS test +COPY requirements-dev.txt . +RUN pip install --no-cache-dir -r requirements-dev.txt +COPY tests/ tests/ +COPY pytest.ini . + +FROM base ENTRYPOINT ["python3", "blocklist_scheduler.py"]