Skip to content

Commit

Permalink
Better local caching via burrunan/gradle-cache-action (#1054)
Browse files Browse the repository at this point in the history
* Better local caching via burrunan/gradle-cache-action

* Add cached debug

* Fix yaml

* Don't push to remote cache during PR

* Polish
  • Loading branch information
iNikem committed Aug 19, 2020
1 parent 9aa64ab commit 090cdd7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 090cdd7

Please sign in to comment.