gitlab ci: properly cache dependencies

This commit is contained in:
Bixilon 2022-11-14 11:48:30 +01:00
parent 08c26e8c3d
commit 9ee2df005a
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -6,28 +6,31 @@ variables:
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
paths:
- .gradle/wrapper
- .gradle/caches
stages:
- build
- test
- package
cache:
- key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build
- key:
files:
- "*gradle/**"
- "**.kts"
policy: pull-push
paths:
- .gradle
build:
stage: build
script: ./gradlew --build-cache assemble
only:
- master
- merge_requests
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build
- .gradle
test:
stage: test
@ -39,12 +42,6 @@ test:
when: always
reports:
junit: build/test-results/**/TEST-*.xml
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle
package:
stage: package
@ -55,9 +52,3 @@ package:
artifacts:
paths:
- build/libs/minosoft-fat-*.jar
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle