Better local caching via burrunan/gradle-cache-action (#1054)

* Better local caching via burrunan/gradle-cache-action

* Add cached debug

* Fix yaml

* Don't push to remote cache during PR

* Polish
This commit is contained in:
Nikita Salnikov-Tarnovski 2020-08-19 22:00:06 +03:00 committed by GitHub
parent 9aa64abf63
commit 090cdd782b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 26 deletions

View File

@ -28,20 +28,14 @@ jobs:
with:
java-version: 11
- name: Cache gradle dependencies
- name: Test
uses: burrunan/gradle-cache-action@v1
with:
job-id: jdk${{ matrix.java }}
- name: Test with Gradle
uses: nick-invision/retry@v1
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
with:
command: ./gradlew testJava${{ matrix.java }} --stacktrace
timeout_minutes: 60
max_attempts: 3
job-id: jdk${{ matrix.java }}
arguments: testJava${{ matrix.java }} --stacktrace -Dorg.gradle.caching.debug=true
- name: Aggregate test reports with ciMate
if: always()
@ -63,20 +57,14 @@ jobs:
with:
java-version: 11
- name: Cache gradle dependencies
- name: Test
uses: burrunan/gradle-cache-action@v1
with:
job-id: latestDepTest
- name: Test with Gradle
uses: nick-invision/retry@v1
arguments: test -PtestLatestDeps=true --stacktrace
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
with:
command: ./gradlew test -PtestLatestDeps=true --stacktrace
timeout_minutes: 60
max_attempts: 3
- name: Aggregate test reports with ciMate
if: always()

View File

@ -24,17 +24,11 @@ jobs:
with:
java-version: 11
- name: Cache gradle dependencies
- name: Test
uses: burrunan/gradle-cache-action@v1
with:
job-id: jdk${{ matrix.java }}
- name: Test with Gradle
uses: nick-invision/retry@v1
with:
command: ./gradlew testJava${{ matrix.java }} --stacktrace
timeout_minutes: 60
max_attempts: 3
arguments: testJava${{ matrix.java }} --stacktrace
- name: Aggregate test reports with ciMate
if: always()

View File

@ -23,7 +23,7 @@ buildCache {
remote(com.github.burrunan.s3cache.AwsS3BuildCache) {
region = 'us-west-2'
bucket = 'opentelemetry-java-instrumentation-gradle-test1'
push = System.getenv('S3_BUILD_CACHE_ACCESS_KEY_ID') != null
push = isCI && !System.getenv('S3_BUILD_CACHE_ACCESS_KEY_ID')?.isBlank()
}
}