我正在尝试用sbt制作我的第一个gitlab ci管道。我正在尝试构建和测试阶段。
问题是,尽管我在构建时编译了项目,但在运行测试之前,它会在测试阶段再次编译。
有人能帮助我理解为什么会发生这种情况,以及如何解决它吗?
sbt版本: 1.2.7
这是我的gitlab-ci.yml文件:
image: docker-registry:5000/sbt-docker:latest
variables:
SBT_OPTS: "-Dsbt.global.base=sbt-cache/sbtboot -Dsbt.boot.directory=sbt-cache/boot -Dsbt.ivy.home=sbt-cache/ivy Dsbt.coursier.home=sbt-cache/coursier -Dsbt.io.jdktimestamps=true"
COURSIER_CACHE: sbt-cache/coursier
stages:
- build
- test
cache:
paths:
- "sbt-cache/ivy/cache"
- "sbt-cache/boot"
- "sbt-cache/sbtboot"
- "sbt-cache/coursier"
build:
stage: build
script:
- sbt -J-Xmx2G clean core/compile core/package
artifacts:
untracked: true
paths:
- "target/"
test:
stage: test
dependencies:
- build
script:
- sbt core/test
allow_failure: true发布于 2020-01-24 03:04:52
您需要缓存项目的target/文件夹。我不熟悉CircleCI,似乎有一个可用的cache:paths键,只要缓存是针对每个分支的,这个键听起来很不错。
https://stackoverflow.com/questions/59879351
复制相似问题