mirror of
https://github.com/actions/toolkit
synced 2025-05-09 00:22:56 +00:00
Cache package release for compression change in windows with symlink fix (#1291)
* Cache package release for compression change in windows
This reverts commit 86fe4abd8e
.
* Add env variable to enable windows symlinks
* Add cross os opt-in functionality for cache on windows
* Fix test
* Address review comments
* Fix test
* Fix tests
* Fix tests
* Fix tests
* Address review comments
* Address review comments
* Fix tests
* Fix tests
* Add npm version
* Add release details
This commit is contained in:
parent
c0b323a0bb
commit
b2d865f180
14 changed files with 664 additions and 168 deletions
23
packages/cache/__tests__/cacheHttpClient.test.ts
vendored
23
packages/cache/__tests__/cacheHttpClient.test.ts
vendored
|
@ -7,7 +7,7 @@ jest.mock('../src/internal/downloadUtils')
|
|||
|
||||
test('getCacheVersion with one path returns version', async () => {
|
||||
const paths = ['node_modules']
|
||||
const result = getCacheVersion(paths)
|
||||
const result = getCacheVersion(paths, undefined, true)
|
||||
expect(result).toEqual(
|
||||
'b3e0c6cb5ecf32614eeb2997d905b9c297046d7cbf69062698f25b14b4cb0985'
|
||||
)
|
||||
|
@ -15,7 +15,7 @@ test('getCacheVersion with one path returns version', async () => {
|
|||
|
||||
test('getCacheVersion with multiple paths returns version', async () => {
|
||||
const paths = ['node_modules', 'dist']
|
||||
const result = getCacheVersion(paths)
|
||||
const result = getCacheVersion(paths, undefined, true)
|
||||
expect(result).toEqual(
|
||||
'165c3053bc646bf0d4fac17b1f5731caca6fe38e0e464715c0c3c6b6318bf436'
|
||||
)
|
||||
|
@ -23,22 +23,33 @@ test('getCacheVersion with multiple paths returns version', async () => {
|
|||
|
||||
test('getCacheVersion with zstd compression returns version', async () => {
|
||||
const paths = ['node_modules']
|
||||
const result = getCacheVersion(paths, CompressionMethod.Zstd)
|
||||
const result = getCacheVersion(paths, CompressionMethod.Zstd, true)
|
||||
|
||||
expect(result).toEqual(
|
||||
'273877e14fd65d270b87a198edbfa2db5a43de567c9a548d2a2505b408befe24'
|
||||
)
|
||||
})
|
||||
|
||||
test('getCacheVersion with gzip compression does not change vesion', async () => {
|
||||
test('getCacheVersion with gzip compression returns version', async () => {
|
||||
const paths = ['node_modules']
|
||||
const result = getCacheVersion(paths, CompressionMethod.Gzip)
|
||||
const result = getCacheVersion(paths, CompressionMethod.Gzip, true)
|
||||
|
||||
expect(result).toEqual(
|
||||
'b3e0c6cb5ecf32614eeb2997d905b9c297046d7cbf69062698f25b14b4cb0985'
|
||||
'470e252814dbffc9524891b17cf4e5749b26c1b5026e63dd3f00972db2393117'
|
||||
)
|
||||
})
|
||||
|
||||
test('getCacheVersion with enableCrossOsArchive as false returns version on windows', async () => {
|
||||
if (process.platform === 'win32') {
|
||||
const paths = ['node_modules']
|
||||
const result = getCacheVersion(paths)
|
||||
|
||||
expect(result).toEqual(
|
||||
'2db19d6596dc34f51f0043120148827a264863f5c6ac857569c2af7119bad14e'
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
test('downloadCache uses http-client for non-Azure URLs', async () => {
|
||||
const downloadCacheHttpClientMock = jest.spyOn(
|
||||
downloadUtils,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue