diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 587d760ae113c..05faf51d0b261 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,5 +1,9 @@ name: Airbyte CI +env: + S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} + S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} + on: #ability to start task manually in Web UI workflow_dispatch: diff --git a/settings.gradle b/settings.gradle index 7baacf60c542f..856539561511e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -21,6 +21,7 @@ pluginManagement { // as much information as possible. plugins { id "com.gradle.enterprise" version "3.4.1" + id 'com.github.burrunan.s3-build-cache' version "1.5" } gradleEnterprise { @@ -30,6 +31,24 @@ gradleEnterprise { } } +ext.isCiServer = System.getenv().containsKey("CI") + +buildCache { + local { + // Local build cache is dangerous as it might produce inconsistent results + // in case developer modifies files while the build is running + enabled = false + } + remote(com.github.burrunan.s3cache.AwsS3BuildCache) { + region = 'us-east-2' + bucket = 'airbyte-buildcache' + prefix = 'cache/' + push = isCiServer + // Credentials will be taken from S3_BUILD_CACHE_... environment variables + // anonymous access will be used if environment variables are missing + } +} + rootProject.name = 'airbyte' // definition for dependency resolution