mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-20 15:53:59 +08:00
Attempt to delete the archive after extraction (#209)
This reduces storage space used once the Action has finished executing.
This commit is contained in:
parent
af8651e0c5
commit
cae64ca3cd
6 changed files with 70 additions and 18 deletions
|
@ -1,4 +1,5 @@
|
|||
import * as core from "@actions/core";
|
||||
import * as fs from "fs";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
|
||||
|
@ -234,3 +235,15 @@ test("isValidEvent returns true for pull request event", () => {
|
|||
|
||||
expect(isValidEvent).toBe(true);
|
||||
});
|
||||
|
||||
test("unlinkFile unlinks file", async () => {
|
||||
const testDirectory = fs.mkdtempSync("unlinkFileTest");
|
||||
const testFile = path.join(testDirectory, "test.txt");
|
||||
fs.writeFileSync(testFile, "hello world");
|
||||
|
||||
await actionUtils.unlinkFile(testFile);
|
||||
|
||||
expect(fs.existsSync(testFile)).toBe(false);
|
||||
|
||||
fs.rmdirSync(testDirectory);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue