mirror of
				https://gitea.com/actions/cache.git
				synced 2025-10-31 07:47:07 +00:00 
			
		
		
		
	Use 30 as the long distance matching window to support both 32-bit and 64-bit OS
This commit is contained in:
		| @@ -12,7 +12,6 @@ jest.mock("@actions/exec"); | ||||
| jest.mock("@actions/io"); | ||||
|  | ||||
| const IS_WINDOWS = process.platform === "win32"; | ||||
| const IS_64OS = process.platform != "win32" || process.arch === "x64"; | ||||
|  | ||||
| function getTempDir(): string { | ||||
|     return path.join(__dirname, "_temp", "tar"); | ||||
| @@ -47,13 +46,12 @@ test("zstd extract tar", async () => { | ||||
|     const tarPath = IS_WINDOWS | ||||
|         ? `${process.env["windir"]}\\System32\\tar.exe` | ||||
|         : "tar"; | ||||
|     const zstdOptions = IS_64OS ? "zstd -d --long=31" : "zstd -d --long=30"; | ||||
|     expect(execMock).toHaveBeenCalledTimes(1); | ||||
|     expect(execMock).toHaveBeenCalledWith( | ||||
|         `"${tarPath}"`, | ||||
|         [ | ||||
|             "--use-compress-program", | ||||
|             zstdOptions, | ||||
|             "zstd -d --long=30", | ||||
|             "-xf", | ||||
|             IS_WINDOWS ? archivePath.replace(/\\/g, "/") : archivePath, | ||||
|             "-P", | ||||
| @@ -142,14 +140,13 @@ test("zstd create tar", async () => { | ||||
|     const tarPath = IS_WINDOWS | ||||
|         ? `${process.env["windir"]}\\System32\\tar.exe` | ||||
|         : "tar"; | ||||
|     const zstdOptions = IS_64OS ? "zstd -T0 --long=31" : "zstd -T0 --long=30"; | ||||
|  | ||||
|     expect(execMock).toHaveBeenCalledTimes(1); | ||||
|     expect(execMock).toHaveBeenCalledWith( | ||||
|         `"${tarPath}"`, | ||||
|         [ | ||||
|             "--use-compress-program", | ||||
|             zstdOptions, | ||||
|             "zstd -T0 --long=30", | ||||
|             "-cf", | ||||
|             IS_WINDOWS | ||||
|                 ? CacheFilename.Zstd.replace(/\\/g, "/") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Aiqiao Yan
					Aiqiao Yan