1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-10 05:12:19 +02:00

perf: add dynamically loaded cache-dependencies module

This reduces the main bundle size by ⚠️  1.1 MB minified! This bundle is loaded only when caching is enabled.

The reason for this huge reduction is that caching dependencies uses the `@actions/cache` package, which is an extremely large package with big dependencies.

`setup-python` is used in `setup-cpp` as a library. This optimization reduces the bundle size for that package as well.
This commit is contained in:
Amin Yahyaabadi 2023-09-07 22:54:50 -07:00
parent 70dcb22d26
commit 9700887518
No known key found for this signature in database
GPG key ID: F52AF77F636088F0
6 changed files with 76155 additions and 99283 deletions

View file

@ -8,7 +8,6 @@ import path from 'path';
import {
validateVersion,
validatePythonVersionFormatForPyPy,
isCacheFeatureAvailable,
getVersionInputFromFile,
getVersionInputFromPlainFile,
getVersionInputFromTomlFile,
@ -16,6 +15,7 @@ import {
IS_WINDOWS,
getDownloadFileName
} from '../src/utils';
import {isCacheFeatureAvailable} from '../src/cache-dependencies';
jest.mock('@actions/cache');
jest.mock('@actions/core');