Unverified Commit 535b4947 authored by Daz DeBoer's avatar Daz DeBoer
Browse files

Merge branch 'dd/cache-cleanup-test-fix'

  Disable cache-cleanup on Windows
  Fix OSX by avoiding GNU-specific touch options
parents 6e56b596 d6110eca
Loading
Loading
Loading
Loading
+4 −3
Changes for .github/workflows/integ-test-cache-cleanup.yml: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ on:
        type: string
      runner-os:
        type: string
        default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
        default: '["ubuntu-latest", "macos-latest"]' # Windows is not yet supported
      download-dist:
        type: boolean
        default: false
@@ -34,7 +34,7 @@ jobs:
        cache-read-only: false # For testing, allow writing cache entries on non-default branches
    - name: Build with 3.1
      working-directory: test/jest/resources/cache-cleanup
      run: gradle --no-daemon --build-cache -Dcommons_math3_version=3.1 build
      run: gradle --no-daemon --build-cache -Dcommons_math3_version="3.1" build

  # Second build will use the cache from the first build, but cleanup should remove unused artifacts
  assemble-build:
@@ -55,7 +55,7 @@ jobs:
        gradle-home-cache-cleanup: true
    - name: Build with 3.1.1
      working-directory: test/jest/resources/cache-cleanup
      run: gradle --no-daemon --build-cache -Dcommons_math3_version=3.1.1 build
      run: gradle --no-daemon --build-cache -Dcommons_math3_version="3.1.1" build

  check-clean-cache:
    needs: assemble-build
@@ -75,6 +75,7 @@ jobs:
    - name: Report Gradle User Home
      run: du -hc ~/.gradle/caches/modules-2
    - name: Verify cleaned cache
      shell: bash
      run: |
        if [ ! -e ~/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-math3/3.1.1 ]; then
          echo "::error ::Should find commons-math3 3.1.1 in cache"
+7 −2
Changes for dist/main/index.js: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -65896,7 +65896,7 @@ class CacheCleaner {
    }
    ageAllFiles(fileName = '*') {
        return __awaiter(this, void 0, void 0, function* () {
            yield exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '-d', '1970-01-01', '{}', '+'], {});
            yield exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '-t', '197001010000', '{}', '+'], {});
        });
    }
    touchAllFiles(fileName = '*') {
@@ -66494,7 +66494,12 @@ function isCacheDebuggingEnabled() {
}
exports.isCacheDebuggingEnabled = isCacheDebuggingEnabled;
function isCacheCleanupEnabled() {
    return core.getBooleanInput(CACHE_CLEANUP_ENABLED_PARAMETER);
    const userEnabled = core.getBooleanInput(CACHE_CLEANUP_ENABLED_PARAMETER);
    if (userEnabled && process.platform === 'win32') {
        core.warning('Cache cleanup is not yet supported on Windows');
        return false;
    }
    return userEnabled;
}
exports.isCacheCleanupEnabled = isCacheCleanupEnabled;
class CacheKey {
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+7 −2
Changes for dist/post/index.js: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -64947,7 +64947,7 @@ class CacheCleaner {
    }
    ageAllFiles(fileName = '*') {
        return __awaiter(this, void 0, void 0, function* () {
            yield exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '-d', '1970-01-01', '{}', '+'], {});
            yield exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '-t', '197001010000', '{}', '+'], {});
        });
    }
    touchAllFiles(fileName = '*') {
@@ -65545,7 +65545,12 @@ function isCacheDebuggingEnabled() {
}
exports.isCacheDebuggingEnabled = isCacheDebuggingEnabled;
function isCacheCleanupEnabled() {
    return core.getBooleanInput(CACHE_CLEANUP_ENABLED_PARAMETER);
    const userEnabled = core.getBooleanInput(CACHE_CLEANUP_ENABLED_PARAMETER);
    if (userEnabled && process.platform === 'win32') {
        core.warning('Cache cleanup is not yet supported on Windows');
        return false;
    }
    return userEnabled;
}
exports.isCacheCleanupEnabled = isCacheCleanupEnabled;
class CacheKey {
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading