Emit deprecation warnings for derecated inputs

- Adds an upgrade-guide to assist with resolving deprecations
- Emit a warning when deprecated features are used
- List all deprecated features in Job Summary and link to upgrade guide
This commit is contained in:
daz
2024-04-09 10:51:09 -06:00
parent 2e02e6624e
commit 9d0de74673
7 changed files with 194 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import * as setupGradle from '../setup-gradle'
import * as gradle from '../execution/gradle'
import * as dependencyGraph from '../dependency-graph'
import {BuildScanConfig, CacheConfig, DependencyGraphConfig, GradleExecutionConfig} from '../input-params'
import {saveDeprecationState} from '../deprecation-collector'
/**
* The main entry point for the action, called by Github Actions for the step.
@@ -22,6 +23,8 @@ export async function run(): Promise<void> {
config.getBuildRootDirectory(),
config.getArguments()
)
saveDeprecationState()
} catch (error) {
core.setFailed(String(error))
if (error instanceof Error && error.stack) {

View File

@@ -4,6 +4,7 @@ import * as dependencyGraph from '../dependency-graph'
import {CacheConfig, DependencyGraphConfig, SummaryConfig} from '../input-params'
import {PostActionJobFailure} from '../errors'
import {emitDeprecationWarnings, restoreDeprecationState} from '../deprecation-collector'
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
@@ -15,6 +16,9 @@ process.on('uncaughtException', e => handleFailure(e))
*/
export async function run(): Promise<void> {
try {
restoreDeprecationState()
emitDeprecationWarnings()
if (await setupGradle.complete(new CacheConfig(), new SummaryConfig())) {
// Only submit the dependency graphs once per job
await dependencyGraph.complete(new DependencyGraphConfig())