Skip to content

Commit

Permalink
Find PyPy in tool cache (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed May 13, 2024
1 parent 512e88b commit e08d83f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11951,7 +11951,7 @@ async function installRustTarget(target, toolchain) {
}
}
async function addToolCachePythonVersionsToPath() {
const allPythonVersions = tc.findAllVersions('python');
const allPythonVersions = tc.findAllVersions('Python');
for (const ver of allPythonVersions) {
const installDir = tc.find('Python', ver);
if (installDir) {
Expand All @@ -11960,6 +11960,15 @@ async function addToolCachePythonVersionsToPath() {
core.addPath(path.join(installDir, 'bin'));
}
}
const allPyPyVersions = tc.findAllVersions('PyPy');
for (const ver of allPyPyVersions) {
const installDir = tc.find('PyPy', ver);
if (installDir) {
core.info(`Python version ${ver} was found in the local cache`);
core.addPath(installDir);
core.addPath(path.join(installDir, 'bin'));
}
}
}
function setupSccacheEnv() {
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
Expand Down
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ async function installRustTarget(
}

async function addToolCachePythonVersionsToPath(): Promise<void> {
const allPythonVersions = tc.findAllVersions('python')
const allPythonVersions = tc.findAllVersions('Python')
for (const ver of allPythonVersions) {
const installDir = tc.find('Python', ver)
if (installDir) {
Expand All @@ -776,6 +776,15 @@ async function addToolCachePythonVersionsToPath(): Promise<void> {
core.addPath(path.join(installDir, 'bin'))
}
}
const allPyPyVersions = tc.findAllVersions('PyPy')
for (const ver of allPyPyVersions) {
const installDir = tc.find('PyPy', ver)
if (installDir) {
core.info(`Python version ${ver} was found in the local cache`)
core.addPath(installDir)
core.addPath(path.join(installDir, 'bin'))
}
}
}

function setupSccacheEnv(): void {
Expand Down

0 comments on commit e08d83f

Please sign in to comment.