Loading .github/workflows/integ-test-action-inputs-caching.yml +4 −2 Changes for .github/workflows/integ-test-action-inputs-caching.yml: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ jobs: enterprise # Exclude build-cache from main cache entry gradle-home-cache-excludes: | caches/build-cache-1 caches/build-cache-* caches/*/executionHistory/** - name: Build using Gradle wrapper working-directory: .github/workflow-samples/groovy-dsl run: ./gradlew test Loading @@ -63,7 +64,8 @@ jobs: caches enterprise gradle-home-cache-excludes: | caches/build-cache-1 caches/build-cache-* caches/*/executionHistory/** cache-read-only: true - name: Execute Gradle build with --offline working-directory: .github/workflow-samples/groovy-dsl Loading src/cache-base.ts +14 −4 Changes for src/cache-base.ts: 14 added lines, 4 removed lines. Original line number Diff line number Diff line import * as core from '@actions/core' import * as exec from '@actions/exec' import * as glob from '@actions/glob' import path from 'path' import fs from 'fs' import * as params from './input-params' Loading Loading @@ -127,7 +129,7 @@ export class GradleStateCache { */ async beforeSave(listener: CacheListener): Promise<void> { await this.debugReportGradleUserHomeSize('before saving common artifacts') this.deleteExcludedPaths() await this.deleteExcludedPaths() await Promise.all([ new GradleHomeEntryExtractor(this.gradleUserHome).extract(listener) // new ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener) Loading @@ -140,13 +142,21 @@ export class GradleStateCache { /** * Delete any file paths that are excluded by the `gradle-home-cache-excludes` parameter. */ private deleteExcludedPaths(): void { private async deleteExcludedPaths(): Promise<void> { const rawPaths: string[] = params.getCacheExcludes() // rawPaths.push('caches/*/cc-keystore') const resolvedPaths = rawPaths.map(x => path.resolve(this.gradleUserHome, x)) for (const p of resolvedPaths) { cacheDebug(`Deleting excluded path: ${p}`) tryDelete(p) cacheDebug(`Removing excluded path: ${p}`) const globber = await glob.create(p, { implicitDescendants: false }) for (const toDelete of await globber.glob()) { cacheDebug(`Removing excluded file: ${toDelete}`) await tryDelete(toDelete) } } } Loading Loading
.github/workflows/integ-test-action-inputs-caching.yml +4 −2 Changes for .github/workflows/integ-test-action-inputs-caching.yml: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ jobs: enterprise # Exclude build-cache from main cache entry gradle-home-cache-excludes: | caches/build-cache-1 caches/build-cache-* caches/*/executionHistory/** - name: Build using Gradle wrapper working-directory: .github/workflow-samples/groovy-dsl run: ./gradlew test Loading @@ -63,7 +64,8 @@ jobs: caches enterprise gradle-home-cache-excludes: | caches/build-cache-1 caches/build-cache-* caches/*/executionHistory/** cache-read-only: true - name: Execute Gradle build with --offline working-directory: .github/workflow-samples/groovy-dsl Loading
src/cache-base.ts +14 −4 Changes for src/cache-base.ts: 14 added lines, 4 removed lines. Original line number Diff line number Diff line import * as core from '@actions/core' import * as exec from '@actions/exec' import * as glob from '@actions/glob' import path from 'path' import fs from 'fs' import * as params from './input-params' Loading Loading @@ -127,7 +129,7 @@ export class GradleStateCache { */ async beforeSave(listener: CacheListener): Promise<void> { await this.debugReportGradleUserHomeSize('before saving common artifacts') this.deleteExcludedPaths() await this.deleteExcludedPaths() await Promise.all([ new GradleHomeEntryExtractor(this.gradleUserHome).extract(listener) // new ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener) Loading @@ -140,13 +142,21 @@ export class GradleStateCache { /** * Delete any file paths that are excluded by the `gradle-home-cache-excludes` parameter. */ private deleteExcludedPaths(): void { private async deleteExcludedPaths(): Promise<void> { const rawPaths: string[] = params.getCacheExcludes() // rawPaths.push('caches/*/cc-keystore') const resolvedPaths = rawPaths.map(x => path.resolve(this.gradleUserHome, x)) for (const p of resolvedPaths) { cacheDebug(`Deleting excluded path: ${p}`) tryDelete(p) cacheDebug(`Removing excluded path: ${p}`) const globber = await glob.create(p, { implicitDescendants: false }) for (const toDelete of await globber.glob()) { cacheDebug(`Removing excluded file: ${toDelete}`) await tryDelete(toDelete) } } } Loading