Review our usage of gradle cache (#1474)
* Experiments * Experiments * Experiments * Update nightly.yaml Trying to populate remote cache * Experiments * Better cache and snapshot publishing in GHA * Read-only remote cache for PRs
This commit is contained in:
parent
f6ad05b8e3
commit
d033ed594f
|
@ -7,11 +7,47 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up JDK 11 for running checks
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
|
||||||
|
- name: Restore cache
|
||||||
|
uses: burrunan/gradle-cache-action@v1.5
|
||||||
|
with:
|
||||||
|
job-id: jdk11
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
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 build --stacktrace
|
||||||
|
timeout_minutes: 90
|
||||||
|
max_attempts: 3
|
||||||
|
|
||||||
|
- name: Aggregate test reports with ciMate
|
||||||
|
if: always()
|
||||||
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
CIMATE_PROJECT_ID: mz1jo49x
|
||||||
|
CIMATE_CI_KEY: "PR / jdk11"
|
||||||
|
run: |
|
||||||
|
wget -q https://get.cimate.io/release/linux/cimate
|
||||||
|
chmod +x cimate
|
||||||
|
./cimate -v "**/TEST-*.xml"
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java: [8, 11, 15]
|
java: [ 8, 15 ]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -23,19 +59,25 @@ jobs:
|
||||||
run: echo JAVA_${{ matrix.java }}_HOME=${{ env.JAVA_HOME }} >> $GITHUB_ENV
|
run: echo JAVA_${{ matrix.java }}_HOME=${{ env.JAVA_HOME }} >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up JDK 11 for running Gradle
|
- name: Set up JDK 11 for running Gradle
|
||||||
if: matrix.java != 11
|
if: matrix.java == 8
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
|
||||||
- name: Test
|
- name: Restore cache
|
||||||
uses: burrunan/gradle-cache-action@v1.5
|
uses: burrunan/gradle-cache-action@v1.5
|
||||||
|
with:
|
||||||
|
job-id: jdk${{ matrix.java }}
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
uses: nick-invision/retry@v1
|
||||||
env:
|
env:
|
||||||
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
||||||
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
||||||
with:
|
with:
|
||||||
job-id: jdk${{ matrix.java }}
|
command: ./gradlew testJava${{ matrix.java }} --stacktrace
|
||||||
arguments: testJava${{ matrix.java }} --stacktrace -Dorg.gradle.caching.debug=true
|
timeout_minutes: 90
|
||||||
|
max_attempts: 3
|
||||||
|
|
||||||
- name: Aggregate test reports with ciMate
|
- name: Aggregate test reports with ciMate
|
||||||
if: always()
|
if: always()
|
||||||
|
@ -57,14 +99,20 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
|
||||||
- name: Test
|
- name: Restore cache
|
||||||
uses: burrunan/gradle-cache-action@v1.5
|
uses: burrunan/gradle-cache-action@v1.5
|
||||||
with:
|
with:
|
||||||
job-id: latestDepTest
|
job-id: latestDepTest
|
||||||
arguments: test -PtestLatestDeps=true --stacktrace
|
|
||||||
|
- name: Test
|
||||||
|
uses: nick-invision/retry@v1
|
||||||
env:
|
env:
|
||||||
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
||||||
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
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
|
- name: Aggregate test reports with ciMate
|
||||||
if: always()
|
if: always()
|
||||||
|
@ -77,9 +125,32 @@ jobs:
|
||||||
chmod +x cimate
|
chmod +x cimate
|
||||||
./cimate -v "**/TEST-*.xml"
|
./cimate -v "**/TEST-*.xml"
|
||||||
|
|
||||||
|
snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ build, test, testLatestDep ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up JDK 11 for running checks
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
|
||||||
|
- name: Restore cache
|
||||||
|
uses: burrunan/gradle-cache-action@v1.5
|
||||||
|
with:
|
||||||
|
job-id: jdk11
|
||||||
|
|
||||||
|
- name: Publish snapshot
|
||||||
|
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 }}
|
||||||
|
run: ./gradlew snapshot --stacktrace
|
||||||
|
|
||||||
|
|
||||||
issue:
|
issue:
|
||||||
name: Open issue on failure
|
name: Open issue on failure
|
||||||
needs: [test, testLatestDep]
|
needs: [ build, test, testLatestDep, snapshot ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: always()
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -13,11 +13,17 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
|
||||||
- name: Build
|
- name: Restore cache
|
||||||
uses: burrunan/gradle-cache-action@v1.5
|
uses: burrunan/gradle-cache-action@v1.5
|
||||||
with:
|
with:
|
||||||
job-id: jdk11
|
job-id: jdk11
|
||||||
arguments: build --stacktrace -x :smoke-tests:test
|
|
||||||
|
- name: Build
|
||||||
|
uses: nick-invision/retry@v1
|
||||||
|
with:
|
||||||
|
command: ./gradlew check --stacktrace -x :smoke-tests:test
|
||||||
|
timeout_minutes: 90
|
||||||
|
max_attempts: 3
|
||||||
|
|
||||||
- name: Aggregate test reports with ciMate
|
- name: Aggregate test reports with ciMate
|
||||||
if: always()
|
if: always()
|
||||||
|
@ -50,11 +56,17 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
|
||||||
- name: Test
|
- name: Restore cache
|
||||||
uses: burrunan/gradle-cache-action@v1.5
|
uses: burrunan/gradle-cache-action@v1.5
|
||||||
with:
|
with:
|
||||||
job-id: jdk${{ matrix.java }}
|
job-id: jdk${{ matrix.java }}
|
||||||
arguments: testJava${{ matrix.java }} --stacktrace -x :smoke-tests:test
|
|
||||||
|
- name: Test
|
||||||
|
uses: nick-invision/retry@v1
|
||||||
|
with:
|
||||||
|
command: ./gradlew testJava${{ matrix.java }} --stacktrace -x :smoke-tests:test
|
||||||
|
timeout_minutes: 90
|
||||||
|
max_attempts: 3
|
||||||
|
|
||||||
- name: Aggregate test reports with ciMate
|
- name: Aggregate test reports with ciMate
|
||||||
if: always()
|
if: always()
|
||||||
|
@ -77,11 +89,17 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
|
||||||
- name: Test
|
- name: Restore cache
|
||||||
uses: burrunan/gradle-cache-action@v1.5
|
uses: burrunan/gradle-cache-action@v1.5
|
||||||
with:
|
with:
|
||||||
job-id: jdk11
|
job-id: smokeTests
|
||||||
arguments: :smoke-tests:test
|
|
||||||
|
- name: Test
|
||||||
|
uses: nick-invision/retry@v1
|
||||||
|
with:
|
||||||
|
command: ./gradlew :smoke-tests:test
|
||||||
|
timeout_minutes: 90
|
||||||
|
max_attempts: 3
|
||||||
|
|
||||||
- name: Aggregate test reports with ciMate
|
- name: Aggregate test reports with ciMate
|
||||||
if: always()
|
if: always()
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
apply from: "$rootDir/gradle/instrumentation.gradle"
|
|
||||||
apply from: "$rootDir/gradle/test-with-scala.gradle"
|
|
||||||
apply plugin: 'org.unbroken-dome.test-sets'
|
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
// TODO remove once Scala/akka supports Java 15
|
// TODO remove once Scala/akka supports Java 15
|
||||||
// https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html
|
// https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html
|
||||||
maxJavaVersionForTests = JavaVersion.VERSION_14
|
maxJavaVersionForTests = JavaVersion.VERSION_14
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply from: "$rootDir/gradle/instrumentation.gradle"
|
||||||
|
apply from: "$rootDir/gradle/test-with-scala.gradle"
|
||||||
|
apply plugin: 'org.unbroken-dome.test-sets'
|
||||||
|
|
||||||
testSets {
|
testSets {
|
||||||
version101Test {
|
version101Test {
|
||||||
dirName = 'test'
|
dirName = 'test'
|
||||||
|
|
|
@ -24,8 +24,9 @@ def awsAccessKeyId = System.getenv("S3_BUILD_CACHE_ACCESS_KEY_ID")
|
||||||
buildCache {
|
buildCache {
|
||||||
remote(com.github.burrunan.s3cache.AwsS3BuildCache) {
|
remote(com.github.burrunan.s3cache.AwsS3BuildCache) {
|
||||||
region = 'us-west-2'
|
region = 'us-west-2'
|
||||||
bucket = 'opentelemetry-java-instrumentation-gradle-test1'
|
bucket = 'opentelemetry-java-instrumentation-gradle-cache'
|
||||||
push = isCI && awsAccessKeyId != null && !awsAccessKeyId.isEmpty()
|
push = isCI && awsAccessKeyId != null && !awsAccessKeyId.isEmpty()
|
||||||
|
lookupDefaultAwsCredentials = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue