在gitlab ci中运行sbt测试
我有一个play 2.4.x项目。我想用gitlab做CI 如何在中运行测试 我的在gitlab ci中运行sbt测试,sbt,gitlab-ci,Sbt,Gitlab Ci,我有一个play 2.4.x项目。我想用gitlab做CI 如何在中运行测试 我的gitbal ci.yml文件如下所示,但显然是错误的 tests: script: "apt-get install -y sbt && sbt test" 我得到了错误 Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package s
gitbal ci.yml
文件如下所示,但显然是错误的
tests:
script: "apt-get install -y sbt && sbt test"
我得到了错误
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package sbt
要在基于Debian的发行版上安装sbt,必须运行以下步骤
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt
有关更多详细信息,请参阅。您可以直接使用
SBT
图像
这个gitbal ci.yml
在我的情况下起作用(还处理缓存):
这是来自:
image: "hseeberger/scala-sbt"
variables:
SBT_VERSION: "1.2.8"
SBT_OPTS: "-Dsbt.global.base=sbt-cache/.sbtboot -Dsbt.boot.directory=sbt-cache/.boot -Dsbt.ivy.home=sbt-cache/.ivy"
cache:
key: "$CI_BUILD_REF_NAME" # contains either the branch or the tag, so it's caching per branch
untracked: true
paths:
- "sbt-cache/.ivy.cache"
- "sbt-cache/.boot"
- "sbt-cache/.sbtboot"
- "sbt-cache/target"
stages:
- test
test:
script:
- sbt test