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:
Josh Gross 2019-11-14 17:14:16 -05:00 committed by GitHub
parent c0584c42d1
commit 8d14a2150b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 390 additions and 44 deletions

View file

@ -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);