mirror of
https://github.com/actions/setup-python.git
synced 2025-07-27 07:28:21 +02:00
Add support for graalpy
This commit is contained in:
parent
f97b83114c
commit
ad7b7ba29e
7 changed files with 6841 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as finder from './find-python';
|
||||
import * as finderPyPy from './find-pypy';
|
||||
import * as finderGraalPy from './find-graalpy';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import fs from 'fs';
|
||||
|
@ -17,6 +18,10 @@ function isPyPyVersion(versionSpec: string) {
|
|||
return versionSpec.startsWith('pypy');
|
||||
}
|
||||
|
||||
function isGraalPyVersion(versionSpec: string) {
|
||||
return versionSpec.startsWith('graalpy');
|
||||
}
|
||||
|
||||
async function cacheDependencies(cache: string, pythonVersion: string) {
|
||||
const cacheDependencyPath =
|
||||
core.getInput('cache-dependency-path') || undefined;
|
||||
|
@ -106,6 +111,18 @@ async function run() {
|
|||
core.info(
|
||||
`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`
|
||||
);
|
||||
} else if (isGraalPyVersion(version)) {
|
||||
const installed = await finderGraalPy.findGraalPyVersion(
|
||||
version,
|
||||
arch,
|
||||
updateEnvironment,
|
||||
checkLatest,
|
||||
allowPreReleases
|
||||
);
|
||||
pythonVersion = `${installed}`;
|
||||
core.info(
|
||||
`Successfully set up GraalPy ${installed}`
|
||||
);
|
||||
} else {
|
||||
if (version.startsWith('2')) {
|
||||
core.warning(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue