diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 6349b4ff..3464b7b1 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -34,15 +34,24 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 - - name: Cache Gradle + - name: Cache Gradle Dependencies uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper - key: gradle-core-${{ github.sha }} + !~/.gradle/caches/build-cache-* + key: gradle-deps-core-${{ hashFiles('**/build.gradle.kts') }} restore-keys: | - gradle- + gradle-deps + - name: Cache Gradle Build + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches/build-cache-* + key: gradle-builds-core-${{ github.sha }} + restore-keys: | + gradle-builds - name: Cache Cmake uses: actions/cache@v2 with: @@ -56,8 +65,8 @@ jobs: ccache -o hash_dir=false - name: Build with Gradle run: | - [ $(du -s ~/.gradle/wrapper | awk '{ print $1 }') -gt 250000 ] && rm -rf ~/.gradle/wrapper/* - find ~/.gradle/caches -exec touch -d "2 days ago" {} + + [ $(du -s ~/.gradle/wrapper | awk '{ print $1 }') -gt 250000 ] && rm -rf ~/.gradle/wrapper/* || true + find ~/.gradle/caches -exec touch -d "2 days ago" {} + || true echo 'org.gradle.caching=true' >> gradle.properties echo 'org.gradle.parallel=true' >> gradle.properties echo 'org.gradle.vfs.watch=true' >> gradle.properties diff --git a/.github/workflows/manager.yml b/.github/workflows/manager.yml index be4ab8a2..72326793 100644 --- a/.github/workflows/manager.yml +++ b/.github/workflows/manager.yml @@ -35,15 +35,24 @@ jobs: echo androidKeyPassword='${{ secrets.KEY_PASSWORD }}' >> gradle.properties echo androidStoreFile='key.jks' >> gradle.properties echo ${{ secrets.KEY_STORE }} | base64 --decode > key.jks - - name: Cache Gradle + - name: Cache Gradle Dependencies uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper - key: gradle-manager-${{ github.sha }} + !~/.gradle/caches/build-cache-* + key: gradle-deps-manager-${{ hashFiles('**/build.gradle.kts') }} restore-keys: | - gradle- + gradle-deps + - name: Cache Gradle Build + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches/build-cache-* + key: gradle-builds-manager-${{ github.sha }} + restore-keys: | + gradle-builds - name: Build with Gradle id: buildRelease run: |