mirror of
https://gitea.com/actions/setup-android.git
synced 2025-12-10 18:36:55 +00:00
only setup for caching if things are changed
This commit is contained in:
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
|
||||
|
||||
Reference in New Issue
Block a user