SBT Recopiles in every step

Hi im trying to make my first gitlab ci with sbt. but not matter what i try to do sbt recompiles the whole project in each step.

can someone help?

this is my yaml file:

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”
COURSIER_CACHE: sbt-cache/coursier

stages:

  • build
  • test

cache:
paths:
- “sbt-cache/ivy/cache”
- “sbt-cache/boot”
- “sbt-cache/sbtboot”
- “sbt-cache/target”
- “sbt-cache/coursier”

build:
stage: build
script:
- sbt -J-Xmx2G clean myProject/compile myProject/package
artifacts:
paths:
- “target”
- “project/target”
- “project/project/target”
- “/target"
- "
/project/target”
- “*/project/project/target”
expire_in: 30min

test:
stage: test
script:
- sbt myProject/test
allow_failure: true