Loading .github/workflows/prod.yml +7 −13 Changes for .github/workflows/prod.yml: 7 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -51,24 +51,21 @@ jobs: gradle-version: 6.9 build-root-directory: __tests__/samples/no-wrapper arguments: help -DgradleVersionCheck=6.9 gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only - name: Test use Gradle version alias uses: ./ with: gradle-version: release-candidate build-root-directory: __tests__/samples/no-wrapper arguments: help -DgradleVersionCheck=7.2 gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only - name: Test use defined Gradle executable uses: ./ with: gradle-executable: __tests__/samples/basic/gradlew${{ matrix.script-suffix }} build-root-directory: __tests__/samples/no-wrapper arguments: help -DgradleVersionCheck=7.1.1 gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only # Test that the gradle-user-home cache will cache dependencies, by running build with --offline dependencies-cache: Loading @@ -85,8 +82,7 @@ jobs: with: build-root-directory: __tests__/samples/basic arguments: test --offline gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only # Test that the gradle-user-home cache will cache and restore local build-cache build-cache: Loading @@ -103,8 +99,7 @@ jobs: with: build-root-directory: __tests__/samples/basic arguments: test -DverifyCachedBuild=true gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only # Test that the project-dot-gradle cache will cache and restore configuration-cache configuration-cache: Loading @@ -123,8 +118,7 @@ jobs: with: build-root-directory: __tests__/samples/basic arguments: test --configuration-cache gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only # These build invocations are informational only, and are expected to fail failures: Loading @@ -145,4 +139,4 @@ jobs: with: build-root-directory: __tests__/samples/no-wrapper arguments: help gradle-user-home-cache-enabled: no gradle-cache-enabled: no action.yml +2 −6 Changes for action.yml: 2 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -20,12 +20,8 @@ inputs: description: Whether caching downloaded Gradle distributions is enabled or not. Valid values are 'true' (default), 'false', and 'read-only'. required: false default: true gradle-user-home-cache-enabled: description: Whether caching of state in Gradle User Home is enabled. Valid values are 'true' (default), 'false', and 'read-only'. required: false default: true project-dot-gradle-cache-enabled: description: Whether caching of state in project .gradle dir is enabled. Valid values are 'true' (default), 'false', and 'read-only'. gradle-cache-enabled: description: Whether caching of Gradle User Home and project .gradle directory is enabled. Valid values are 'true' (default), 'false', and 'read-only'. required: false default: true Loading src/cache-gradle-user-home.ts +2 −11 Changes for src/cache-gradle-user-home.ts: 2 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -4,13 +4,8 @@ import os from 'os' import * as core from '@actions/core' import * as cache from '@actions/cache' import { generateCacheKey, isCacheReadEnabled, isCacheSaveEnabled } from './cache-utils' import {generateCacheKey} from './cache-utils' const CACHE_NAME = 'gradle-user-home' const CACHE_PATH = [ '~/.gradle/caches/*', // All directories in 'caches' '~/.gradle/notifications/*', // Prevent the re-rendering of first-use message for version Loading @@ -20,10 +15,8 @@ const CACHE_KEY = 'GUH_CACHE_KEY' const CACHE_RESULT = 'GUH_CACHE_RESULT' export async function restore(): Promise<void> { if (!isCacheReadEnabled(CACHE_NAME)) return if (gradleUserHomeExists()) { core.debug('Gradle User Home already exists. Not restoring from cache.') core.info('Gradle User Home already exists. Not restoring from cache.') return } Loading @@ -49,8 +42,6 @@ export async function restore(): Promise<void> { } export async function save(): Promise<void> { if (!isCacheSaveEnabled(CACHE_NAME)) return if (!gradleUserHomeExists()) { core.debug('No Gradle User Home to cache.') return Loading src/cache-project-dot-gradle.ts +2 −11 Changes for src/cache-project-dot-gradle.ts: 2 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -3,13 +3,8 @@ import fs from 'fs' import * as core from '@actions/core' import * as cache from '@actions/cache' import { generateCacheKey, isCacheReadEnabled, isCacheSaveEnabled } from './cache-utils' import {generateCacheKey} from './cache-utils' const CACHE_NAME = 'project-dot-gradle' const PATHS_TO_CACHE = [ 'configuration-cache' // Only configuration-cache is stored at present ] Loading @@ -17,10 +12,8 @@ const CACHE_KEY = 'PROJECT_CACHE_KEY' const CACHE_RESULT = 'PROJECT_CACHE_RESULT' export async function restore(rootDir: string): Promise<void> { if (!isCacheReadEnabled(CACHE_NAME)) return if (projectDotGradleDirExists(rootDir)) { core.debug( core.info( 'Project .gradle directory already exists. Not restoring from cache.' ) return Loading @@ -46,8 +39,6 @@ export async function restore(rootDir: string): Promise<void> { } export async function save(rootDir: string): Promise<void> { if (!isCacheSaveEnabled(CACHE_NAME)) return if (!projectDotGradleDirExists(rootDir)) { core.debug('No project .gradle dir to cache.') return Loading src/caches.ts +13 −8 Changes for src/caches.ts: 13 added lines, 8 removed lines. Original line number Diff line number Diff line import * as cacheGradleUserHome from './cache-gradle-user-home' import * as cacheProjectDotGradle from './cache-project-dot-gradle' import * as core from '@actions/core' import {isCacheReadEnabled, isCacheSaveEnabled} from './cache-utils' const BUILD_ROOT_DIR = 'BUILD_ROOT_DIR' export async function restore(buildRootDirectory: string): Promise<void> { core.startGroup('Restore Gradle User Home from cache') await cacheGradleUserHome.restore() core.endGroup() if (!isCacheReadEnabled('gradle')) { core.debug('Cache read disabled') return } core.startGroup('Restore project .gradle directory from cache') core.startGroup('Restore Gradle state from cache') await cacheGradleUserHome.restore() core.saveState(BUILD_ROOT_DIR, buildRootDirectory) await cacheProjectDotGradle.restore(buildRootDirectory) core.endGroup() } export async function save(): Promise<void> { core.startGroup('Cache Gradle User Home') await cacheGradleUserHome.save() core.endGroup() if (!isCacheSaveEnabled('gradle')) { core.debug('Cache save disabled') return } core.startGroup('Cache project .gradle directory') core.startGroup('Caching Gradle state') await cacheGradleUserHome.save() const buildRootDirectory = core.getState(BUILD_ROOT_DIR) await cacheProjectDotGradle.save(buildRootDirectory) core.endGroup() Loading Loading
.github/workflows/prod.yml +7 −13 Changes for .github/workflows/prod.yml: 7 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -51,24 +51,21 @@ jobs: gradle-version: 6.9 build-root-directory: __tests__/samples/no-wrapper arguments: help -DgradleVersionCheck=6.9 gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only - name: Test use Gradle version alias uses: ./ with: gradle-version: release-candidate build-root-directory: __tests__/samples/no-wrapper arguments: help -DgradleVersionCheck=7.2 gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only - name: Test use defined Gradle executable uses: ./ with: gradle-executable: __tests__/samples/basic/gradlew${{ matrix.script-suffix }} build-root-directory: __tests__/samples/no-wrapper arguments: help -DgradleVersionCheck=7.1.1 gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only # Test that the gradle-user-home cache will cache dependencies, by running build with --offline dependencies-cache: Loading @@ -85,8 +82,7 @@ jobs: with: build-root-directory: __tests__/samples/basic arguments: test --offline gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only # Test that the gradle-user-home cache will cache and restore local build-cache build-cache: Loading @@ -103,8 +99,7 @@ jobs: with: build-root-directory: __tests__/samples/basic arguments: test -DverifyCachedBuild=true gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only # Test that the project-dot-gradle cache will cache and restore configuration-cache configuration-cache: Loading @@ -123,8 +118,7 @@ jobs: with: build-root-directory: __tests__/samples/basic arguments: test --configuration-cache gradle-user-home-cache-enabled: read-only project-dot-gradle-cache-enabled: read-only gradle-cache-enabled: read-only # These build invocations are informational only, and are expected to fail failures: Loading @@ -145,4 +139,4 @@ jobs: with: build-root-directory: __tests__/samples/no-wrapper arguments: help gradle-user-home-cache-enabled: no gradle-cache-enabled: no
action.yml +2 −6 Changes for action.yml: 2 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -20,12 +20,8 @@ inputs: description: Whether caching downloaded Gradle distributions is enabled or not. Valid values are 'true' (default), 'false', and 'read-only'. required: false default: true gradle-user-home-cache-enabled: description: Whether caching of state in Gradle User Home is enabled. Valid values are 'true' (default), 'false', and 'read-only'. required: false default: true project-dot-gradle-cache-enabled: description: Whether caching of state in project .gradle dir is enabled. Valid values are 'true' (default), 'false', and 'read-only'. gradle-cache-enabled: description: Whether caching of Gradle User Home and project .gradle directory is enabled. Valid values are 'true' (default), 'false', and 'read-only'. required: false default: true Loading
src/cache-gradle-user-home.ts +2 −11 Changes for src/cache-gradle-user-home.ts: 2 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -4,13 +4,8 @@ import os from 'os' import * as core from '@actions/core' import * as cache from '@actions/cache' import { generateCacheKey, isCacheReadEnabled, isCacheSaveEnabled } from './cache-utils' import {generateCacheKey} from './cache-utils' const CACHE_NAME = 'gradle-user-home' const CACHE_PATH = [ '~/.gradle/caches/*', // All directories in 'caches' '~/.gradle/notifications/*', // Prevent the re-rendering of first-use message for version Loading @@ -20,10 +15,8 @@ const CACHE_KEY = 'GUH_CACHE_KEY' const CACHE_RESULT = 'GUH_CACHE_RESULT' export async function restore(): Promise<void> { if (!isCacheReadEnabled(CACHE_NAME)) return if (gradleUserHomeExists()) { core.debug('Gradle User Home already exists. Not restoring from cache.') core.info('Gradle User Home already exists. Not restoring from cache.') return } Loading @@ -49,8 +42,6 @@ export async function restore(): Promise<void> { } export async function save(): Promise<void> { if (!isCacheSaveEnabled(CACHE_NAME)) return if (!gradleUserHomeExists()) { core.debug('No Gradle User Home to cache.') return Loading
src/cache-project-dot-gradle.ts +2 −11 Changes for src/cache-project-dot-gradle.ts: 2 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -3,13 +3,8 @@ import fs from 'fs' import * as core from '@actions/core' import * as cache from '@actions/cache' import { generateCacheKey, isCacheReadEnabled, isCacheSaveEnabled } from './cache-utils' import {generateCacheKey} from './cache-utils' const CACHE_NAME = 'project-dot-gradle' const PATHS_TO_CACHE = [ 'configuration-cache' // Only configuration-cache is stored at present ] Loading @@ -17,10 +12,8 @@ const CACHE_KEY = 'PROJECT_CACHE_KEY' const CACHE_RESULT = 'PROJECT_CACHE_RESULT' export async function restore(rootDir: string): Promise<void> { if (!isCacheReadEnabled(CACHE_NAME)) return if (projectDotGradleDirExists(rootDir)) { core.debug( core.info( 'Project .gradle directory already exists. Not restoring from cache.' ) return Loading @@ -46,8 +39,6 @@ export async function restore(rootDir: string): Promise<void> { } export async function save(rootDir: string): Promise<void> { if (!isCacheSaveEnabled(CACHE_NAME)) return if (!projectDotGradleDirExists(rootDir)) { core.debug('No project .gradle dir to cache.') return Loading
src/caches.ts +13 −8 Changes for src/caches.ts: 13 added lines, 8 removed lines. Original line number Diff line number Diff line import * as cacheGradleUserHome from './cache-gradle-user-home' import * as cacheProjectDotGradle from './cache-project-dot-gradle' import * as core from '@actions/core' import {isCacheReadEnabled, isCacheSaveEnabled} from './cache-utils' const BUILD_ROOT_DIR = 'BUILD_ROOT_DIR' export async function restore(buildRootDirectory: string): Promise<void> { core.startGroup('Restore Gradle User Home from cache') await cacheGradleUserHome.restore() core.endGroup() if (!isCacheReadEnabled('gradle')) { core.debug('Cache read disabled') return } core.startGroup('Restore project .gradle directory from cache') core.startGroup('Restore Gradle state from cache') await cacheGradleUserHome.restore() core.saveState(BUILD_ROOT_DIR, buildRootDirectory) await cacheProjectDotGradle.restore(buildRootDirectory) core.endGroup() } export async function save(): Promise<void> { core.startGroup('Cache Gradle User Home') await cacheGradleUserHome.save() core.endGroup() if (!isCacheSaveEnabled('gradle')) { core.debug('Cache save disabled') return } core.startGroup('Cache project .gradle directory') core.startGroup('Caching Gradle state') await cacheGradleUserHome.save() const buildRootDirectory = core.getState(BUILD_ROOT_DIR) await cacheProjectDotGradle.save(buildRootDirectory) core.endGroup() Loading