Skip to content

Commit

Permalink
Merge pull request #183 from wtto00/cache-key
Browse files Browse the repository at this point in the history
fix: some minor repairs
  • Loading branch information
amyu authored Oct 3, 2023
2 parents 2fdb21d + 630e375 commit 5732c54
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
- name: Setup Android SDK
uses: ./
with:
cache-key: 'default-version'
cache-key: custom-cache-key-on-${{matrix.os}}

- run: |
sdkmanager --install emulator
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ steps:
# Whether to use the cache
cache-disabled: true

# default: `${sdkVersion}-${buildToolsVersion}-${ndkVersion}-${cmakeVersion}-v3.1`
# default: `${sdkVersion}-${buildToolsVersion}-${ndkVersion}-${cmakeVersion}-v3.2`
# Custom key for cache. It is invalid when `cache-disabled: true`
cache-key: 'custom-cache-key'

Expand Down
6 changes: 3 additions & 3 deletions dist/cleanup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function generateRestoreKey(
cacheKey: string
): string {
if (cacheKey) return cacheKey
return `${sdkVersion}-${buildToolsVersion}-${ndkVersion}-${cmakeVersion}-v3.1`
return `${sdkVersion}-${buildToolsVersion}-${ndkVersion}-${cmakeVersion}-v3.2`
}

export async function restoreCache(
Expand All @@ -33,9 +33,9 @@ export async function restoreCache(

const restoredEntry = await cache.restoreCache([ANDROID_HOME_DIR], restoreKey)
if (restoredEntry) {
core.info(`Found in cache: ${restoredEntry}`)
core.info(`Found in cache: ${restoreKey}`)
} else {
core.info(`Not Found cache: ${restoredEntry}`)
core.info(`Not Found cache: ${restoreKey}`)
}
core.saveState(RESTORED_ENTRY_STATE_KEY, restoredEntry)
return Promise.resolve(restoredEntry)
Expand Down
2 changes: 1 addition & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function getAndroidSdk(
cacheKey
)
if (restoreCacheEntry) {
core.info(`cache hit: ${restoreCacheEntry}`)
core.info(`cache hit: ${restoreCacheEntry.key}`)
return Promise.resolve()
}
}
Expand Down

0 comments on commit 5732c54

Please sign in to comment.