Compare commits

..

33 Commits

Author SHA1 Message Date
Shubham Tiwari 6ccc235c6d Update RELEASES.md 2022-03-25 11:52:13 +05:30
Shubham Tiwari 9d24b58739 Revert "reverting version update"
This reverts commit af84eba61e.
2022-03-25 11:51:01 +05:30
Shubham Tiwari af84eba61e reverting version update 2022-03-25 10:59:17 +05:30
Shubham Tiwari 385e1ed722 Merge branch 'enablingForGHES' of github.com:actions/toolkit into enablingForGHES 2022-03-25 00:51:58 +05:30
Shubham Tiwari 336e5e4ce8 remove extra spaces 2022-03-25 00:51:25 +05:30
Shubham Tiwari 299d3dd2ec Update RELEASES.md 2022-03-25 00:40:46 +05:30
Shubham Tiwari 8251d0edc0 push to start CI 2022-03-25 00:37:41 +05:30
Shubham Tiwari 2a53a08370 linting 2022-03-25 00:26:40 +05:30
Shubham Tiwari 6664f1646a linting 2022-03-25 00:25:03 +05:30
Shubham Tiwari ec8e458bdc merge conflicts 2022-03-25 00:06:54 +05:30
Shubham Tiwari 2487627b27 review comments 2022-03-25 00:02:17 +05:30
Ashwin Sangem 39b9640642 Merge pull request #1030 from actions/users/ashwinsangem/fix_download_chunk_cap
Cap the cache download chunk to 2 GB
2022-03-24 19:11:52 +05:30
Shubham Tiwari 71b35793b1 Update packages/cache/src/internal/cacheUtils.ts
Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
2022-03-24 17:17:35 +05:30
Ashwin Sangem f0a876ab8b bumped up the @action/cache version. 2022-03-24 11:19:52 +00:00
Shubham Tiwari 4cb65fcdd9 update name to actions service 2022-03-24 13:36:58 +05:30
Shubham Tiwari 77a6cb490e lint 2022-03-24 12:37:32 +05:30
Shubham Tiwari a54ac04ab9 linting 2022-03-24 12:10:14 +05:30
Shubham Tiwari a4539ea36c lint 2022-03-24 11:55:57 +05:30
Shubham Tiwari 4e40c6dfc0 t pMerge branch 'enablingForGHES' of github.com:actions/toolkit into enablingForGHES 2022-03-24 11:46:21 +05:30
Shubham Tiwari 31035de89b Lint errors 2022-03-24 11:45:50 +05:30
Shubham Tiwari bc0e8f3536 Update RELEASES.md 2022-03-24 11:28:55 +05:30
Shubham Tiwari ba1126827e added test case 2022-03-24 11:26:30 +05:30
Shubham Tiwari a1a0cc7ebf Updated release 2022-03-24 09:01:37 +05:30
Shubham Tiwari d8025e51e1 Function rename 2022-03-24 09:00:25 +05:30
Ashwin Sangem 58406447b5 Fixed toolkit audit by running npm audit fix. 2022-03-23 11:24:15 +00:00
Ashwin Sangem 087191dabd Update downloadUtils.ts 2022-03-23 16:46:52 +05:30
Shubham Tiwari 8fe3522c0b changed function name 2022-03-23 16:46:49 +05:30
Ashwin Sangem 862c4e9db4 Cap the cache download chunk to 2 GB 2022-03-23 16:44:40 +05:30
Shubham Tiwari 05f407f4ff CI fix 2022-03-23 02:53:18 +05:30
Shubham Tiwari 429adbf862 Fix CI 2022-03-23 02:44:07 +05:30
Shubham Tiwari 3c38dcfe1f added ACTIONS_CACHE_URL in fixtures 2022-03-23 02:40:43 +05:30
Shubham Tiwari d87ca655a9 enablingForGHES 2022-03-23 02:25:34 +05:30
Shubham Tiwari 717b6fd18b Added support to check if Artifact cache service is enabled or not. 2022-03-23 02:24:43 +05:30
9 changed files with 128 additions and 20050 deletions
+88 -20036
View File
File diff suppressed because it is too large Load Diff
+7 -1
View File
@@ -49,4 +49,10 @@
- Use @azure/storage-blob v12.8.0
### 1.0.10
- Update `lockfileVersion` to `v2` in `package-lock.json [#1022](https://github.com/actions/toolkit/pull/1022)
- Update `lockfileVersion` to `v2` in `package-lock.json [#1022](https://github.com/actions/toolkit/pull/1022)
### 1.0.11
- Fix file downloads > 2GB([issue](https://github.com/actions/cache/issues/773))
### 2.0.0
- Added support to check if Actions cache service feature is available or not [#1028](https://github.com/actions/toolkit/pull/1028)
+2 -2
View File
@@ -3,10 +3,10 @@
const fs = require('fs');
const os = require('os');
const filePath = process.env[`GITHUB_ENV`]
fs.appendFileSync(filePath, `ACTIONS_RUNTIME_URL=${process.env.ACTIONS_RUNTIME_URL}${os.EOL}`, {
fs.appendFileSync(filePath, `ACTIONS_RUNTIME_TOKEN=${process.env.ACTIONS_RUNTIME_TOKEN}${os.EOL}`, {
encoding: 'utf8'
})
fs.appendFileSync(filePath, `ACTIONS_RUNTIME_TOKEN=${process.env.ACTIONS_RUNTIME_TOKEN}${os.EOL}`, {
fs.appendFileSync(filePath, `ACTIONS_CACHE_URL=${process.env.ACTIONS_CACHE_URL}${os.EOL}`, {
encoding: 'utf8'
})
fs.appendFileSync(filePath, `GITHUB_RUN_ID=${process.env.GITHUB_RUN_ID}${os.EOL}`, {
+14
View File
@@ -0,0 +1,14 @@
import * as cache from '../src/cache'
test('isFeatureAvailable returns true if server url is set', () => {
try {
process.env['ACTIONS_CACHE_URL'] = 'http://cache.com'
expect(cache.isFeatureAvailable()).toBe(true)
} finally {
delete process.env['ACTIONS_CACHE_URL']
}
})
test('isFeatureAvailable returns false if server url is not set', () => {
expect(cache.isFeatureAvailable()).toBe(false)
})
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@actions/cache",
"version": "1.0.10",
"version": "2.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@actions/cache",
"version": "1.0.10",
"version": "2.0.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@actions/cache",
"version": "1.0.10",
"version": "2.0.0",
"preview": true,
"description": "Actions cache lib",
"keywords": [
+11 -1
View File
@@ -43,6 +43,16 @@ function checkKey(key: string): void {
}
}
/**
* isFeatureAvailable to check the presence of Actions cache service
*
* @returns boolean return true if Actions cache service feature is available, otherwise false
*/
export function isFeatureAvailable(): boolean {
return !!process.env['ACTIONS_CACHE_URL']
}
/**
* Restores cache from keys
*
@@ -126,7 +136,7 @@ export async function restoreCache(
}
/**
* Saves a list of files test with the specified key.
* Saves a list of files with the specified key
*
* @param paths a list of file paths to be cached
* @param key an explicit key for restoring the cache
+1 -6
View File
@@ -31,12 +31,7 @@ import {
const versionSalt = '1.0'
function getCacheApiUrl(resource: string): string {
// Ideally we just use ACTIONS_CACHE_URL
const baseUrl: string = (
process.env['ACTIONS_CACHE_URL'] ||
process.env['ACTIONS_RUNTIME_URL'] ||
''
).replace('pipelines', 'artifactcache')
const baseUrl: string = process.env['ACTIONS_CACHE_URL'] || ''
if (!baseUrl) {
throw new Error('Cache Service Url not found, unable to restore cache.')
}
+2 -1
View File
@@ -240,7 +240,8 @@ export async function downloadCacheStorageSDK(
//
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
// on 64-bit systems), split the download into multiple segments
const maxSegmentSize = buffer.constants.MAX_LENGTH
// ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH)
const downloadProgress = new DownloadProgress(contentLength)
const fd = fs.openSync(archivePath, 'w')