我有一个干净的Spring Boot项目,正在测试ci。 我创建了一个工作来检查代码质量,但是运行时间很长(超过20分钟)。我没有找到原因。
image: maven:3.3-jdk-8
cache:
paths:
- .m2/
untracked: true
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2"
stages:
- check
- test
- build
code_quality:
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:latest" /code
artifacts:
reports:
codequality: gl-code-quality-report.json
run-tests-myapp:
stage: test
script:
- mvn --batch-mode test
only:
- master
- dev
- merge_requests