mirror of
https://github.com/actions/setup-python.git
synced 2025-07-18 20:58:19 +02:00
add documentation
This commit is contained in:
parent
73eda7ce1d
commit
87683fb568
3 changed files with 100 additions and 23 deletions
|
@ -10,6 +10,23 @@ function isPyPyVersion(versionSpec: string) {
|
|||
return versionSpec.startsWith('pypy-');
|
||||
}
|
||||
|
||||
async function cacheDepencies(pythonVersion: string) {
|
||||
const cache = core.getInput('cache');
|
||||
if (cache) {
|
||||
if (isGhes()) {
|
||||
throw new Error('Caching is not supported on GHES');
|
||||
}
|
||||
const cacheDependencyPath =
|
||||
core.getInput('cache-dependency-path') || undefined;
|
||||
const cacheDistributor = await getCacheDistributor(
|
||||
cache,
|
||||
pythonVersion,
|
||||
cacheDependencyPath
|
||||
);
|
||||
await cacheDistributor.restoreCache();
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const version = core.getInput('python-version');
|
||||
|
@ -28,20 +45,7 @@ async function run() {
|
|||
core.info(`Successfully setup ${installed.impl} (${pythonVersion})`);
|
||||
}
|
||||
|
||||
const cache = core.getInput('cache');
|
||||
if (cache) {
|
||||
if (isGhes()) {
|
||||
throw new Error('Caching is not supported on GHES');
|
||||
}
|
||||
const cacheDependencyPath =
|
||||
core.getInput('cache-dependency-path') || undefined;
|
||||
const cacheDistributor = await getCacheDistributor(
|
||||
cache,
|
||||
pythonVersion,
|
||||
cacheDependencyPath
|
||||
);
|
||||
await cacheDistributor.restoreCache();
|
||||
}
|
||||
await cacheDepencies(pythonVersion);
|
||||
}
|
||||
const matchersPath = path.join(__dirname, '../..', '.github');
|
||||
core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue