Last active
March 26, 2020 10:54
-
-
Save aalmiray/78ff1de407a4779b5a5db7793abb7767 to your computer and use it in GitHub Desktop.
OCI Gradle Cache plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_PASSPHRASE" \ | |
--output $HOME/.github-secrets.tar .github-secrets.tar.gpg | |
tar xvf $HOME/.github-secrets.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
env: | |
CI: true | |
COMPARTMENT_ID: ${{ secrets.COMPARTMENT_ID }} | |
DECRYPT_PASSPHRASE: ${{ secrets.DECRYPT_PASSPHRASE }} | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Decrypt secrets | |
run: ./.github/scripts/decrypt_secret.sh | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradlew') }} | |
restore-keys: | | |
${{ runner.os }}-gradlew- | |
- uses: eskatos/gradle-command-action@v1 | |
with: | |
arguments: build -S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
jcenter() | |
gradlePluginPortal() | |
} | |
dependencies { | |
classpath 'org.kordamp.gradle:oci-gradle-build-cache-plugin:0.3.0' | |
} | |
} | |
apply plugin: 'org.kordamp.gradle.oci-build-cache' | |
ext.isCiServer = System.getenv().containsKey('CI') | |
buildCache { | |
local { | |
enabled = !isCiServer | |
} | |
remote(org.kordamp.gradle.plugin.buildcache.OCIBuildCache) { | |
configFile = '.oci/config' | |
compartmentId = System.getenv()['COMPARTMENT_ID'] ?: '**bogus**' | |
push = isCiServer | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment