mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-10-20 07:08:56 +08:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
996094e8e8 | ||
|
4137be6a8b |
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/main/index.js.map
vendored
2
dist/main/index.js.map
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
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -185,7 +185,7 @@ export abstract class AbstractCache {
|
||||
|
||||
async save(listener: CacheListener): Promise<void> {
|
||||
if (!this.cacheOutputExists()) {
|
||||
this.debug(`No ${this.cacheDescription} to cache.`)
|
||||
core.info(`No ${this.cacheDescription} to cache.`)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ export abstract class AbstractCache {
|
||||
const cacheResult = core.getState(this.cacheResultStateKey)
|
||||
|
||||
if (!cacheKey) {
|
||||
this.debug(`${this.cacheDescription} existed prior to cache restore. Not saving.`)
|
||||
core.info(`${this.cacheDescription} existed prior to cache restore. Not saving.`)
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -54,6 +54,10 @@ export async function save(): Promise<void> {
|
||||
}
|
||||
|
||||
function logCachingReport(listener: CacheListener): void {
|
||||
if (listener.cacheEntries.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
core.info(`---------- Caching Summary -------------
|
||||
Restored Entries Count: ${getCount(listener.cacheEntries, e => e.restoredSize)}
|
||||
Size: ${getSum(listener.cacheEntries, e => e.restoredSize)}
|
||||
|
17
src/post.ts
17
src/post.ts
@@ -1,15 +1,24 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as caches from './caches'
|
||||
|
||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
||||
// throw an uncaught exception. Instead of failing this action, just warn.
|
||||
process.on('uncaughtException', e => handleFailure(e))
|
||||
|
||||
// Invoked by GitHub Actions
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
await caches.save()
|
||||
} catch (error) {
|
||||
core.setFailed(String(error))
|
||||
if (error instanceof Error && error.stack) {
|
||||
core.info(error.stack)
|
||||
}
|
||||
handleFailure(error)
|
||||
}
|
||||
}
|
||||
|
||||
function handleFailure(error: unknown): void {
|
||||
core.warning(`Unhandled error saving cache - job will continue: ${error}`)
|
||||
if (error instanceof Error && error.stack) {
|
||||
core.info(error.stack)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user