Skip to content

Commit bbabcfc

Browse files
authored
Configure cache on CI (#58)
* Configure cache on CI Signed-off-by: Pavol Loffay <[email protected]> * CCI 2.1 Signed-off-by: Pavol Loffay <[email protected]>
1 parent 098874e commit bbabcfc

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

.circleci/config.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
version: 2
1+
version: 2.1
2+
3+
commands:
4+
setup_build_environment:
5+
description: 'Checkout, update submodules, restore the cache, and setup docker'
6+
steps:
7+
- checkout
8+
- run:
9+
name: Generate cache key
10+
command: find . -type f -name "*.gradle*" -o -name "gradle-wrapper*" -exec shasum {} + | sort > /tmp/checksum.txt && cat /tmp/checksum.txt
11+
- restore_cache:
12+
keys:
13+
- v1-dependencies-{{ checksum "/tmp/checksum.txt" }}
14+
# fallback to using the latest cache if no exact match is found
15+
- v1-dependencies-
16+
217
jobs:
318
build:
419
# For testcontainers.org
@@ -10,22 +25,7 @@ jobs:
1025
JVM_OPTS: -Xmx1g
1126
TERM: dumb
1227
steps:
13-
- checkout
14-
# TODO Task 'downloadDependencies' not found in root project 'hypertrace-otel-agent'.
15-
# # Download and cache dependencies
16-
# - restore_cache:
17-
# keys:
18-
# - v1-dependencies-{{ checksum "build.gradle.kts" }}
19-
# # fallback to using the latest cache if no exact match is found
20-
# - v1-dependencies-
21-
#
22-
#
23-
# - run: ./gradlew downloadDependencies
24-
#
25-
# - save_cache:
26-
# paths:
27-
# - ~/.gradle
28-
# key: v1-dependencies-{{ checksum "build.gradle.kts" }}
28+
- setup_build_environment
2929
- run: make build
3030

3131
muzzle:
@@ -37,13 +37,13 @@ jobs:
3737
JVM_OPTS: -Xmx1g
3838
TERM: dumb
3939
steps:
40-
- checkout
40+
- setup_build_environment
4141
- run: make muzzle
4242
release-publish:
4343
docker:
4444
- image: circleci/openjdk:11.0.6-jdk-buster
4545
steps:
46-
- checkout
46+
- setup_build_environment
4747
- run: ./gradlew :tag -Prelease
4848
- run: ./gradlew publish
4949
- add_ssh_keys:

0 commit comments

Comments
 (0)