diff --git a/README.md b/README.md index e245179..1a11907 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,10 @@ steps: # Installed when the version is specified ndk-version: '23.1.7779620' + # default: true + # Whether to generate or not the job summary + generate-job-summary: false + - run: ./gradlew build --stacktrace ``` diff --git a/action.yml b/action.yml index 295d6e3..97d506e 100644 --- a/action.yml +++ b/action.yml @@ -20,6 +20,10 @@ inputs: required: false description: 'disabled cache' default: 'false' + generate-job-summary: + required: false + description: 'display job summary' + default: 'true' job-status: description: 'Workaround to pass job status to post job step. This variable is not intended for manual setting' default: ${{ job.status }} diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 9307298..f563a66 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -59332,12 +59332,17 @@ function run() { const buildToolsVersion = core.getInput(constants.INPUT_BUILD_TOOLS_VERSION); const ndkVersion = core.getInput(constants.INPUT_NDK_VERSION); const cmakeVersion = core.getInput(constants.INPUT_CMAKE_VERSION); - const cacheDisabled = core.getInput(constants.INPUT_CACHE_DISABLED); + const cacheDisabled = core.getBooleanInput(constants.INPUT_CACHE_DISABLED); + const generateJobSummary = core.getBooleanInput(constants.INPUT_GENERATE_JOB_SUMMARY); + core.info(`cache-disabled: ${cacheDisabled}`); + core.info(`generate-job-summary: ${generateJobSummary}`); let savedCacheEntry; if (!cacheDisabled) { savedCacheEntry = yield (0, cache_1.saveCache)(sdkVersion, buildToolsVersion, ndkVersion, cmakeVersion); } - yield (0, summary_1.renderSummary)(sdkVersion, buildToolsVersion, ndkVersion, cmakeVersion, savedCacheEntry); + if (generateJobSummary) { + yield (0, summary_1.renderSummary)(sdkVersion, buildToolsVersion, ndkVersion, cmakeVersion, savedCacheEntry); + } } catch (error) { if (error instanceof Error) @@ -59387,7 +59392,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ANDROID_SDK_ROOT = exports.ANDROID_HOME_DIR = exports.HOME = exports.COMMANDLINE_TOOLS_WINDOWS_URL = exports.COMMANDLINE_TOOLS_MAC_URL = exports.COMMANDLINE_TOOLS_LINUX_URL = exports.INPUT_JOB_STATUS = exports.INPUT_CACHE_DISABLED = exports.INPUT_CMAKE_VERSION = exports.INPUT_NDK_VERSION = exports.INPUT_BUILD_TOOLS_VERSION = exports.INPUT_SDK_VERSION = void 0; +exports.ANDROID_SDK_ROOT = exports.ANDROID_HOME_DIR = exports.HOME = exports.COMMANDLINE_TOOLS_WINDOWS_URL = exports.COMMANDLINE_TOOLS_MAC_URL = exports.COMMANDLINE_TOOLS_LINUX_URL = exports.INPUT_JOB_STATUS = exports.INPUT_GENERATE_JOB_SUMMARY = exports.INPUT_CACHE_DISABLED = exports.INPUT_CMAKE_VERSION = exports.INPUT_NDK_VERSION = exports.INPUT_BUILD_TOOLS_VERSION = exports.INPUT_SDK_VERSION = void 0; const os = __importStar(__nccwpck_require__(2037)); const path_1 = __importDefault(__nccwpck_require__(1017)); exports.INPUT_SDK_VERSION = 'sdk-version'; @@ -59395,6 +59400,7 @@ exports.INPUT_BUILD_TOOLS_VERSION = 'build-tools-version'; exports.INPUT_NDK_VERSION = 'ndk-version'; exports.INPUT_CMAKE_VERSION = 'cmake-version'; exports.INPUT_CACHE_DISABLED = 'cache-disabled'; +exports.INPUT_GENERATE_JOB_SUMMARY = 'generate-job-summary'; exports.INPUT_JOB_STATUS = 'job-status'; // https://developer.android.com/studio#command-tools exports.COMMANDLINE_TOOLS_LINUX_URL = `https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip`; diff --git a/dist/setup/index.js b/dist/setup/index.js index 12ed82c..cd45bf7 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -60252,7 +60252,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ANDROID_SDK_ROOT = exports.ANDROID_HOME_DIR = exports.HOME = exports.COMMANDLINE_TOOLS_WINDOWS_URL = exports.COMMANDLINE_TOOLS_MAC_URL = exports.COMMANDLINE_TOOLS_LINUX_URL = exports.INPUT_JOB_STATUS = exports.INPUT_CACHE_DISABLED = exports.INPUT_CMAKE_VERSION = exports.INPUT_NDK_VERSION = exports.INPUT_BUILD_TOOLS_VERSION = exports.INPUT_SDK_VERSION = void 0; +exports.ANDROID_SDK_ROOT = exports.ANDROID_HOME_DIR = exports.HOME = exports.COMMANDLINE_TOOLS_WINDOWS_URL = exports.COMMANDLINE_TOOLS_MAC_URL = exports.COMMANDLINE_TOOLS_LINUX_URL = exports.INPUT_JOB_STATUS = exports.INPUT_GENERATE_JOB_SUMMARY = exports.INPUT_CACHE_DISABLED = exports.INPUT_CMAKE_VERSION = exports.INPUT_NDK_VERSION = exports.INPUT_BUILD_TOOLS_VERSION = exports.INPUT_SDK_VERSION = void 0; const os = __importStar(__nccwpck_require__(2037)); const path_1 = __importDefault(__nccwpck_require__(1017)); exports.INPUT_SDK_VERSION = 'sdk-version'; @@ -60260,6 +60260,7 @@ exports.INPUT_BUILD_TOOLS_VERSION = 'build-tools-version'; exports.INPUT_NDK_VERSION = 'ndk-version'; exports.INPUT_CMAKE_VERSION = 'cmake-version'; exports.INPUT_CACHE_DISABLED = 'cache-disabled'; +exports.INPUT_GENERATE_JOB_SUMMARY = 'generate-job-summary'; exports.INPUT_JOB_STATUS = 'job-status'; // https://developer.android.com/studio#command-tools exports.COMMANDLINE_TOOLS_LINUX_URL = `https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip`; diff --git a/src/cleanup-android.ts b/src/cleanup-android.ts index 1e1a4ea..b973bb7 100644 --- a/src/cleanup-android.ts +++ b/src/cleanup-android.ts @@ -14,7 +14,13 @@ async function run(): Promise { const buildToolsVersion = core.getInput(constants.INPUT_BUILD_TOOLS_VERSION) const ndkVersion = core.getInput(constants.INPUT_NDK_VERSION) const cmakeVersion = core.getInput(constants.INPUT_CMAKE_VERSION) - const cacheDisabled = core.getInput(constants.INPUT_CACHE_DISABLED) + const cacheDisabled = core.getBooleanInput(constants.INPUT_CACHE_DISABLED) + const generateJobSummary = core.getBooleanInput( + constants.INPUT_GENERATE_JOB_SUMMARY + ) + + core.info(`cache-disabled: ${cacheDisabled}`) + core.info(`generate-job-summary: ${generateJobSummary}`) let savedCacheEntry if (!cacheDisabled) { @@ -26,13 +32,15 @@ async function run(): Promise { ) } - await renderSummary( - sdkVersion, - buildToolsVersion, - ndkVersion, - cmakeVersion, - savedCacheEntry - ) + if (generateJobSummary) { + await renderSummary( + sdkVersion, + buildToolsVersion, + ndkVersion, + cmakeVersion, + savedCacheEntry + ) + } } catch (error) { if (error instanceof Error) core.setFailed(error.message) } diff --git a/src/constants.ts b/src/constants.ts index edee8f7..305e32f 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -7,6 +7,7 @@ export const INPUT_NDK_VERSION = 'ndk-version' export const INPUT_CMAKE_VERSION = 'cmake-version' export const INPUT_CACHE_DISABLED = 'cache-disabled' +export const INPUT_GENERATE_JOB_SUMMARY = 'generate-job-summary' export const INPUT_JOB_STATUS = 'job-status' // https://developer.android.com/studio#command-tools