mirror of
https://github.com/android-actions/setup-android
synced 2024-11-22 13:29:35 -08:00
only setup for caching if things are changed
This commit is contained in:
parent
22d4a3f682
commit
035deb0e29
4 changed files with 18 additions and 7 deletions
2
.github/workflows/run-test.yml
vendored
2
.github/workflows/run-test.yml
vendored
|
@ -42,6 +42,6 @@ jobs:
|
|||
if: runner.os != 'windows'
|
||||
run: ./gradlew --no-daemon build
|
||||
|
||||
- name: Build streetcomplete (Windows)
|
||||
- name: Build SampleApplication (Windows)
|
||||
if: runner.os == 'windows'
|
||||
run: .\gradlew.bat --no-daemon build
|
||||
|
|
2
dist/main/index.js
vendored
2
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/post/index.js
vendored
2
dist/post/index.js
vendored
File diff suppressed because one or more lines are too long
19
src/cache.ts
19
src/cache.ts
|
@ -61,7 +61,6 @@ export async function preGradleWrapper(): Promise<void> {
|
|||
core.info('A hash for the gradle wrapper could not be generated')
|
||||
return
|
||||
}
|
||||
core.saveState(GRADLE_WRAPPER_KEY, wrapperKey)
|
||||
|
||||
const wrapperCache = await cache.restoreCache(
|
||||
[GRADLE_WRAPPER_DIR],
|
||||
|
@ -75,6 +74,10 @@ export async function preGradleWrapper(): Promise<void> {
|
|||
)
|
||||
}
|
||||
|
||||
if (wrapperCache !== wrapperKey) {
|
||||
core.saveState(GRADLE_WRAPPER_KEY, wrapperKey)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -102,7 +105,6 @@ export async function preGradleCache(): Promise<void> {
|
|||
core.info('A hash for the gradle dependencies could not be generated')
|
||||
return
|
||||
}
|
||||
core.saveState(GRADLE_CACHE_KEY, cacheKey)
|
||||
|
||||
const cacheCache = await cache.restoreCache(
|
||||
[GRADLE_CACHE_DIR],
|
||||
|
@ -114,6 +116,10 @@ export async function preGradleCache(): Promise<void> {
|
|||
core.info('Gradle cache not found, expect dependency downloads from gradle')
|
||||
}
|
||||
|
||||
if (cacheCache !== cacheKey) {
|
||||
core.saveState(GRADLE_CACHE_KEY, cacheKey)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -144,7 +150,6 @@ export async function preAndroidCache(): Promise<void> {
|
|||
core.info('A hash for the android sdk could not be generated')
|
||||
return
|
||||
}
|
||||
core.saveState(ANDROID_KEY, androidKey)
|
||||
|
||||
const androidCache = await cache.restoreCache(
|
||||
[ANDROID_SDK_ROOT, ANDROID_REPOSITORIES_CACHE, ANDROID_REPOSITORIES_CFG],
|
||||
|
@ -153,7 +158,13 @@ export async function preAndroidCache(): Promise<void> {
|
|||
)
|
||||
|
||||
if (!androidCache) {
|
||||
core.info('Gradle cache not found, expect dependency downloads from gradle')
|
||||
core.info(
|
||||
'Android cache not found, expect dependency downloads from gradle'
|
||||
)
|
||||
}
|
||||
|
||||
if (androidCache !== androidKey) {
|
||||
core.saveState(ANDROID_KEY, androidKey)
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue