diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 5c430b6bca..8c593fcfdc 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -7,11 +7,47 @@ on: workflow_dispatch: 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: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 15] + java: [ 8, 15 ] fail-fast: false steps: - uses: actions/checkout@v2 @@ -23,19 +59,25 @@ jobs: run: echo JAVA_${{ matrix.java }}_HOME=${{ env.JAVA_HOME }} >> $GITHUB_ENV - name: Set up JDK 11 for running Gradle - if: matrix.java != 11 + if: matrix.java == 8 uses: actions/setup-java@v1 with: java-version: 11 - - name: Test + - name: Restore cache uses: burrunan/gradle-cache-action@v1.5 + with: + job-id: jdk${{ matrix.java }} + + - name: Test + 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: - job-id: jdk${{ matrix.java }} - arguments: testJava${{ matrix.java }} --stacktrace -Dorg.gradle.caching.debug=true + command: ./gradlew testJava${{ matrix.java }} --stacktrace + timeout_minutes: 90 + max_attempts: 3 - name: Aggregate test reports with ciMate if: always() @@ -57,14 +99,20 @@ jobs: with: java-version: 11 - - name: Test + - name: Restore cache uses: burrunan/gradle-cache-action@v1.5 with: job-id: latestDepTest - arguments: test -PtestLatestDeps=true --stacktrace + + - name: Test + 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 test -PtestLatestDeps=true --stacktrace + timeout_minutes: 60 + max_attempts: 3 - name: Aggregate test reports with ciMate if: always() @@ -77,9 +125,32 @@ jobs: chmod +x cimate ./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: name: Open issue on failure - needs: [test, testLatestDep] + needs: [ build, test, testLatestDep, snapshot ] runs-on: ubuntu-latest if: always() steps: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0a903355ab..a2ed997cff 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -13,11 +13,17 @@ jobs: with: java-version: 11 - - name: Build + - name: Restore cache uses: burrunan/gradle-cache-action@v1.5 with: 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 if: always() @@ -50,11 +56,17 @@ jobs: with: java-version: 11 - - name: Test + - name: Restore cache uses: burrunan/gradle-cache-action@v1.5 with: 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 if: always() @@ -77,11 +89,17 @@ jobs: with: java-version: 11 - - name: Test + - name: Restore cache uses: burrunan/gradle-cache-action@v1.5 with: - job-id: jdk11 - arguments: :smoke-tests:test + job-id: smokeTests + + - 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 if: always() diff --git a/instrumentation/akka-http-10.0/akka-http-10.0.gradle b/instrumentation/akka-http-10.0/akka-http-10.0.gradle index 1f0a4a1c5d..beedc935d3 100644 --- a/instrumentation/akka-http-10.0/akka-http-10.0.gradle +++ b/instrumentation/akka-http-10.0/akka-http-10.0.gradle @@ -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 { // TODO remove once Scala/akka supports Java 15 // https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html 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 { version101Test { dirName = 'test' diff --git a/settings.gradle b/settings.gradle index 4ca191bca6..3d35b2d55b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -24,8 +24,9 @@ def awsAccessKeyId = System.getenv("S3_BUILD_CACHE_ACCESS_KEY_ID") buildCache { remote(com.github.burrunan.s3cache.AwsS3BuildCache) { region = 'us-west-2' - bucket = 'opentelemetry-java-instrumentation-gradle-test1' + bucket = 'opentelemetry-java-instrumentation-gradle-cache' push = isCI && awsAccessKeyId != null && !awsAccessKeyId.isEmpty() + lookupDefaultAwsCredentials = true } }