mirror of
https://github.com/gradle/actions
synced 2024-11-23 18:02:13 +00:00
[bot] Update dist directory
Some checks are pending
CI-check-and-unit-test / check-format-and-unit-test (push) Waiting to run
CI-codeql / Analyze (javascript-typescript) (push) Waiting to run
CI-init-script-check / test-init-scripts (push) Waiting to run
CI-integ-test / determine-suite (push) Waiting to run
CI-integ-test / build-distribution (push) Blocked by required conditions
CI-integ-test / action-inputs (push) Blocked by required conditions
CI-integ-test / build-scan-publish (push) Blocked by required conditions
CI-integ-test / cache-cleanup (push) Blocked by required conditions
CI-integ-test / caching-config (push) Blocked by required conditions
CI-integ-test / dependency-graph (push) Blocked by required conditions
CI-integ-test / dependency-submission (push) Blocked by required conditions
CI-integ-test / dependency-submission-failures (push) Blocked by required conditions
CI-integ-test / execution-with-caching (push) Blocked by required conditions
CI-integ-test / execution (push) Blocked by required conditions
CI-integ-test / develocity-injection (push) Blocked by required conditions
CI-integ-test / provision-gradle-versions (push) Blocked by required conditions
CI-integ-test / restore-configuration-cache (push) Blocked by required conditions
CI-integ-test / restore-containerized-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-custom-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-java-toolchain (push) Blocked by required conditions
CI-integ-test / sample-kotlin-dsl (push) Blocked by required conditions
CI-integ-test / sample-gradle-plugin (push) Blocked by required conditions
CI-integ-test / toolchain-detection (push) Blocked by required conditions
CI-integ-test / wrapper-validation (push) Blocked by required conditions
CI-update-dist / update-dist (push) Waiting to run
Some checks are pending
CI-check-and-unit-test / check-format-and-unit-test (push) Waiting to run
CI-codeql / Analyze (javascript-typescript) (push) Waiting to run
CI-init-script-check / test-init-scripts (push) Waiting to run
CI-integ-test / determine-suite (push) Waiting to run
CI-integ-test / build-distribution (push) Blocked by required conditions
CI-integ-test / action-inputs (push) Blocked by required conditions
CI-integ-test / build-scan-publish (push) Blocked by required conditions
CI-integ-test / cache-cleanup (push) Blocked by required conditions
CI-integ-test / caching-config (push) Blocked by required conditions
CI-integ-test / dependency-graph (push) Blocked by required conditions
CI-integ-test / dependency-submission (push) Blocked by required conditions
CI-integ-test / dependency-submission-failures (push) Blocked by required conditions
CI-integ-test / execution-with-caching (push) Blocked by required conditions
CI-integ-test / execution (push) Blocked by required conditions
CI-integ-test / develocity-injection (push) Blocked by required conditions
CI-integ-test / provision-gradle-versions (push) Blocked by required conditions
CI-integ-test / restore-configuration-cache (push) Blocked by required conditions
CI-integ-test / restore-containerized-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-custom-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-java-toolchain (push) Blocked by required conditions
CI-integ-test / sample-kotlin-dsl (push) Blocked by required conditions
CI-integ-test / sample-gradle-plugin (push) Blocked by required conditions
CI-integ-test / toolchain-detection (push) Blocked by required conditions
CI-integ-test / wrapper-validation (push) Blocked by required conditions
CI-update-dist / update-dist (push) Waiting to run
This commit is contained in:
parent
723ca4de01
commit
b7e399239c
10 changed files with 822 additions and 424 deletions
293
dist/dependency-submission/main/index.js
vendored
293
dist/dependency-submission/main/index.js
vendored
|
@ -142896,6 +142896,81 @@ utils.walkdir = function(dirpath, base, callback) {
|
|||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 93287:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const setupGradle = __importStar(__nccwpck_require__(18652));
|
||||
const gradle = __importStar(__nccwpck_require__(94475));
|
||||
const dependencyGraph = __importStar(__nccwpck_require__(80));
|
||||
const string_argv_1 = __nccwpck_require__(19663);
|
||||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
const errors_1 = __nccwpck_require__(36976);
|
||||
async function run() {
|
||||
try {
|
||||
(0, configuration_1.setActionId)('gradle/actions/dependency-submission');
|
||||
await setupGradle.setup(new configuration_1.CacheConfig(), new configuration_1.BuildScanConfig());
|
||||
const originallyEnabled = process.env['GITHUB_DEPENDENCY_GRAPH_ENABLED'];
|
||||
const config = new configuration_1.DependencyGraphConfig();
|
||||
await dependencyGraph.setup(config);
|
||||
if (config.getDependencyGraphOption() === configuration_1.DependencyGraphOption.DownloadAndSubmit) {
|
||||
return;
|
||||
}
|
||||
const executionConfig = new configuration_1.GradleExecutionConfig();
|
||||
const taskList = executionConfig.getDependencyResolutionTask();
|
||||
const additionalArgs = executionConfig.getAdditionalArguments();
|
||||
const executionArgs = `
|
||||
-Dorg.gradle.configureondemand=false
|
||||
-Dorg.gradle.dependency.verification=off
|
||||
-Dorg.gradle.unsafe.isolated-projects=false
|
||||
${taskList}
|
||||
${additionalArgs}
|
||||
`;
|
||||
const args = (0, string_argv_1.parseArgsStringToArgv)(executionArgs);
|
||||
await gradle.provisionAndMaybeExecute(executionConfig.getGradleVersion(), executionConfig.getBuildRootDirectory(), args);
|
||||
await dependencyGraph.complete(config);
|
||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', originallyEnabled);
|
||||
(0, deprecation_collector_1.saveDeprecationState)();
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handleMainActionError)(error);
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 82107:
|
||||
|
@ -142927,14 +143002,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.markBuildResultsProcessed = exports.loadBuildResults = void 0;
|
||||
exports.markBuildResultsProcessed = exports.loadBuildResults = exports.BuildResults = void 0;
|
||||
const fs = __importStar(__nccwpck_require__(57147));
|
||||
const path = __importStar(__nccwpck_require__(71017));
|
||||
class BuildResults {
|
||||
constructor(results) {
|
||||
this.results = results;
|
||||
}
|
||||
anyFailed() {
|
||||
return this.results.some(result => result.buildFailed);
|
||||
}
|
||||
uniqueGradleHomes() {
|
||||
const allHomes = this.results.map(buildResult => buildResult.gradleHomeDir);
|
||||
return Array.from(new Set(allHomes));
|
||||
}
|
||||
}
|
||||
exports.BuildResults = BuildResults;
|
||||
function loadBuildResults() {
|
||||
return getUnprocessedResults().map(filePath => {
|
||||
const results = getUnprocessedResults().map(filePath => {
|
||||
const content = fs.readFileSync(filePath, 'utf8');
|
||||
return JSON.parse(content);
|
||||
});
|
||||
return new BuildResults(results);
|
||||
}
|
||||
exports.loadBuildResults = loadBuildResults;
|
||||
function markBuildResultsProcessed() {
|
||||
|
@ -143173,15 +143262,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.generateCachingReport = exports.CacheEntryListener = exports.CacheListener = void 0;
|
||||
exports.generateCachingReport = exports.CacheEntryListener = exports.CacheListener = exports.CLEANUP_DISABLED_DUE_TO_FAILURE = exports.DEFAULT_CLEANUP_ENABLED_REASON = exports.DEFAULT_CLEANUP_DISABLED_REASON = exports.CLEANUP_DISABLED_READONLY = exports.EXISTING_GRADLE_HOME = exports.DEFAULT_WRITEONLY_REASON = exports.DEFAULT_DISABLED_REASON = exports.DEFAULT_READONLY_REASON = exports.DEFAULT_CACHE_ENABLED_REASON = void 0;
|
||||
const cache = __importStar(__nccwpck_require__(27799));
|
||||
exports.DEFAULT_CACHE_ENABLED_REASON = `[Cache was enabled](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#caching-build-state-between-jobs). Action attempted to both restore and save the Gradle User Home.`;
|
||||
exports.DEFAULT_READONLY_REASON = `[Cache was read-only](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#using-the-cache-read-only). By default, the action will only write to the cache for Jobs running on the default branch.`;
|
||||
exports.DEFAULT_DISABLED_REASON = `[Cache was disabled](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#disabling-caching) via action confiugration. Gradle User Home was not restored from or saved to the cache.`;
|
||||
exports.DEFAULT_WRITEONLY_REASON = `[Cache was set to write-only](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#using-the-cache-write-only) via action configuration. Gradle User Home was not restored from cache.`;
|
||||
exports.EXISTING_GRADLE_HOME = `[Cache was disabled to avoid overwriting a pre-existing Gradle User Home](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#overwriting-an-existing-gradle-user-home). Gradle User Home was not restored from or saved to the cache.`;
|
||||
exports.CLEANUP_DISABLED_READONLY = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) is always disabled when cache is read-only or disabled.`;
|
||||
exports.DEFAULT_CLEANUP_DISABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was not enabled. It must be explicitly enabled.`;
|
||||
exports.DEFAULT_CLEANUP_ENABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was enabled.`;
|
||||
exports.CLEANUP_DISABLED_DUE_TO_FAILURE = '[Cache cleanup was disabled due to build failure](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup). Use `cache-cleanup: always` to override this behavior.';
|
||||
class CacheListener {
|
||||
constructor() {
|
||||
this.cacheEntries = [];
|
||||
this.cacheReadOnly = false;
|
||||
this.cacheWriteOnly = false;
|
||||
this.cacheDisabled = false;
|
||||
this.cacheDisabledReason = 'disabled';
|
||||
this.cacheStatusReason = exports.DEFAULT_CACHE_ENABLED_REASON;
|
||||
this.cacheCleanupMessage = exports.DEFAULT_CLEANUP_DISABLED_REASON;
|
||||
}
|
||||
get fullyRestored() {
|
||||
return this.cacheEntries.every(x => !x.wasRequestedButNotRestored());
|
||||
|
@ -143190,13 +143289,33 @@ class CacheListener {
|
|||
if (!cache.isFeatureAvailable())
|
||||
return 'not available';
|
||||
if (this.cacheDisabled)
|
||||
return this.cacheDisabledReason;
|
||||
return 'disabled';
|
||||
if (this.cacheWriteOnly)
|
||||
return 'write-only';
|
||||
if (this.cacheReadOnly)
|
||||
return 'read-only';
|
||||
return 'enabled';
|
||||
}
|
||||
setReadOnly(reason = exports.DEFAULT_READONLY_REASON) {
|
||||
this.cacheReadOnly = true;
|
||||
this.cacheStatusReason = reason;
|
||||
this.cacheCleanupMessage = exports.CLEANUP_DISABLED_READONLY;
|
||||
}
|
||||
setDisabled(reason = exports.DEFAULT_DISABLED_REASON) {
|
||||
this.cacheDisabled = true;
|
||||
this.cacheStatusReason = reason;
|
||||
this.cacheCleanupMessage = exports.CLEANUP_DISABLED_READONLY;
|
||||
}
|
||||
setWriteOnly(reason = exports.DEFAULT_WRITEONLY_REASON) {
|
||||
this.cacheWriteOnly = true;
|
||||
this.cacheStatusReason = reason;
|
||||
}
|
||||
setCacheCleanupEnabled() {
|
||||
this.cacheCleanupMessage = exports.DEFAULT_CLEANUP_ENABLED_REASON;
|
||||
}
|
||||
setCacheCleanupDisabled(reason = exports.DEFAULT_CLEANUP_DISABLED_REASON) {
|
||||
this.cacheCleanupMessage = reason;
|
||||
}
|
||||
entry(name) {
|
||||
for (const entry of this.cacheEntries) {
|
||||
if (entry.entryName === name) {
|
||||
|
@ -143266,6 +143385,10 @@ function generateCachingReport(listener) {
|
|||
return `
|
||||
<details>
|
||||
<summary><h4>Caching for Gradle actions was ${listener.cacheStatus} - expand for details</h4></summary>
|
||||
|
||||
- ${listener.cacheStatusReason}
|
||||
- ${listener.cacheCleanupMessage}
|
||||
|
||||
${renderEntryTable(entries)}
|
||||
|
||||
<h5>Cache Entry Details</h5>
|
||||
|
@ -143546,6 +143669,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.save = exports.restore = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const cache_reporting_1 = __nccwpck_require__(7391);
|
||||
const gradle_user_home_cache_1 = __nccwpck_require__(27655);
|
||||
const cache_cleaner_1 = __nccwpck_require__(50651);
|
||||
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
||||
|
@ -143559,15 +143683,14 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
if (cacheConfig.isCacheDisabled()) {
|
||||
core.info('Cache is disabled: will not restore state from previous builds.');
|
||||
gradleStateCache.init();
|
||||
cacheListener.cacheDisabled = true;
|
||||
cacheListener.setDisabled();
|
||||
return;
|
||||
}
|
||||
if (gradleStateCache.cacheOutputExists()) {
|
||||
if (!cacheConfig.isCacheOverwriteExisting()) {
|
||||
core.info('Gradle User Home already exists: will not restore from cache.');
|
||||
gradleStateCache.init();
|
||||
cacheListener.cacheDisabled = true;
|
||||
cacheListener.cacheDisabledReason = 'disabled due to pre-existing Gradle User Home';
|
||||
cacheListener.setDisabled(cache_reporting_1.EXISTING_GRADLE_HOME);
|
||||
return;
|
||||
}
|
||||
core.info('Gradle User Home already exists: will overwrite with cached contents.');
|
||||
|
@ -143576,7 +143699,7 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
core.saveState(CACHE_RESTORED_VAR, true);
|
||||
if (cacheConfig.isCacheWriteOnly()) {
|
||||
core.info('Cache is write-only: will not restore from cache.');
|
||||
cacheListener.cacheWriteOnly = true;
|
||||
cacheListener.setWriteOnly();
|
||||
return;
|
||||
}
|
||||
await core.group('Restore Gradle state from cache', async () => {
|
||||
|
@ -143589,7 +143712,7 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
}
|
||||
}
|
||||
exports.restore = restore;
|
||||
async function save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig) {
|
||||
async function save(userHome, gradleUserHome, cacheListener, daemonController, buildResults, cacheConfig) {
|
||||
if (cacheConfig.isCacheDisabled()) {
|
||||
core.info('Cache is disabled: will not save state for later builds.');
|
||||
return;
|
||||
|
@ -143600,18 +143723,18 @@ async function save(userHome, gradleUserHome, cacheListener, daemonController, c
|
|||
}
|
||||
if (cacheConfig.isCacheReadOnly()) {
|
||||
core.info('Cache is read-only: will not save state for use in subsequent builds.');
|
||||
cacheListener.cacheReadOnly = true;
|
||||
cacheListener.setReadOnly();
|
||||
return;
|
||||
}
|
||||
await daemonController.stopAllDaemons();
|
||||
if (cacheConfig.isCacheCleanupEnabled()) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
await cacheCleaner.forceCleanup();
|
||||
if (cacheConfig.shouldPerformCacheCleanup(buildResults.anyFailed())) {
|
||||
cacheListener.setCacheCleanupEnabled();
|
||||
await performCacheCleanup(gradleUserHome);
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
else {
|
||||
core.info('Not performing cache-cleanup due to build failure');
|
||||
cacheListener.setCacheCleanupDisabled(cache_reporting_1.CLEANUP_DISABLED_DUE_TO_FAILURE);
|
||||
}
|
||||
}
|
||||
await core.group('Caching Gradle state', async () => {
|
||||
|
@ -143619,6 +143742,16 @@ async function save(userHome, gradleUserHome, cacheListener, daemonController, c
|
|||
});
|
||||
}
|
||||
exports.save = save;
|
||||
async function performCacheCleanup(gradleUserHome) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
await cacheCleaner.forceCleanup();
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
@ -143913,7 +144046,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
|||
});
|
||||
}
|
||||
getConfigCacheDirectoriesWithAssociatedBuildResults() {
|
||||
return (0, build_results_1.loadBuildResults)().reduce((acc, buildResult) => {
|
||||
return (0, build_results_1.loadBuildResults)().results.reduce((acc, buildResult) => {
|
||||
const configCachePath = path_1.default.resolve(buildResult.rootProjectDir, '.gradle/configuration-cache');
|
||||
if (!fs_1.default.existsSync(configCachePath)) {
|
||||
return acc;
|
||||
|
@ -144263,7 +144396,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheCleanupOption = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const github = __importStar(__nccwpck_require__(95438));
|
||||
const cache = __importStar(__nccwpck_require__(27799));
|
||||
|
@ -144357,7 +144490,35 @@ class CacheConfig {
|
|||
return getBooleanInput('gradle-home-cache-strict-match');
|
||||
}
|
||||
isCacheCleanupEnabled() {
|
||||
return getBooleanInput('gradle-home-cache-cleanup') && !this.isCacheReadOnly();
|
||||
if (this.isCacheReadOnly()) {
|
||||
return false;
|
||||
}
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
return cleanupOption === CacheCleanupOption.Always || cleanupOption === CacheCleanupOption.OnSuccess;
|
||||
}
|
||||
shouldPerformCacheCleanup(hasFailure) {
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
if (cleanupOption === CacheCleanupOption.Always) {
|
||||
return true;
|
||||
}
|
||||
if (cleanupOption === CacheCleanupOption.OnSuccess) {
|
||||
return !hasFailure;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
getCacheCleanupOption() {
|
||||
const val = core.getInput('cache-cleanup');
|
||||
switch (val.toLowerCase().trim()) {
|
||||
case 'always':
|
||||
return CacheCleanupOption.Always;
|
||||
case 'on-success':
|
||||
return CacheCleanupOption.OnSuccess;
|
||||
case 'never':
|
||||
return getBooleanInput('gradle-home-cache-cleanup')
|
||||
? CacheCleanupOption.Always
|
||||
: CacheCleanupOption.Never;
|
||||
}
|
||||
throw TypeError(`The value '${val}' is not valid for cache-cleanup. Valid values are: [never, always, on-success].`);
|
||||
}
|
||||
getCacheEncryptionKey() {
|
||||
return core.getInput('cache-encryption-key');
|
||||
|
@ -144370,6 +144531,12 @@ class CacheConfig {
|
|||
}
|
||||
}
|
||||
exports.CacheConfig = CacheConfig;
|
||||
var CacheCleanupOption;
|
||||
(function (CacheCleanupOption) {
|
||||
CacheCleanupOption["Never"] = "never";
|
||||
CacheCleanupOption["OnSuccess"] = "on-success";
|
||||
CacheCleanupOption["Always"] = "always";
|
||||
})(CacheCleanupOption || (exports.CacheCleanupOption = CacheCleanupOption = {}));
|
||||
class SummaryConfig {
|
||||
shouldGenerateJobSummary(hasFailure) {
|
||||
if (!process.env[summary_1.SUMMARY_ENV_VAR]) {
|
||||
|
@ -144617,8 +144784,7 @@ const fs = __importStar(__nccwpck_require__(57147));
|
|||
const path = __importStar(__nccwpck_require__(71017));
|
||||
class DaemonController {
|
||||
constructor(buildResults) {
|
||||
const allHomes = buildResults.map(buildResult => buildResult.gradleHomeDir);
|
||||
this.gradleHomes = Array.from(new Set(allHomes));
|
||||
this.gradleHomes = buildResults.uniqueGradleHomes();
|
||||
}
|
||||
async stopAllDaemons() {
|
||||
core.info('Stopping all Gradle daemons before saving Gradle User Home state');
|
||||
|
@ -144910,81 +145076,6 @@ function isRunningInActEnvironment() {
|
|||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 15575:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const setupGradle = __importStar(__nccwpck_require__(18652));
|
||||
const gradle = __importStar(__nccwpck_require__(94475));
|
||||
const dependencyGraph = __importStar(__nccwpck_require__(80));
|
||||
const string_argv_1 = __nccwpck_require__(19663);
|
||||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
const errors_1 = __nccwpck_require__(36976);
|
||||
async function run() {
|
||||
try {
|
||||
(0, configuration_1.setActionId)('gradle/actions/dependency-submission');
|
||||
await setupGradle.setup(new configuration_1.CacheConfig(), new configuration_1.BuildScanConfig());
|
||||
const originallyEnabled = process.env['GITHUB_DEPENDENCY_GRAPH_ENABLED'];
|
||||
const config = new configuration_1.DependencyGraphConfig();
|
||||
await dependencyGraph.setup(config);
|
||||
if (config.getDependencyGraphOption() === configuration_1.DependencyGraphOption.DownloadAndSubmit) {
|
||||
return;
|
||||
}
|
||||
const executionConfig = new configuration_1.GradleExecutionConfig();
|
||||
const taskList = executionConfig.getDependencyResolutionTask();
|
||||
const additionalArgs = executionConfig.getAdditionalArguments();
|
||||
const executionArgs = `
|
||||
-Dorg.gradle.configureondemand=false
|
||||
-Dorg.gradle.dependency.verification=off
|
||||
-Dorg.gradle.unsafe.isolated-projects=false
|
||||
${taskList}
|
||||
${additionalArgs}
|
||||
`;
|
||||
const args = (0, string_argv_1.parseArgsStringToArgv)(executionArgs);
|
||||
await gradle.provisionAndMaybeExecute(executionConfig.getGradleVersion(), executionConfig.getBuildRootDirectory(), args);
|
||||
await dependencyGraph.complete(config);
|
||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', originallyEnabled);
|
||||
(0, deprecation_collector_1.saveDeprecationState)();
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handleMainActionError)(error);
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 22572:
|
||||
|
@ -145739,8 +145830,8 @@ const request_error_1 = __nccwpck_require__(10537);
|
|||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
async function generateJobSummary(buildResults, cachingReport, config) {
|
||||
const summaryTable = renderSummaryTable(buildResults);
|
||||
const hasFailure = buildResults.some(result => result.buildFailed);
|
||||
const summaryTable = renderSummaryTable(buildResults.results);
|
||||
const hasFailure = buildResults.anyFailed();
|
||||
if (config.shouldGenerateJobSummary(hasFailure)) {
|
||||
core.info('Generating Job Summary');
|
||||
core.summary.addRaw(summaryTable);
|
||||
|
@ -145972,7 +146063,7 @@ async function complete(cacheConfig, summaryConfig) {
|
|||
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
||||
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
|
||||
const daemonController = new daemon_controller_1.DaemonController(buildResults);
|
||||
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig);
|
||||
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, buildResults, cacheConfig);
|
||||
const cachingReport = (0, cache_reporting_1.generateCachingReport)(cacheListener);
|
||||
await jobSummary.generateJobSummary(buildResults, cachingReport, summaryConfig);
|
||||
(0, build_results_1.markBuildResultsProcessed)();
|
||||
|
@ -146729,7 +146820,7 @@ module.exports = JSON.parse('[{"version":"8.9","checksum":"498495120a03b9a6ab5d1
|
|||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(15575);
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(93287);
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
||||
/******/ })()
|
||||
|
|
2
dist/dependency-submission/main/index.js.map
vendored
2
dist/dependency-submission/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
247
dist/dependency-submission/post/index.js
vendored
247
dist/dependency-submission/post/index.js
vendored
|
@ -93720,7 +93720,7 @@ function wrappy (fn, cb) {
|
|||
|
||||
NodeType = __nccwpck_require__(9267);
|
||||
|
||||
XMLStringifier = __nccwpck_require__(6086);
|
||||
XMLStringifier = __nccwpck_require__(8594);
|
||||
|
||||
XMLStringWriter = __nccwpck_require__(5913);
|
||||
|
||||
|
@ -93990,7 +93990,7 @@ function wrappy (fn, cb) {
|
|||
|
||||
XMLAttribute = __nccwpck_require__(8376);
|
||||
|
||||
XMLStringifier = __nccwpck_require__(6086);
|
||||
XMLStringifier = __nccwpck_require__(8594);
|
||||
|
||||
XMLStringWriter = __nccwpck_require__(5913);
|
||||
|
||||
|
@ -96043,7 +96043,7 @@ function wrappy (fn, cb) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6086:
|
||||
/***/ 8594:
|
||||
/***/ (function(module) {
|
||||
|
||||
// Generated by CoffeeScript 1.12.7
|
||||
|
@ -96871,6 +96871,55 @@ function wrappy (fn, cb) {
|
|||
}).call(this);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 436:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const setupGradle = __importStar(__nccwpck_require__(8652));
|
||||
const configuration_1 = __nccwpck_require__(5778);
|
||||
const errors_1 = __nccwpck_require__(6976);
|
||||
process.on('uncaughtException', e => (0, errors_1.handlePostActionError)(e));
|
||||
async function run() {
|
||||
try {
|
||||
await setupGradle.complete(new configuration_1.CacheConfig(), new configuration_1.SummaryConfig());
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handlePostActionError)(error);
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2107:
|
||||
|
@ -96902,14 +96951,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.markBuildResultsProcessed = exports.loadBuildResults = void 0;
|
||||
exports.markBuildResultsProcessed = exports.loadBuildResults = exports.BuildResults = void 0;
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
class BuildResults {
|
||||
constructor(results) {
|
||||
this.results = results;
|
||||
}
|
||||
anyFailed() {
|
||||
return this.results.some(result => result.buildFailed);
|
||||
}
|
||||
uniqueGradleHomes() {
|
||||
const allHomes = this.results.map(buildResult => buildResult.gradleHomeDir);
|
||||
return Array.from(new Set(allHomes));
|
||||
}
|
||||
}
|
||||
exports.BuildResults = BuildResults;
|
||||
function loadBuildResults() {
|
||||
return getUnprocessedResults().map(filePath => {
|
||||
const results = getUnprocessedResults().map(filePath => {
|
||||
const content = fs.readFileSync(filePath, 'utf8');
|
||||
return JSON.parse(content);
|
||||
});
|
||||
return new BuildResults(results);
|
||||
}
|
||||
exports.loadBuildResults = loadBuildResults;
|
||||
function markBuildResultsProcessed() {
|
||||
|
@ -97148,15 +97211,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.generateCachingReport = exports.CacheEntryListener = exports.CacheListener = void 0;
|
||||
exports.generateCachingReport = exports.CacheEntryListener = exports.CacheListener = exports.CLEANUP_DISABLED_DUE_TO_FAILURE = exports.DEFAULT_CLEANUP_ENABLED_REASON = exports.DEFAULT_CLEANUP_DISABLED_REASON = exports.CLEANUP_DISABLED_READONLY = exports.EXISTING_GRADLE_HOME = exports.DEFAULT_WRITEONLY_REASON = exports.DEFAULT_DISABLED_REASON = exports.DEFAULT_READONLY_REASON = exports.DEFAULT_CACHE_ENABLED_REASON = void 0;
|
||||
const cache = __importStar(__nccwpck_require__(7799));
|
||||
exports.DEFAULT_CACHE_ENABLED_REASON = `[Cache was enabled](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#caching-build-state-between-jobs). Action attempted to both restore and save the Gradle User Home.`;
|
||||
exports.DEFAULT_READONLY_REASON = `[Cache was read-only](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#using-the-cache-read-only). By default, the action will only write to the cache for Jobs running on the default branch.`;
|
||||
exports.DEFAULT_DISABLED_REASON = `[Cache was disabled](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#disabling-caching) via action confiugration. Gradle User Home was not restored from or saved to the cache.`;
|
||||
exports.DEFAULT_WRITEONLY_REASON = `[Cache was set to write-only](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#using-the-cache-write-only) via action configuration. Gradle User Home was not restored from cache.`;
|
||||
exports.EXISTING_GRADLE_HOME = `[Cache was disabled to avoid overwriting a pre-existing Gradle User Home](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#overwriting-an-existing-gradle-user-home). Gradle User Home was not restored from or saved to the cache.`;
|
||||
exports.CLEANUP_DISABLED_READONLY = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) is always disabled when cache is read-only or disabled.`;
|
||||
exports.DEFAULT_CLEANUP_DISABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was not enabled. It must be explicitly enabled.`;
|
||||
exports.DEFAULT_CLEANUP_ENABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was enabled.`;
|
||||
exports.CLEANUP_DISABLED_DUE_TO_FAILURE = '[Cache cleanup was disabled due to build failure](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup). Use `cache-cleanup: always` to override this behavior.';
|
||||
class CacheListener {
|
||||
constructor() {
|
||||
this.cacheEntries = [];
|
||||
this.cacheReadOnly = false;
|
||||
this.cacheWriteOnly = false;
|
||||
this.cacheDisabled = false;
|
||||
this.cacheDisabledReason = 'disabled';
|
||||
this.cacheStatusReason = exports.DEFAULT_CACHE_ENABLED_REASON;
|
||||
this.cacheCleanupMessage = exports.DEFAULT_CLEANUP_DISABLED_REASON;
|
||||
}
|
||||
get fullyRestored() {
|
||||
return this.cacheEntries.every(x => !x.wasRequestedButNotRestored());
|
||||
|
@ -97165,13 +97238,33 @@ class CacheListener {
|
|||
if (!cache.isFeatureAvailable())
|
||||
return 'not available';
|
||||
if (this.cacheDisabled)
|
||||
return this.cacheDisabledReason;
|
||||
return 'disabled';
|
||||
if (this.cacheWriteOnly)
|
||||
return 'write-only';
|
||||
if (this.cacheReadOnly)
|
||||
return 'read-only';
|
||||
return 'enabled';
|
||||
}
|
||||
setReadOnly(reason = exports.DEFAULT_READONLY_REASON) {
|
||||
this.cacheReadOnly = true;
|
||||
this.cacheStatusReason = reason;
|
||||
this.cacheCleanupMessage = exports.CLEANUP_DISABLED_READONLY;
|
||||
}
|
||||
setDisabled(reason = exports.DEFAULT_DISABLED_REASON) {
|
||||
this.cacheDisabled = true;
|
||||
this.cacheStatusReason = reason;
|
||||
this.cacheCleanupMessage = exports.CLEANUP_DISABLED_READONLY;
|
||||
}
|
||||
setWriteOnly(reason = exports.DEFAULT_WRITEONLY_REASON) {
|
||||
this.cacheWriteOnly = true;
|
||||
this.cacheStatusReason = reason;
|
||||
}
|
||||
setCacheCleanupEnabled() {
|
||||
this.cacheCleanupMessage = exports.DEFAULT_CLEANUP_ENABLED_REASON;
|
||||
}
|
||||
setCacheCleanupDisabled(reason = exports.DEFAULT_CLEANUP_DISABLED_REASON) {
|
||||
this.cacheCleanupMessage = reason;
|
||||
}
|
||||
entry(name) {
|
||||
for (const entry of this.cacheEntries) {
|
||||
if (entry.entryName === name) {
|
||||
|
@ -97241,6 +97334,10 @@ function generateCachingReport(listener) {
|
|||
return `
|
||||
<details>
|
||||
<summary><h4>Caching for Gradle actions was ${listener.cacheStatus} - expand for details</h4></summary>
|
||||
|
||||
- ${listener.cacheStatusReason}
|
||||
- ${listener.cacheCleanupMessage}
|
||||
|
||||
${renderEntryTable(entries)}
|
||||
|
||||
<h5>Cache Entry Details</h5>
|
||||
|
@ -97521,6 +97618,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.save = exports.restore = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const cache_reporting_1 = __nccwpck_require__(7391);
|
||||
const gradle_user_home_cache_1 = __nccwpck_require__(7655);
|
||||
const cache_cleaner_1 = __nccwpck_require__(651);
|
||||
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
||||
|
@ -97534,15 +97632,14 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
if (cacheConfig.isCacheDisabled()) {
|
||||
core.info('Cache is disabled: will not restore state from previous builds.');
|
||||
gradleStateCache.init();
|
||||
cacheListener.cacheDisabled = true;
|
||||
cacheListener.setDisabled();
|
||||
return;
|
||||
}
|
||||
if (gradleStateCache.cacheOutputExists()) {
|
||||
if (!cacheConfig.isCacheOverwriteExisting()) {
|
||||
core.info('Gradle User Home already exists: will not restore from cache.');
|
||||
gradleStateCache.init();
|
||||
cacheListener.cacheDisabled = true;
|
||||
cacheListener.cacheDisabledReason = 'disabled due to pre-existing Gradle User Home';
|
||||
cacheListener.setDisabled(cache_reporting_1.EXISTING_GRADLE_HOME);
|
||||
return;
|
||||
}
|
||||
core.info('Gradle User Home already exists: will overwrite with cached contents.');
|
||||
|
@ -97551,7 +97648,7 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
core.saveState(CACHE_RESTORED_VAR, true);
|
||||
if (cacheConfig.isCacheWriteOnly()) {
|
||||
core.info('Cache is write-only: will not restore from cache.');
|
||||
cacheListener.cacheWriteOnly = true;
|
||||
cacheListener.setWriteOnly();
|
||||
return;
|
||||
}
|
||||
await core.group('Restore Gradle state from cache', async () => {
|
||||
|
@ -97564,7 +97661,7 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
}
|
||||
}
|
||||
exports.restore = restore;
|
||||
async function save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig) {
|
||||
async function save(userHome, gradleUserHome, cacheListener, daemonController, buildResults, cacheConfig) {
|
||||
if (cacheConfig.isCacheDisabled()) {
|
||||
core.info('Cache is disabled: will not save state for later builds.');
|
||||
return;
|
||||
|
@ -97575,18 +97672,18 @@ async function save(userHome, gradleUserHome, cacheListener, daemonController, c
|
|||
}
|
||||
if (cacheConfig.isCacheReadOnly()) {
|
||||
core.info('Cache is read-only: will not save state for use in subsequent builds.');
|
||||
cacheListener.cacheReadOnly = true;
|
||||
cacheListener.setReadOnly();
|
||||
return;
|
||||
}
|
||||
await daemonController.stopAllDaemons();
|
||||
if (cacheConfig.isCacheCleanupEnabled()) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
await cacheCleaner.forceCleanup();
|
||||
if (cacheConfig.shouldPerformCacheCleanup(buildResults.anyFailed())) {
|
||||
cacheListener.setCacheCleanupEnabled();
|
||||
await performCacheCleanup(gradleUserHome);
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
else {
|
||||
core.info('Not performing cache-cleanup due to build failure');
|
||||
cacheListener.setCacheCleanupDisabled(cache_reporting_1.CLEANUP_DISABLED_DUE_TO_FAILURE);
|
||||
}
|
||||
}
|
||||
await core.group('Caching Gradle state', async () => {
|
||||
|
@ -97594,6 +97691,16 @@ async function save(userHome, gradleUserHome, cacheListener, daemonController, c
|
|||
});
|
||||
}
|
||||
exports.save = save;
|
||||
async function performCacheCleanup(gradleUserHome) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
await cacheCleaner.forceCleanup();
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
@ -97888,7 +97995,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
|||
});
|
||||
}
|
||||
getConfigCacheDirectoriesWithAssociatedBuildResults() {
|
||||
return (0, build_results_1.loadBuildResults)().reduce((acc, buildResult) => {
|
||||
return (0, build_results_1.loadBuildResults)().results.reduce((acc, buildResult) => {
|
||||
const configCachePath = path_1.default.resolve(buildResult.rootProjectDir, '.gradle/configuration-cache');
|
||||
if (!fs_1.default.existsSync(configCachePath)) {
|
||||
return acc;
|
||||
|
@ -98238,7 +98345,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheCleanupOption = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const github = __importStar(__nccwpck_require__(5438));
|
||||
const cache = __importStar(__nccwpck_require__(7799));
|
||||
|
@ -98332,7 +98439,35 @@ class CacheConfig {
|
|||
return getBooleanInput('gradle-home-cache-strict-match');
|
||||
}
|
||||
isCacheCleanupEnabled() {
|
||||
return getBooleanInput('gradle-home-cache-cleanup') && !this.isCacheReadOnly();
|
||||
if (this.isCacheReadOnly()) {
|
||||
return false;
|
||||
}
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
return cleanupOption === CacheCleanupOption.Always || cleanupOption === CacheCleanupOption.OnSuccess;
|
||||
}
|
||||
shouldPerformCacheCleanup(hasFailure) {
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
if (cleanupOption === CacheCleanupOption.Always) {
|
||||
return true;
|
||||
}
|
||||
if (cleanupOption === CacheCleanupOption.OnSuccess) {
|
||||
return !hasFailure;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
getCacheCleanupOption() {
|
||||
const val = core.getInput('cache-cleanup');
|
||||
switch (val.toLowerCase().trim()) {
|
||||
case 'always':
|
||||
return CacheCleanupOption.Always;
|
||||
case 'on-success':
|
||||
return CacheCleanupOption.OnSuccess;
|
||||
case 'never':
|
||||
return getBooleanInput('gradle-home-cache-cleanup')
|
||||
? CacheCleanupOption.Always
|
||||
: CacheCleanupOption.Never;
|
||||
}
|
||||
throw TypeError(`The value '${val}' is not valid for cache-cleanup. Valid values are: [never, always, on-success].`);
|
||||
}
|
||||
getCacheEncryptionKey() {
|
||||
return core.getInput('cache-encryption-key');
|
||||
|
@ -98345,6 +98480,12 @@ class CacheConfig {
|
|||
}
|
||||
}
|
||||
exports.CacheConfig = CacheConfig;
|
||||
var CacheCleanupOption;
|
||||
(function (CacheCleanupOption) {
|
||||
CacheCleanupOption["Never"] = "never";
|
||||
CacheCleanupOption["OnSuccess"] = "on-success";
|
||||
CacheCleanupOption["Always"] = "always";
|
||||
})(CacheCleanupOption || (exports.CacheCleanupOption = CacheCleanupOption = {}));
|
||||
class SummaryConfig {
|
||||
shouldGenerateJobSummary(hasFailure) {
|
||||
if (!process.env[summary_1.SUMMARY_ENV_VAR]) {
|
||||
|
@ -98592,8 +98733,7 @@ const fs = __importStar(__nccwpck_require__(7147));
|
|||
const path = __importStar(__nccwpck_require__(1017));
|
||||
class DaemonController {
|
||||
constructor(buildResults) {
|
||||
const allHomes = buildResults.map(buildResult => buildResult.gradleHomeDir);
|
||||
this.gradleHomes = Array.from(new Set(allHomes));
|
||||
this.gradleHomes = buildResults.uniqueGradleHomes();
|
||||
}
|
||||
async stopAllDaemons() {
|
||||
core.info('Stopping all Gradle daemons before saving Gradle User Home state');
|
||||
|
@ -98616,55 +98756,6 @@ class DaemonController {
|
|||
exports.DaemonController = DaemonController;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8594:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const setupGradle = __importStar(__nccwpck_require__(8652));
|
||||
const configuration_1 = __nccwpck_require__(5778);
|
||||
const errors_1 = __nccwpck_require__(6976);
|
||||
process.on('uncaughtException', e => (0, errors_1.handlePostActionError)(e));
|
||||
async function run() {
|
||||
try {
|
||||
await setupGradle.complete(new configuration_1.CacheConfig(), new configuration_1.SummaryConfig());
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handlePostActionError)(error);
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2572:
|
||||
|
@ -99419,8 +99510,8 @@ const request_error_1 = __nccwpck_require__(537);
|
|||
const configuration_1 = __nccwpck_require__(5778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(2572);
|
||||
async function generateJobSummary(buildResults, cachingReport, config) {
|
||||
const summaryTable = renderSummaryTable(buildResults);
|
||||
const hasFailure = buildResults.some(result => result.buildFailed);
|
||||
const summaryTable = renderSummaryTable(buildResults.results);
|
||||
const hasFailure = buildResults.anyFailed();
|
||||
if (config.shouldGenerateJobSummary(hasFailure)) {
|
||||
core.info('Generating Job Summary');
|
||||
core.summary.addRaw(summaryTable);
|
||||
|
@ -99652,7 +99743,7 @@ async function complete(cacheConfig, summaryConfig) {
|
|||
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
||||
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
|
||||
const daemonController = new daemon_controller_1.DaemonController(buildResults);
|
||||
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig);
|
||||
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, buildResults, cacheConfig);
|
||||
const cachingReport = (0, cache_reporting_1.generateCachingReport)(cacheListener);
|
||||
await jobSummary.generateJobSummary(buildResults, cachingReport, summaryConfig);
|
||||
(0, build_results_1.markBuildResultsProcessed)();
|
||||
|
@ -100385,7 +100476,7 @@ module.exports = JSON.parse('[{"version":"8.9","checksum":"498495120a03b9a6ab5d1
|
|||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(8594);
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(436);
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
||||
/******/ })()
|
||||
|
|
2
dist/dependency-submission/post/index.js.map
vendored
2
dist/dependency-submission/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
271
dist/setup-gradle/main/index.js
vendored
271
dist/setup-gradle/main/index.js
vendored
|
@ -142896,6 +142896,70 @@ utils.walkdir = function(dirpath, base, callback) {
|
|||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 74846:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const setupGradle = __importStar(__nccwpck_require__(18652));
|
||||
const gradle = __importStar(__nccwpck_require__(94475));
|
||||
const dependencyGraph = __importStar(__nccwpck_require__(80));
|
||||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
const errors_1 = __nccwpck_require__(36976);
|
||||
async function run() {
|
||||
try {
|
||||
if ((0, configuration_1.getActionId)() === 'gradle/gradle-build-action') {
|
||||
(0, deprecation_collector_1.recordDeprecation)('The action `gradle/gradle-build-action` has been replaced by `gradle/actions/setup-gradle`');
|
||||
}
|
||||
else {
|
||||
(0, configuration_1.setActionId)('gradle/actions/setup-gradle');
|
||||
}
|
||||
if ((0, configuration_1.doValidateWrappers)()) {
|
||||
await setupGradle.checkNoInvalidWrapperJars();
|
||||
}
|
||||
await setupGradle.setup(new configuration_1.CacheConfig(), new configuration_1.BuildScanConfig());
|
||||
await dependencyGraph.setup(new configuration_1.DependencyGraphConfig());
|
||||
const config = new configuration_1.GradleExecutionConfig();
|
||||
await gradle.provisionAndMaybeExecute(config.getGradleVersion(), config.getBuildRootDirectory(), config.getArguments());
|
||||
(0, deprecation_collector_1.saveDeprecationState)();
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handleMainActionError)(error);
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 82107:
|
||||
|
@ -142927,14 +142991,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.markBuildResultsProcessed = exports.loadBuildResults = void 0;
|
||||
exports.markBuildResultsProcessed = exports.loadBuildResults = exports.BuildResults = void 0;
|
||||
const fs = __importStar(__nccwpck_require__(57147));
|
||||
const path = __importStar(__nccwpck_require__(71017));
|
||||
class BuildResults {
|
||||
constructor(results) {
|
||||
this.results = results;
|
||||
}
|
||||
anyFailed() {
|
||||
return this.results.some(result => result.buildFailed);
|
||||
}
|
||||
uniqueGradleHomes() {
|
||||
const allHomes = this.results.map(buildResult => buildResult.gradleHomeDir);
|
||||
return Array.from(new Set(allHomes));
|
||||
}
|
||||
}
|
||||
exports.BuildResults = BuildResults;
|
||||
function loadBuildResults() {
|
||||
return getUnprocessedResults().map(filePath => {
|
||||
const results = getUnprocessedResults().map(filePath => {
|
||||
const content = fs.readFileSync(filePath, 'utf8');
|
||||
return JSON.parse(content);
|
||||
});
|
||||
return new BuildResults(results);
|
||||
}
|
||||
exports.loadBuildResults = loadBuildResults;
|
||||
function markBuildResultsProcessed() {
|
||||
|
@ -143173,15 +143251,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.generateCachingReport = exports.CacheEntryListener = exports.CacheListener = void 0;
|
||||
exports.generateCachingReport = exports.CacheEntryListener = exports.CacheListener = exports.CLEANUP_DISABLED_DUE_TO_FAILURE = exports.DEFAULT_CLEANUP_ENABLED_REASON = exports.DEFAULT_CLEANUP_DISABLED_REASON = exports.CLEANUP_DISABLED_READONLY = exports.EXISTING_GRADLE_HOME = exports.DEFAULT_WRITEONLY_REASON = exports.DEFAULT_DISABLED_REASON = exports.DEFAULT_READONLY_REASON = exports.DEFAULT_CACHE_ENABLED_REASON = void 0;
|
||||
const cache = __importStar(__nccwpck_require__(27799));
|
||||
exports.DEFAULT_CACHE_ENABLED_REASON = `[Cache was enabled](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#caching-build-state-between-jobs). Action attempted to both restore and save the Gradle User Home.`;
|
||||
exports.DEFAULT_READONLY_REASON = `[Cache was read-only](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#using-the-cache-read-only). By default, the action will only write to the cache for Jobs running on the default branch.`;
|
||||
exports.DEFAULT_DISABLED_REASON = `[Cache was disabled](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#disabling-caching) via action confiugration. Gradle User Home was not restored from or saved to the cache.`;
|
||||
exports.DEFAULT_WRITEONLY_REASON = `[Cache was set to write-only](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#using-the-cache-write-only) via action configuration. Gradle User Home was not restored from cache.`;
|
||||
exports.EXISTING_GRADLE_HOME = `[Cache was disabled to avoid overwriting a pre-existing Gradle User Home](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#overwriting-an-existing-gradle-user-home). Gradle User Home was not restored from or saved to the cache.`;
|
||||
exports.CLEANUP_DISABLED_READONLY = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) is always disabled when cache is read-only or disabled.`;
|
||||
exports.DEFAULT_CLEANUP_DISABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was not enabled. It must be explicitly enabled.`;
|
||||
exports.DEFAULT_CLEANUP_ENABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was enabled.`;
|
||||
exports.CLEANUP_DISABLED_DUE_TO_FAILURE = '[Cache cleanup was disabled due to build failure](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup). Use `cache-cleanup: always` to override this behavior.';
|
||||
class CacheListener {
|
||||
constructor() {
|
||||
this.cacheEntries = [];
|
||||
this.cacheReadOnly = false;
|
||||
this.cacheWriteOnly = false;
|
||||
this.cacheDisabled = false;
|
||||
this.cacheDisabledReason = 'disabled';
|
||||
this.cacheStatusReason = exports.DEFAULT_CACHE_ENABLED_REASON;
|
||||
this.cacheCleanupMessage = exports.DEFAULT_CLEANUP_DISABLED_REASON;
|
||||
}
|
||||
get fullyRestored() {
|
||||
return this.cacheEntries.every(x => !x.wasRequestedButNotRestored());
|
||||
|
@ -143190,13 +143278,33 @@ class CacheListener {
|
|||
if (!cache.isFeatureAvailable())
|
||||
return 'not available';
|
||||
if (this.cacheDisabled)
|
||||
return this.cacheDisabledReason;
|
||||
return 'disabled';
|
||||
if (this.cacheWriteOnly)
|
||||
return 'write-only';
|
||||
if (this.cacheReadOnly)
|
||||
return 'read-only';
|
||||
return 'enabled';
|
||||
}
|
||||
setReadOnly(reason = exports.DEFAULT_READONLY_REASON) {
|
||||
this.cacheReadOnly = true;
|
||||
this.cacheStatusReason = reason;
|
||||
this.cacheCleanupMessage = exports.CLEANUP_DISABLED_READONLY;
|
||||
}
|
||||
setDisabled(reason = exports.DEFAULT_DISABLED_REASON) {
|
||||
this.cacheDisabled = true;
|
||||
this.cacheStatusReason = reason;
|
||||
this.cacheCleanupMessage = exports.CLEANUP_DISABLED_READONLY;
|
||||
}
|
||||
setWriteOnly(reason = exports.DEFAULT_WRITEONLY_REASON) {
|
||||
this.cacheWriteOnly = true;
|
||||
this.cacheStatusReason = reason;
|
||||
}
|
||||
setCacheCleanupEnabled() {
|
||||
this.cacheCleanupMessage = exports.DEFAULT_CLEANUP_ENABLED_REASON;
|
||||
}
|
||||
setCacheCleanupDisabled(reason = exports.DEFAULT_CLEANUP_DISABLED_REASON) {
|
||||
this.cacheCleanupMessage = reason;
|
||||
}
|
||||
entry(name) {
|
||||
for (const entry of this.cacheEntries) {
|
||||
if (entry.entryName === name) {
|
||||
|
@ -143266,6 +143374,10 @@ function generateCachingReport(listener) {
|
|||
return `
|
||||
<details>
|
||||
<summary><h4>Caching for Gradle actions was ${listener.cacheStatus} - expand for details</h4></summary>
|
||||
|
||||
- ${listener.cacheStatusReason}
|
||||
- ${listener.cacheCleanupMessage}
|
||||
|
||||
${renderEntryTable(entries)}
|
||||
|
||||
<h5>Cache Entry Details</h5>
|
||||
|
@ -143546,6 +143658,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.save = exports.restore = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const cache_reporting_1 = __nccwpck_require__(7391);
|
||||
const gradle_user_home_cache_1 = __nccwpck_require__(27655);
|
||||
const cache_cleaner_1 = __nccwpck_require__(50651);
|
||||
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
||||
|
@ -143559,15 +143672,14 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
if (cacheConfig.isCacheDisabled()) {
|
||||
core.info('Cache is disabled: will not restore state from previous builds.');
|
||||
gradleStateCache.init();
|
||||
cacheListener.cacheDisabled = true;
|
||||
cacheListener.setDisabled();
|
||||
return;
|
||||
}
|
||||
if (gradleStateCache.cacheOutputExists()) {
|
||||
if (!cacheConfig.isCacheOverwriteExisting()) {
|
||||
core.info('Gradle User Home already exists: will not restore from cache.');
|
||||
gradleStateCache.init();
|
||||
cacheListener.cacheDisabled = true;
|
||||
cacheListener.cacheDisabledReason = 'disabled due to pre-existing Gradle User Home';
|
||||
cacheListener.setDisabled(cache_reporting_1.EXISTING_GRADLE_HOME);
|
||||
return;
|
||||
}
|
||||
core.info('Gradle User Home already exists: will overwrite with cached contents.');
|
||||
|
@ -143576,7 +143688,7 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
core.saveState(CACHE_RESTORED_VAR, true);
|
||||
if (cacheConfig.isCacheWriteOnly()) {
|
||||
core.info('Cache is write-only: will not restore from cache.');
|
||||
cacheListener.cacheWriteOnly = true;
|
||||
cacheListener.setWriteOnly();
|
||||
return;
|
||||
}
|
||||
await core.group('Restore Gradle state from cache', async () => {
|
||||
|
@ -143589,7 +143701,7 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
}
|
||||
}
|
||||
exports.restore = restore;
|
||||
async function save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig) {
|
||||
async function save(userHome, gradleUserHome, cacheListener, daemonController, buildResults, cacheConfig) {
|
||||
if (cacheConfig.isCacheDisabled()) {
|
||||
core.info('Cache is disabled: will not save state for later builds.');
|
||||
return;
|
||||
|
@ -143600,18 +143712,18 @@ async function save(userHome, gradleUserHome, cacheListener, daemonController, c
|
|||
}
|
||||
if (cacheConfig.isCacheReadOnly()) {
|
||||
core.info('Cache is read-only: will not save state for use in subsequent builds.');
|
||||
cacheListener.cacheReadOnly = true;
|
||||
cacheListener.setReadOnly();
|
||||
return;
|
||||
}
|
||||
await daemonController.stopAllDaemons();
|
||||
if (cacheConfig.isCacheCleanupEnabled()) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
await cacheCleaner.forceCleanup();
|
||||
if (cacheConfig.shouldPerformCacheCleanup(buildResults.anyFailed())) {
|
||||
cacheListener.setCacheCleanupEnabled();
|
||||
await performCacheCleanup(gradleUserHome);
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
else {
|
||||
core.info('Not performing cache-cleanup due to build failure');
|
||||
cacheListener.setCacheCleanupDisabled(cache_reporting_1.CLEANUP_DISABLED_DUE_TO_FAILURE);
|
||||
}
|
||||
}
|
||||
await core.group('Caching Gradle state', async () => {
|
||||
|
@ -143619,6 +143731,16 @@ async function save(userHome, gradleUserHome, cacheListener, daemonController, c
|
|||
});
|
||||
}
|
||||
exports.save = save;
|
||||
async function performCacheCleanup(gradleUserHome) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
await cacheCleaner.forceCleanup();
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
@ -143913,7 +144035,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
|||
});
|
||||
}
|
||||
getConfigCacheDirectoriesWithAssociatedBuildResults() {
|
||||
return (0, build_results_1.loadBuildResults)().reduce((acc, buildResult) => {
|
||||
return (0, build_results_1.loadBuildResults)().results.reduce((acc, buildResult) => {
|
||||
const configCachePath = path_1.default.resolve(buildResult.rootProjectDir, '.gradle/configuration-cache');
|
||||
if (!fs_1.default.existsSync(configCachePath)) {
|
||||
return acc;
|
||||
|
@ -144263,7 +144385,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheCleanupOption = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const github = __importStar(__nccwpck_require__(95438));
|
||||
const cache = __importStar(__nccwpck_require__(27799));
|
||||
|
@ -144357,7 +144479,35 @@ class CacheConfig {
|
|||
return getBooleanInput('gradle-home-cache-strict-match');
|
||||
}
|
||||
isCacheCleanupEnabled() {
|
||||
return getBooleanInput('gradle-home-cache-cleanup') && !this.isCacheReadOnly();
|
||||
if (this.isCacheReadOnly()) {
|
||||
return false;
|
||||
}
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
return cleanupOption === CacheCleanupOption.Always || cleanupOption === CacheCleanupOption.OnSuccess;
|
||||
}
|
||||
shouldPerformCacheCleanup(hasFailure) {
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
if (cleanupOption === CacheCleanupOption.Always) {
|
||||
return true;
|
||||
}
|
||||
if (cleanupOption === CacheCleanupOption.OnSuccess) {
|
||||
return !hasFailure;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
getCacheCleanupOption() {
|
||||
const val = core.getInput('cache-cleanup');
|
||||
switch (val.toLowerCase().trim()) {
|
||||
case 'always':
|
||||
return CacheCleanupOption.Always;
|
||||
case 'on-success':
|
||||
return CacheCleanupOption.OnSuccess;
|
||||
case 'never':
|
||||
return getBooleanInput('gradle-home-cache-cleanup')
|
||||
? CacheCleanupOption.Always
|
||||
: CacheCleanupOption.Never;
|
||||
}
|
||||
throw TypeError(`The value '${val}' is not valid for cache-cleanup. Valid values are: [never, always, on-success].`);
|
||||
}
|
||||
getCacheEncryptionKey() {
|
||||
return core.getInput('cache-encryption-key');
|
||||
|
@ -144370,6 +144520,12 @@ class CacheConfig {
|
|||
}
|
||||
}
|
||||
exports.CacheConfig = CacheConfig;
|
||||
var CacheCleanupOption;
|
||||
(function (CacheCleanupOption) {
|
||||
CacheCleanupOption["Never"] = "never";
|
||||
CacheCleanupOption["OnSuccess"] = "on-success";
|
||||
CacheCleanupOption["Always"] = "always";
|
||||
})(CacheCleanupOption || (exports.CacheCleanupOption = CacheCleanupOption = {}));
|
||||
class SummaryConfig {
|
||||
shouldGenerateJobSummary(hasFailure) {
|
||||
if (!process.env[summary_1.SUMMARY_ENV_VAR]) {
|
||||
|
@ -144617,8 +144773,7 @@ const fs = __importStar(__nccwpck_require__(57147));
|
|||
const path = __importStar(__nccwpck_require__(71017));
|
||||
class DaemonController {
|
||||
constructor(buildResults) {
|
||||
const allHomes = buildResults.map(buildResult => buildResult.gradleHomeDir);
|
||||
this.gradleHomes = Array.from(new Set(allHomes));
|
||||
this.gradleHomes = buildResults.uniqueGradleHomes();
|
||||
}
|
||||
async stopAllDaemons() {
|
||||
core.info('Stopping all Gradle daemons before saving Gradle User Home state');
|
||||
|
@ -145664,8 +145819,8 @@ const request_error_1 = __nccwpck_require__(10537);
|
|||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
async function generateJobSummary(buildResults, cachingReport, config) {
|
||||
const summaryTable = renderSummaryTable(buildResults);
|
||||
const hasFailure = buildResults.some(result => result.buildFailed);
|
||||
const summaryTable = renderSummaryTable(buildResults.results);
|
||||
const hasFailure = buildResults.anyFailed();
|
||||
if (config.shouldGenerateJobSummary(hasFailure)) {
|
||||
core.info('Generating Job Summary');
|
||||
core.summary.addRaw(summaryTable);
|
||||
|
@ -145897,7 +146052,7 @@ async function complete(cacheConfig, summaryConfig) {
|
|||
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
||||
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
|
||||
const daemonController = new daemon_controller_1.DaemonController(buildResults);
|
||||
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig);
|
||||
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, buildResults, cacheConfig);
|
||||
const cachingReport = (0, cache_reporting_1.generateCachingReport)(cacheListener);
|
||||
await jobSummary.generateJobSummary(buildResults, cachingReport, summaryConfig);
|
||||
(0, build_results_1.markBuildResultsProcessed)();
|
||||
|
@ -145939,70 +146094,6 @@ async function checkNoInvalidWrapperJars(rootDir = (0, configuration_1.getWorksp
|
|||
exports.checkNoInvalidWrapperJars = checkNoInvalidWrapperJars;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4637:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const setupGradle = __importStar(__nccwpck_require__(18652));
|
||||
const gradle = __importStar(__nccwpck_require__(94475));
|
||||
const dependencyGraph = __importStar(__nccwpck_require__(80));
|
||||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
const errors_1 = __nccwpck_require__(36976);
|
||||
async function run() {
|
||||
try {
|
||||
if ((0, configuration_1.getActionId)() === 'gradle/gradle-build-action') {
|
||||
(0, deprecation_collector_1.recordDeprecation)('The action `gradle/gradle-build-action` has been replaced by `gradle/actions/setup-gradle`');
|
||||
}
|
||||
else {
|
||||
(0, configuration_1.setActionId)('gradle/actions/setup-gradle');
|
||||
}
|
||||
if ((0, configuration_1.doValidateWrappers)()) {
|
||||
await setupGradle.checkNoInvalidWrapperJars();
|
||||
}
|
||||
await setupGradle.setup(new configuration_1.CacheConfig(), new configuration_1.BuildScanConfig());
|
||||
await dependencyGraph.setup(new configuration_1.DependencyGraphConfig());
|
||||
const config = new configuration_1.GradleExecutionConfig();
|
||||
await gradle.provisionAndMaybeExecute(config.getGradleVersion(), config.getBuildRootDirectory(), config.getArguments());
|
||||
(0, deprecation_collector_1.saveDeprecationState)();
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handleMainActionError)(error);
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 50907:
|
||||
|
@ -146718,7 +146809,7 @@ module.exports = JSON.parse('[{"version":"8.9","checksum":"498495120a03b9a6ab5d1
|
|||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(4637);
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(74846);
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
||||
/******/ })()
|
||||
|
|
2
dist/setup-gradle/main/index.js.map
vendored
2
dist/setup-gradle/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
253
dist/setup-gradle/post/index.js
vendored
253
dist/setup-gradle/post/index.js
vendored
|
@ -142896,6 +142896,61 @@ utils.walkdir = function(dirpath, base, callback) {
|
|||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 540:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const setupGradle = __importStar(__nccwpck_require__(18652));
|
||||
const dependencyGraph = __importStar(__nccwpck_require__(80));
|
||||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const errors_1 = __nccwpck_require__(36976);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
process.on('uncaughtException', e => (0, errors_1.handlePostActionError)(e));
|
||||
async function run() {
|
||||
try {
|
||||
(0, deprecation_collector_1.restoreDeprecationState)();
|
||||
(0, deprecation_collector_1.emitDeprecationWarnings)();
|
||||
if (await setupGradle.complete(new configuration_1.CacheConfig(), new configuration_1.SummaryConfig())) {
|
||||
await dependencyGraph.complete(new configuration_1.DependencyGraphConfig());
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handlePostActionError)(error);
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 82107:
|
||||
|
@ -142927,14 +142982,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.markBuildResultsProcessed = exports.loadBuildResults = void 0;
|
||||
exports.markBuildResultsProcessed = exports.loadBuildResults = exports.BuildResults = void 0;
|
||||
const fs = __importStar(__nccwpck_require__(57147));
|
||||
const path = __importStar(__nccwpck_require__(71017));
|
||||
class BuildResults {
|
||||
constructor(results) {
|
||||
this.results = results;
|
||||
}
|
||||
anyFailed() {
|
||||
return this.results.some(result => result.buildFailed);
|
||||
}
|
||||
uniqueGradleHomes() {
|
||||
const allHomes = this.results.map(buildResult => buildResult.gradleHomeDir);
|
||||
return Array.from(new Set(allHomes));
|
||||
}
|
||||
}
|
||||
exports.BuildResults = BuildResults;
|
||||
function loadBuildResults() {
|
||||
return getUnprocessedResults().map(filePath => {
|
||||
const results = getUnprocessedResults().map(filePath => {
|
||||
const content = fs.readFileSync(filePath, 'utf8');
|
||||
return JSON.parse(content);
|
||||
});
|
||||
return new BuildResults(results);
|
||||
}
|
||||
exports.loadBuildResults = loadBuildResults;
|
||||
function markBuildResultsProcessed() {
|
||||
|
@ -143173,15 +143242,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.generateCachingReport = exports.CacheEntryListener = exports.CacheListener = void 0;
|
||||
exports.generateCachingReport = exports.CacheEntryListener = exports.CacheListener = exports.CLEANUP_DISABLED_DUE_TO_FAILURE = exports.DEFAULT_CLEANUP_ENABLED_REASON = exports.DEFAULT_CLEANUP_DISABLED_REASON = exports.CLEANUP_DISABLED_READONLY = exports.EXISTING_GRADLE_HOME = exports.DEFAULT_WRITEONLY_REASON = exports.DEFAULT_DISABLED_REASON = exports.DEFAULT_READONLY_REASON = exports.DEFAULT_CACHE_ENABLED_REASON = void 0;
|
||||
const cache = __importStar(__nccwpck_require__(27799));
|
||||
exports.DEFAULT_CACHE_ENABLED_REASON = `[Cache was enabled](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#caching-build-state-between-jobs). Action attempted to both restore and save the Gradle User Home.`;
|
||||
exports.DEFAULT_READONLY_REASON = `[Cache was read-only](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#using-the-cache-read-only). By default, the action will only write to the cache for Jobs running on the default branch.`;
|
||||
exports.DEFAULT_DISABLED_REASON = `[Cache was disabled](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#disabling-caching) via action confiugration. Gradle User Home was not restored from or saved to the cache.`;
|
||||
exports.DEFAULT_WRITEONLY_REASON = `[Cache was set to write-only](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#using-the-cache-write-only) via action configuration. Gradle User Home was not restored from cache.`;
|
||||
exports.EXISTING_GRADLE_HOME = `[Cache was disabled to avoid overwriting a pre-existing Gradle User Home](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#overwriting-an-existing-gradle-user-home). Gradle User Home was not restored from or saved to the cache.`;
|
||||
exports.CLEANUP_DISABLED_READONLY = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) is always disabled when cache is read-only or disabled.`;
|
||||
exports.DEFAULT_CLEANUP_DISABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was not enabled. It must be explicitly enabled.`;
|
||||
exports.DEFAULT_CLEANUP_ENABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was enabled.`;
|
||||
exports.CLEANUP_DISABLED_DUE_TO_FAILURE = '[Cache cleanup was disabled due to build failure](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup). Use `cache-cleanup: always` to override this behavior.';
|
||||
class CacheListener {
|
||||
constructor() {
|
||||
this.cacheEntries = [];
|
||||
this.cacheReadOnly = false;
|
||||
this.cacheWriteOnly = false;
|
||||
this.cacheDisabled = false;
|
||||
this.cacheDisabledReason = 'disabled';
|
||||
this.cacheStatusReason = exports.DEFAULT_CACHE_ENABLED_REASON;
|
||||
this.cacheCleanupMessage = exports.DEFAULT_CLEANUP_DISABLED_REASON;
|
||||
}
|
||||
get fullyRestored() {
|
||||
return this.cacheEntries.every(x => !x.wasRequestedButNotRestored());
|
||||
|
@ -143190,13 +143269,33 @@ class CacheListener {
|
|||
if (!cache.isFeatureAvailable())
|
||||
return 'not available';
|
||||
if (this.cacheDisabled)
|
||||
return this.cacheDisabledReason;
|
||||
return 'disabled';
|
||||
if (this.cacheWriteOnly)
|
||||
return 'write-only';
|
||||
if (this.cacheReadOnly)
|
||||
return 'read-only';
|
||||
return 'enabled';
|
||||
}
|
||||
setReadOnly(reason = exports.DEFAULT_READONLY_REASON) {
|
||||
this.cacheReadOnly = true;
|
||||
this.cacheStatusReason = reason;
|
||||
this.cacheCleanupMessage = exports.CLEANUP_DISABLED_READONLY;
|
||||
}
|
||||
setDisabled(reason = exports.DEFAULT_DISABLED_REASON) {
|
||||
this.cacheDisabled = true;
|
||||
this.cacheStatusReason = reason;
|
||||
this.cacheCleanupMessage = exports.CLEANUP_DISABLED_READONLY;
|
||||
}
|
||||
setWriteOnly(reason = exports.DEFAULT_WRITEONLY_REASON) {
|
||||
this.cacheWriteOnly = true;
|
||||
this.cacheStatusReason = reason;
|
||||
}
|
||||
setCacheCleanupEnabled() {
|
||||
this.cacheCleanupMessage = exports.DEFAULT_CLEANUP_ENABLED_REASON;
|
||||
}
|
||||
setCacheCleanupDisabled(reason = exports.DEFAULT_CLEANUP_DISABLED_REASON) {
|
||||
this.cacheCleanupMessage = reason;
|
||||
}
|
||||
entry(name) {
|
||||
for (const entry of this.cacheEntries) {
|
||||
if (entry.entryName === name) {
|
||||
|
@ -143266,6 +143365,10 @@ function generateCachingReport(listener) {
|
|||
return `
|
||||
<details>
|
||||
<summary><h4>Caching for Gradle actions was ${listener.cacheStatus} - expand for details</h4></summary>
|
||||
|
||||
- ${listener.cacheStatusReason}
|
||||
- ${listener.cacheCleanupMessage}
|
||||
|
||||
${renderEntryTable(entries)}
|
||||
|
||||
<h5>Cache Entry Details</h5>
|
||||
|
@ -143546,6 +143649,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.save = exports.restore = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const cache_reporting_1 = __nccwpck_require__(7391);
|
||||
const gradle_user_home_cache_1 = __nccwpck_require__(27655);
|
||||
const cache_cleaner_1 = __nccwpck_require__(50651);
|
||||
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
||||
|
@ -143559,15 +143663,14 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
if (cacheConfig.isCacheDisabled()) {
|
||||
core.info('Cache is disabled: will not restore state from previous builds.');
|
||||
gradleStateCache.init();
|
||||
cacheListener.cacheDisabled = true;
|
||||
cacheListener.setDisabled();
|
||||
return;
|
||||
}
|
||||
if (gradleStateCache.cacheOutputExists()) {
|
||||
if (!cacheConfig.isCacheOverwriteExisting()) {
|
||||
core.info('Gradle User Home already exists: will not restore from cache.');
|
||||
gradleStateCache.init();
|
||||
cacheListener.cacheDisabled = true;
|
||||
cacheListener.cacheDisabledReason = 'disabled due to pre-existing Gradle User Home';
|
||||
cacheListener.setDisabled(cache_reporting_1.EXISTING_GRADLE_HOME);
|
||||
return;
|
||||
}
|
||||
core.info('Gradle User Home already exists: will overwrite with cached contents.');
|
||||
|
@ -143576,7 +143679,7 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
core.saveState(CACHE_RESTORED_VAR, true);
|
||||
if (cacheConfig.isCacheWriteOnly()) {
|
||||
core.info('Cache is write-only: will not restore from cache.');
|
||||
cacheListener.cacheWriteOnly = true;
|
||||
cacheListener.setWriteOnly();
|
||||
return;
|
||||
}
|
||||
await core.group('Restore Gradle state from cache', async () => {
|
||||
|
@ -143589,7 +143692,7 @@ async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||
}
|
||||
}
|
||||
exports.restore = restore;
|
||||
async function save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig) {
|
||||
async function save(userHome, gradleUserHome, cacheListener, daemonController, buildResults, cacheConfig) {
|
||||
if (cacheConfig.isCacheDisabled()) {
|
||||
core.info('Cache is disabled: will not save state for later builds.');
|
||||
return;
|
||||
|
@ -143600,18 +143703,18 @@ async function save(userHome, gradleUserHome, cacheListener, daemonController, c
|
|||
}
|
||||
if (cacheConfig.isCacheReadOnly()) {
|
||||
core.info('Cache is read-only: will not save state for use in subsequent builds.');
|
||||
cacheListener.cacheReadOnly = true;
|
||||
cacheListener.setReadOnly();
|
||||
return;
|
||||
}
|
||||
await daemonController.stopAllDaemons();
|
||||
if (cacheConfig.isCacheCleanupEnabled()) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
await cacheCleaner.forceCleanup();
|
||||
if (cacheConfig.shouldPerformCacheCleanup(buildResults.anyFailed())) {
|
||||
cacheListener.setCacheCleanupEnabled();
|
||||
await performCacheCleanup(gradleUserHome);
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
else {
|
||||
core.info('Not performing cache-cleanup due to build failure');
|
||||
cacheListener.setCacheCleanupDisabled(cache_reporting_1.CLEANUP_DISABLED_DUE_TO_FAILURE);
|
||||
}
|
||||
}
|
||||
await core.group('Caching Gradle state', async () => {
|
||||
|
@ -143619,6 +143722,16 @@ async function save(userHome, gradleUserHome, cacheListener, daemonController, c
|
|||
});
|
||||
}
|
||||
exports.save = save;
|
||||
async function performCacheCleanup(gradleUserHome) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
await cacheCleaner.forceCleanup();
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
@ -143913,7 +144026,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
|||
});
|
||||
}
|
||||
getConfigCacheDirectoriesWithAssociatedBuildResults() {
|
||||
return (0, build_results_1.loadBuildResults)().reduce((acc, buildResult) => {
|
||||
return (0, build_results_1.loadBuildResults)().results.reduce((acc, buildResult) => {
|
||||
const configCachePath = path_1.default.resolve(buildResult.rootProjectDir, '.gradle/configuration-cache');
|
||||
if (!fs_1.default.existsSync(configCachePath)) {
|
||||
return acc;
|
||||
|
@ -144263,7 +144376,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheCleanupOption = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const github = __importStar(__nccwpck_require__(95438));
|
||||
const cache = __importStar(__nccwpck_require__(27799));
|
||||
|
@ -144357,7 +144470,35 @@ class CacheConfig {
|
|||
return getBooleanInput('gradle-home-cache-strict-match');
|
||||
}
|
||||
isCacheCleanupEnabled() {
|
||||
return getBooleanInput('gradle-home-cache-cleanup') && !this.isCacheReadOnly();
|
||||
if (this.isCacheReadOnly()) {
|
||||
return false;
|
||||
}
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
return cleanupOption === CacheCleanupOption.Always || cleanupOption === CacheCleanupOption.OnSuccess;
|
||||
}
|
||||
shouldPerformCacheCleanup(hasFailure) {
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
if (cleanupOption === CacheCleanupOption.Always) {
|
||||
return true;
|
||||
}
|
||||
if (cleanupOption === CacheCleanupOption.OnSuccess) {
|
||||
return !hasFailure;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
getCacheCleanupOption() {
|
||||
const val = core.getInput('cache-cleanup');
|
||||
switch (val.toLowerCase().trim()) {
|
||||
case 'always':
|
||||
return CacheCleanupOption.Always;
|
||||
case 'on-success':
|
||||
return CacheCleanupOption.OnSuccess;
|
||||
case 'never':
|
||||
return getBooleanInput('gradle-home-cache-cleanup')
|
||||
? CacheCleanupOption.Always
|
||||
: CacheCleanupOption.Never;
|
||||
}
|
||||
throw TypeError(`The value '${val}' is not valid for cache-cleanup. Valid values are: [never, always, on-success].`);
|
||||
}
|
||||
getCacheEncryptionKey() {
|
||||
return core.getInput('cache-encryption-key');
|
||||
|
@ -144370,6 +144511,12 @@ class CacheConfig {
|
|||
}
|
||||
}
|
||||
exports.CacheConfig = CacheConfig;
|
||||
var CacheCleanupOption;
|
||||
(function (CacheCleanupOption) {
|
||||
CacheCleanupOption["Never"] = "never";
|
||||
CacheCleanupOption["OnSuccess"] = "on-success";
|
||||
CacheCleanupOption["Always"] = "always";
|
||||
})(CacheCleanupOption || (exports.CacheCleanupOption = CacheCleanupOption = {}));
|
||||
class SummaryConfig {
|
||||
shouldGenerateJobSummary(hasFailure) {
|
||||
if (!process.env[summary_1.SUMMARY_ENV_VAR]) {
|
||||
|
@ -144617,8 +144764,7 @@ const fs = __importStar(__nccwpck_require__(57147));
|
|||
const path = __importStar(__nccwpck_require__(71017));
|
||||
class DaemonController {
|
||||
constructor(buildResults) {
|
||||
const allHomes = buildResults.map(buildResult => buildResult.gradleHomeDir);
|
||||
this.gradleHomes = Array.from(new Set(allHomes));
|
||||
this.gradleHomes = buildResults.uniqueGradleHomes();
|
||||
}
|
||||
async stopAllDaemons() {
|
||||
core.info('Stopping all Gradle daemons before saving Gradle User Home state');
|
||||
|
@ -145664,8 +145810,8 @@ const request_error_1 = __nccwpck_require__(10537);
|
|||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
async function generateJobSummary(buildResults, cachingReport, config) {
|
||||
const summaryTable = renderSummaryTable(buildResults);
|
||||
const hasFailure = buildResults.some(result => result.buildFailed);
|
||||
const summaryTable = renderSummaryTable(buildResults.results);
|
||||
const hasFailure = buildResults.anyFailed();
|
||||
if (config.shouldGenerateJobSummary(hasFailure)) {
|
||||
core.info('Generating Job Summary');
|
||||
core.summary.addRaw(summaryTable);
|
||||
|
@ -145897,7 +146043,7 @@ async function complete(cacheConfig, summaryConfig) {
|
|||
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
||||
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
|
||||
const daemonController = new daemon_controller_1.DaemonController(buildResults);
|
||||
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig);
|
||||
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, buildResults, cacheConfig);
|
||||
const cachingReport = (0, cache_reporting_1.generateCachingReport)(cacheListener);
|
||||
await jobSummary.generateJobSummary(buildResults, cachingReport, summaryConfig);
|
||||
(0, build_results_1.markBuildResultsProcessed)();
|
||||
|
@ -145939,61 +146085,6 @@ async function checkNoInvalidWrapperJars(rootDir = (0, configuration_1.getWorksp
|
|||
exports.checkNoInvalidWrapperJars = checkNoInvalidWrapperJars;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 88766:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const setupGradle = __importStar(__nccwpck_require__(18652));
|
||||
const dependencyGraph = __importStar(__nccwpck_require__(80));
|
||||
const configuration_1 = __nccwpck_require__(15778);
|
||||
const errors_1 = __nccwpck_require__(36976);
|
||||
const deprecation_collector_1 = __nccwpck_require__(22572);
|
||||
process.on('uncaughtException', e => (0, errors_1.handlePostActionError)(e));
|
||||
async function run() {
|
||||
try {
|
||||
(0, deprecation_collector_1.restoreDeprecationState)();
|
||||
(0, deprecation_collector_1.emitDeprecationWarnings)();
|
||||
if (await setupGradle.complete(new configuration_1.CacheConfig(), new configuration_1.SummaryConfig())) {
|
||||
await dependencyGraph.complete(new configuration_1.DependencyGraphConfig());
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handlePostActionError)(error);
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 50907:
|
||||
|
@ -146709,7 +146800,7 @@ module.exports = JSON.parse('[{"version":"8.9","checksum":"498495120a03b9a6ab5d1
|
|||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(88766);
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(540);
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
||||
/******/ })()
|
||||
|
|
2
dist/setup-gradle/post/index.js.map
vendored
2
dist/setup-gradle/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
172
dist/wrapper-validation/main/index.js
vendored
172
dist/wrapper-validation/main/index.js
vendored
|
@ -89853,6 +89853,72 @@ function wrappy (fn, cb) {
|
|||
}).call(this);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2401:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const validate = __importStar(__nccwpck_require__(8568));
|
||||
const configuration_1 = __nccwpck_require__(5778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(2572);
|
||||
const errors_1 = __nccwpck_require__(6976);
|
||||
async function run() {
|
||||
try {
|
||||
if ((0, configuration_1.getActionId)() === 'gradle/wrapper-validation-action') {
|
||||
(0, deprecation_collector_1.recordDeprecation)('The action `gradle/wrapper-validation-action` has been replaced by `gradle/actions/wrapper-validation`');
|
||||
}
|
||||
else {
|
||||
(0, configuration_1.setActionId)('gradle/actions/wrapper-validation');
|
||||
}
|
||||
const result = await validate.findInvalidWrapperJars(path.resolve('.'), +core.getInput('min-wrapper-count'), core.getInput('allow-snapshots') === 'true', core.getInput('allow-checksums').split(','));
|
||||
if (result.isValid()) {
|
||||
core.info(result.toDisplayString());
|
||||
}
|
||||
else {
|
||||
core.setFailed(`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/actions/blob/main/docs/wrapper-validation.md#reporting-failures\n${result.toDisplayString()}`);
|
||||
if (result.invalid.length > 0) {
|
||||
core.setOutput('failed-wrapper', `${result.invalid.map(w => w.path).join('|')}`);
|
||||
}
|
||||
}
|
||||
(0, deprecation_collector_1.emitDeprecationWarnings)(false);
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handleMainActionError)(error);
|
||||
}
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5778:
|
||||
|
@ -89887,7 +89953,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
exports.parseNumericInput = exports.setActionId = exports.getActionId = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.doValidateWrappers = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheCleanupOption = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const github = __importStar(__nccwpck_require__(5438));
|
||||
const cache = __importStar(__nccwpck_require__(7799));
|
||||
|
@ -89981,7 +90047,35 @@ class CacheConfig {
|
|||
return getBooleanInput('gradle-home-cache-strict-match');
|
||||
}
|
||||
isCacheCleanupEnabled() {
|
||||
return getBooleanInput('gradle-home-cache-cleanup') && !this.isCacheReadOnly();
|
||||
if (this.isCacheReadOnly()) {
|
||||
return false;
|
||||
}
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
return cleanupOption === CacheCleanupOption.Always || cleanupOption === CacheCleanupOption.OnSuccess;
|
||||
}
|
||||
shouldPerformCacheCleanup(hasFailure) {
|
||||
const cleanupOption = this.getCacheCleanupOption();
|
||||
if (cleanupOption === CacheCleanupOption.Always) {
|
||||
return true;
|
||||
}
|
||||
if (cleanupOption === CacheCleanupOption.OnSuccess) {
|
||||
return !hasFailure;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
getCacheCleanupOption() {
|
||||
const val = core.getInput('cache-cleanup');
|
||||
switch (val.toLowerCase().trim()) {
|
||||
case 'always':
|
||||
return CacheCleanupOption.Always;
|
||||
case 'on-success':
|
||||
return CacheCleanupOption.OnSuccess;
|
||||
case 'never':
|
||||
return getBooleanInput('gradle-home-cache-cleanup')
|
||||
? CacheCleanupOption.Always
|
||||
: CacheCleanupOption.Never;
|
||||
}
|
||||
throw TypeError(`The value '${val}' is not valid for cache-cleanup. Valid values are: [never, always, on-success].`);
|
||||
}
|
||||
getCacheEncryptionKey() {
|
||||
return core.getInput('cache-encryption-key');
|
||||
|
@ -89994,6 +90088,12 @@ class CacheConfig {
|
|||
}
|
||||
}
|
||||
exports.CacheConfig = CacheConfig;
|
||||
var CacheCleanupOption;
|
||||
(function (CacheCleanupOption) {
|
||||
CacheCleanupOption["Never"] = "never";
|
||||
CacheCleanupOption["OnSuccess"] = "on-success";
|
||||
CacheCleanupOption["Always"] = "always";
|
||||
})(CacheCleanupOption || (exports.CacheCleanupOption = CacheCleanupOption = {}));
|
||||
class SummaryConfig {
|
||||
shouldGenerateJobSummary(hasFailure) {
|
||||
if (!process.env[summary_1.SUMMARY_ENV_VAR]) {
|
||||
|
@ -90567,72 +90667,6 @@ async function sha256File(path) {
|
|||
exports.sha256File = sha256File;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8095:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const validate = __importStar(__nccwpck_require__(8568));
|
||||
const configuration_1 = __nccwpck_require__(5778);
|
||||
const deprecation_collector_1 = __nccwpck_require__(2572);
|
||||
const errors_1 = __nccwpck_require__(6976);
|
||||
async function run() {
|
||||
try {
|
||||
if ((0, configuration_1.getActionId)() === 'gradle/wrapper-validation-action') {
|
||||
(0, deprecation_collector_1.recordDeprecation)('The action `gradle/wrapper-validation-action` has been replaced by `gradle/actions/wrapper-validation`');
|
||||
}
|
||||
else {
|
||||
(0, configuration_1.setActionId)('gradle/actions/wrapper-validation');
|
||||
}
|
||||
const result = await validate.findInvalidWrapperJars(path.resolve('.'), +core.getInput('min-wrapper-count'), core.getInput('allow-snapshots') === 'true', core.getInput('allow-checksums').split(','));
|
||||
if (result.isValid()) {
|
||||
core.info(result.toDisplayString());
|
||||
}
|
||||
else {
|
||||
core.setFailed(`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/actions/blob/main/docs/wrapper-validation.md#reporting-failures\n${result.toDisplayString()}`);
|
||||
if (result.invalid.length > 0) {
|
||||
core.setOutput('failed-wrapper', `${result.invalid.map(w => w.path).join('|')}`);
|
||||
}
|
||||
}
|
||||
(0, deprecation_collector_1.emitDeprecationWarnings)(false);
|
||||
}
|
||||
catch (error) {
|
||||
(0, errors_1.handleMainActionError)(error);
|
||||
}
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8568:
|
||||
|
@ -91131,7 +91165,7 @@ module.exports = JSON.parse('[{"version":"8.9","checksum":"498495120a03b9a6ab5d1
|
|||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(8095);
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(2401);
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
||||
/******/ })()
|
||||
|
|
2
dist/wrapper-validation/main/index.js.map
vendored
2
dist/wrapper-validation/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue