only setup for caching if things are changed

This commit is contained in:
Dave Olsthoorn 2020-07-25 20:51:01 +02:00
parent 22d4a3f682
commit 035deb0e29
4 changed files with 18 additions and 7 deletions

View file

@ -42,6 +42,6 @@ jobs:
if: runner.os != 'windows' if: runner.os != 'windows'
run: ./gradlew --no-daemon build run: ./gradlew --no-daemon build
- name: Build streetcomplete (Windows) - name: Build SampleApplication (Windows)
if: runner.os == 'windows' if: runner.os == 'windows'
run: .\gradlew.bat --no-daemon build run: .\gradlew.bat --no-daemon build

2
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/post/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -61,7 +61,6 @@ export async function preGradleWrapper(): Promise<void> {
core.info('A hash for the gradle wrapper could not be generated') core.info('A hash for the gradle wrapper could not be generated')
return return
} }
core.saveState(GRADLE_WRAPPER_KEY, wrapperKey)
const wrapperCache = await cache.restoreCache( const wrapperCache = await cache.restoreCache(
[GRADLE_WRAPPER_DIR], [GRADLE_WRAPPER_DIR],
@ -75,6 +74,10 @@ export async function preGradleWrapper(): Promise<void> {
) )
} }
if (wrapperCache !== wrapperKey) {
core.saveState(GRADLE_WRAPPER_KEY, wrapperKey)
}
return return
} }
@ -102,7 +105,6 @@ export async function preGradleCache(): Promise<void> {
core.info('A hash for the gradle dependencies could not be generated') core.info('A hash for the gradle dependencies could not be generated')
return return
} }
core.saveState(GRADLE_CACHE_KEY, cacheKey)
const cacheCache = await cache.restoreCache( const cacheCache = await cache.restoreCache(
[GRADLE_CACHE_DIR], [GRADLE_CACHE_DIR],
@ -114,6 +116,10 @@ export async function preGradleCache(): Promise<void> {
core.info('Gradle cache not found, expect dependency downloads from gradle') core.info('Gradle cache not found, expect dependency downloads from gradle')
} }
if (cacheCache !== cacheKey) {
core.saveState(GRADLE_CACHE_KEY, cacheKey)
}
return return
} }
@ -144,7 +150,6 @@ export async function preAndroidCache(): Promise<void> {
core.info('A hash for the android sdk could not be generated') core.info('A hash for the android sdk could not be generated')
return return
} }
core.saveState(ANDROID_KEY, androidKey)
const androidCache = await cache.restoreCache( const androidCache = await cache.restoreCache(
[ANDROID_SDK_ROOT, ANDROID_REPOSITORIES_CACHE, ANDROID_REPOSITORIES_CFG], [ANDROID_SDK_ROOT, ANDROID_REPOSITORIES_CACHE, ANDROID_REPOSITORIES_CFG],
@ -153,7 +158,13 @@ export async function preAndroidCache(): Promise<void> {
) )
if (!androidCache) { 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 return