mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +00:00
initial changes
This commit is contained in:
parent
6c048c7558
commit
c1f6351648
5 changed files with 1805 additions and 1780 deletions
17
dist/cache-save/index.js
vendored
17
dist/cache-save/index.js
vendored
|
@ -3728,10 +3728,7 @@ const options_1 = __webpack_require__(538);
|
|||
const requestUtils_1 = __webpack_require__(899);
|
||||
const versionSalt = '1.0';
|
||||
function getCacheApiUrl(resource) {
|
||||
// Ideally we just use ACTIONS_CACHE_URL
|
||||
const baseUrl = (process.env['ACTIONS_CACHE_URL'] ||
|
||||
process.env['ACTIONS_RUNTIME_URL'] ||
|
||||
'').replace('pipelines', 'artifactcache');
|
||||
const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';
|
||||
if (!baseUrl) {
|
||||
throw new Error('Cache Service Url not found, unable to restore cache.');
|
||||
}
|
||||
|
@ -5920,7 +5917,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
|
|||
//
|
||||
// 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');
|
||||
try {
|
||||
|
@ -41451,6 +41449,15 @@ function checkKey(key) {
|
|||
throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* isFeatureAvailable to check the presence of Actions cache service
|
||||
*
|
||||
* @returns boolean return true if Actions cache service feature is available, otherwise false
|
||||
*/
|
||||
function isFeatureAvailable() {
|
||||
return !!process.env['ACTIONS_CACHE_URL'];
|
||||
}
|
||||
exports.isFeatureAvailable = isFeatureAvailable;
|
||||
/**
|
||||
* Restores cache from keys
|
||||
*
|
||||
|
|
3513
dist/setup/index.js
vendored
3513
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
22
package-lock.json
generated
22
package-lock.json
generated
|
@ -9,7 +9,7 @@
|
|||
"version": "2.2.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^1.0.8",
|
||||
"@actions/cache": "^2.0.0",
|
||||
"@actions/core": "^1.2.3",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/glob": "^0.2.0",
|
||||
|
@ -31,17 +31,17 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@actions/cache": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.8.tgz",
|
||||
"integrity": "sha512-GWNNB67w93HGJRQXlsV56YqrdAuDoP3esK/mo5mzU8WoDCVjtQgJGsTdkYUX7brswtT7xnI30bWNo1WLKQ8FZQ==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz",
|
||||
"integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.1",
|
||||
"@actions/glob": "^0.1.0",
|
||||
"@actions/http-client": "^1.0.9",
|
||||
"@actions/io": "^1.0.1",
|
||||
"@azure/ms-rest-js": "^2.0.7",
|
||||
"@azure/storage-blob": "^12.1.2",
|
||||
"@azure/ms-rest-js": "^2.6.0",
|
||||
"@azure/storage-blob": "^12.8.0",
|
||||
"semver": "^6.1.0",
|
||||
"uuid": "^3.3.3"
|
||||
}
|
||||
|
@ -11338,17 +11338,17 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@actions/cache": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.8.tgz",
|
||||
"integrity": "sha512-GWNNB67w93HGJRQXlsV56YqrdAuDoP3esK/mo5mzU8WoDCVjtQgJGsTdkYUX7brswtT7xnI30bWNo1WLKQ8FZQ==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz",
|
||||
"integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==",
|
||||
"requires": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.1",
|
||||
"@actions/glob": "^0.1.0",
|
||||
"@actions/http-client": "^1.0.9",
|
||||
"@actions/io": "^1.0.1",
|
||||
"@azure/ms-rest-js": "^2.0.7",
|
||||
"@azure/storage-blob": "^12.1.2",
|
||||
"@azure/ms-rest-js": "^2.6.0",
|
||||
"@azure/storage-blob": "^12.8.0",
|
||||
"semver": "^6.1.0",
|
||||
"uuid": "^3.3.3"
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"author": "GitHub",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^1.0.8",
|
||||
"@actions/cache": "^2.0.0",
|
||||
"@actions/core": "^1.2.3",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/glob": "^0.2.0",
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import * as actionsCache from '@actions/cache';
|
||||
import * as core from '@actions/core';
|
||||
import * as finder from './find-python';
|
||||
import * as finderPyPy from './find-pypy';
|
||||
|
@ -11,8 +12,12 @@ function isPyPyVersion(versionSpec: string) {
|
|||
}
|
||||
|
||||
async function cacheDependencies(cache: string, pythonVersion: string) {
|
||||
if (!actionsCache.isFeatureAvailable()) {
|
||||
if (isGhes()) {
|
||||
throw new Error('Caching is not supported on GHES');
|
||||
throw new Error('Caching is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.');
|
||||
} else {
|
||||
throw new Error('An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.');
|
||||
}
|
||||
}
|
||||
const cacheDependencyPath =
|
||||
core.getInput('cache-dependency-path') || undefined;
|
||||
|
|
Loading…
Add table
Reference in a new issue