enable test + lint on docker

This commit is contained in:
blob42 2023-05-18 20:09:49 +02:00
parent c858472d2a
commit e1bf5d2f09
2 changed files with 13 additions and 1 deletions

View File

@ -65,7 +65,7 @@ COPY poetry.* pyproject.toml ./
RUN mkdir /pip-prefix
RUN poetry export $POETRY_EXTRA_PACKAGES --with dev -f requirements.txt --output requirements.txt --without-hashes && \
RUN poetry export $POETRY_EXTRA_PACKAGES --with dev,test,lint -f requirements.txt --output requirements.txt --without-hashes && \
pip install --no-cache-dir --disable-pip-version-check --prefix /pip-prefix -r requirements.txt

View File

@ -50,3 +50,15 @@ docker.force_build: $(DOCKER_SRC)
docker.clean:
docker rmi $(DOCKER_IMAGE_NAME):$(GIT_HASH) $(DOCKER_IMAGE_NAME):latest
docker.test: docker.build
docker run --rm -it -u lchain -v $(ROOTDIR):/src $(DOCKER_IMAGE_NAME):$(GIT_HASH) \
pytest /src/tests/unit_tests
docker.lint: docker.build
$(eval DOCKER_CMD = docker run --rm -it -u lchain -v $(ROOTDIR):/src $(DOCKER_IMAGE_NAME):$(GIT_HASH))
$(DOCKER_CMD) mypy /src
$(DOCKER_CMD) black /src --check
$(DOCKER_CMD) isort /src --check
$(DOCKER_CMD) flake8 /src --check