Unverified Commit fa0c026e authored by Daz DeBoer's avatar Daz DeBoer
Browse files

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.
parent 986024f0
Loading
Loading
Loading
Loading
+6 −6
Changes for .github/workflows/prod.yml: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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
+4 −1
Changes for src/main.ts: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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) {