mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-22 08:43:55 +08:00
Add unit tests for save (#98)
* Clean up args and arrange imports * Arrange args in restore tests * Add unit tests for save * Use const instead of let (linting)
This commit is contained in:
parent
c0584c42d1
commit
8d14a2150b
5 changed files with 390 additions and 44 deletions
|
@ -93,9 +93,11 @@ export async function downloadCache(
|
|||
}
|
||||
|
||||
export async function saveCache(
|
||||
stream: NodeJS.ReadableStream,
|
||||
key: string
|
||||
key: string,
|
||||
archivePath: string
|
||||
): Promise<void> {
|
||||
const stream = fs.createReadStream(archivePath);
|
||||
|
||||
const cacheUrl = getCacheUrl();
|
||||
const token = process.env["ACTIONS_RUNTIME_TOKEN"] || "";
|
||||
const bearerCredentialHandler = new BearerCredentialHandler(token);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue