mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-26 02:52:09 +00:00
Always execute Gradle with --no-daemon
The Gradle daemon is not useful for ephemeral builds, and the process can hold file locks which interfere with cache entry generation. In the case where multiple Gradle invocations occur in the same job, we could provide a way for users to override this behaviour, taking care of stopping any daemon process at the end of the job.
This commit is contained in:
parent
986024f0b7
commit
fa0c026e07
2 changed files with 10 additions and 7 deletions
12
.github/workflows/prod.yml
vendored
12
.github/workflows/prod.yml
vendored
|
@ -19,12 +19,12 @@ jobs:
|
|||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/basic
|
||||
arguments: test --no-daemon
|
||||
arguments: test
|
||||
- name: Build with configuration-cache enabled
|
||||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/basic
|
||||
arguments: test --no-daemon --configuration-cache
|
||||
arguments: test --configuration-cache
|
||||
|
||||
gradle-execution:
|
||||
needs: basic-build
|
||||
|
@ -70,7 +70,7 @@ jobs:
|
|||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/basic
|
||||
arguments: test --no-daemon
|
||||
arguments: test
|
||||
|
||||
configuration-cache:
|
||||
needs: basic-build
|
||||
|
@ -85,7 +85,7 @@ jobs:
|
|||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/basic
|
||||
arguments: test --configuration-cache --no-daemon
|
||||
arguments: test --configuration-cache
|
||||
|
||||
read-only-cache:
|
||||
needs: basic-build
|
||||
|
@ -100,7 +100,7 @@ jobs:
|
|||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/basic
|
||||
arguments: test --no-daemon
|
||||
arguments: test
|
||||
distributions-cache-enabled: read-only
|
||||
gradle-user-home-cache-enabled: read-only
|
||||
project-dot-gradle-cache-enabled: read-only
|
||||
|
@ -110,7 +110,7 @@ jobs:
|
|||
with:
|
||||
gradle-version: 6.9
|
||||
build-root-directory: __tests__/samples/basic
|
||||
arguments: test --no-daemon
|
||||
arguments: test
|
||||
distributions-cache-enabled: false
|
||||
gradle-user-home-cache-enabled: false
|
||||
project-dot-gradle-cache-enabled: false
|
||||
|
|
|
@ -15,13 +15,16 @@ export async function run(): Promise<void> {
|
|||
await caches.restore(buildRootDirectory)
|
||||
|
||||
try {
|
||||
const args: string[] = parseCommandLineArguments()
|
||||
args.push('--no-daemon')
|
||||
|
||||
const result = await execution.execute(
|
||||
await resolveGradleExecutable(
|
||||
workspaceDirectory,
|
||||
buildRootDirectory
|
||||
),
|
||||
buildRootDirectory,
|
||||
parseCommandLineArguments()
|
||||
args
|
||||
)
|
||||
|
||||
if (result.buildScanUrl) {
|
||||
|
|
Loading…
Reference in a new issue