mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Make dependency-submission and setup-gradle play nicely
Now, a `dependency-submission` step will trigger a dependency-graph generation, even if it follows a `setup-gradle` step in the workflow. Similarly, a `setup-gradle` step with `dependency-graph` configured will function as expected even if it follows a `setup-gradle` step.
This commit is contained in:
@@ -4,6 +4,8 @@ import * as setupGradle from '../setup-gradle'
|
||||
import * as execution from '../execution'
|
||||
import * as provisioner from '../provision'
|
||||
import * as layout from '../repository-layout'
|
||||
import * as dependencyGraph from '../dependency-graph'
|
||||
|
||||
import {parseArgsStringToArgv} from 'string-argv'
|
||||
import {DependencyGraphOption, getDependencyGraphOption} from '../input-params'
|
||||
|
||||
@@ -12,16 +14,12 @@ import {DependencyGraphOption, getDependencyGraphOption} from '../input-params'
|
||||
*/
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
if (process.env['GRADLE_BUILD_ACTION_SETUP_COMPLETED']) {
|
||||
core.setFailed(
|
||||
'The dependency-submission action cannot be used in the same Job as the setup-gradle action. Please use a separate Job for dependency submission.'
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Configure Gradle environment (Gradle User Home)
|
||||
await setupGradle.setup()
|
||||
|
||||
// Configure the dependency graph submission
|
||||
await dependencyGraph.setup(getDependencyGraphOption())
|
||||
|
||||
if (getDependencyGraphOption() === DependencyGraphOption.DownloadAndSubmit) {
|
||||
// No execution to perform
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user