mirror of
https://github.com/audacity/audacity-actions.git
synced 2025-12-10 03:56:07 -06:00
Cache source packages in pip cache
This commit is contained in:
parent
cdc77d5b2f
commit
ffb1245b24
6
dist/generate_offline_dependencies/index.js
vendored
6
dist/generate_offline_dependencies/index.js
vendored
File diff suppressed because one or more lines are too long
@ -11,6 +11,9 @@ inputs:
|
||||
cmake_options:
|
||||
description: 'Additional options for the CMake'
|
||||
required: false
|
||||
additional_python_packages:
|
||||
description: "Additional Python packages to cache"
|
||||
required: false
|
||||
runs:
|
||||
using: 'node16'
|
||||
main: '../dist/generate_offline_dependencies/index.js'
|
||||
|
||||
@ -10,7 +10,8 @@ const generator = core.getInput('generator') || 'Unix Makefiles';
|
||||
const buildType = core.getInput('build_type') || 'Release';
|
||||
|
||||
async function run() {
|
||||
await offlineDependencies.prepareEnvironment();
|
||||
await offlineDependencies.prepareEnvironment(core.getMultilineInput('additional_python_packages'));
|
||||
|
||||
const tempPath = path.join(workspaceDir, '.offline', 'temp');
|
||||
|
||||
try {
|
||||
|
||||
@ -12,6 +12,15 @@ const conanVenvLocation = path.join(workspaceDir, '.venv');
|
||||
const conanCacheLocation = path.join(offlineCacheLocation, 'conan');
|
||||
const conanDownloadCacheLocation = path.join(conanCacheLocation, 'download_cache');
|
||||
|
||||
const packages = [
|
||||
'conan',
|
||||
'setuptools',
|
||||
'wheel',
|
||||
'Cython',
|
||||
'setuptools_scm',
|
||||
'flit_core'
|
||||
]
|
||||
|
||||
async function getPip() {
|
||||
try {
|
||||
await helpers.execWithLog('pip3', ['--version']);
|
||||
@ -32,10 +41,18 @@ async function getPython() {
|
||||
}
|
||||
}
|
||||
|
||||
async function prepareEnvironment() {
|
||||
async function prepareEnvironment(additionalPyhtonPackages) {
|
||||
let pip = await getPip();
|
||||
let python = await getPython();
|
||||
|
||||
// Predowload packages
|
||||
await helpers.execWithLog(pip, [
|
||||
'download',
|
||||
'--dest', pipDownloadCacheLocation,
|
||||
'--no-binary=:all:',
|
||||
...packages,
|
||||
...(additionalPyhtonPackages || [])
|
||||
]);
|
||||
// Prepare venev
|
||||
if (fs.existsSync(conanVenvLocation)) {
|
||||
await fs.promises.rm(conanVenvLocation, { recursive: true, force: true });
|
||||
@ -52,16 +69,10 @@ async function prepareEnvironment() {
|
||||
|
||||
await fs.promises.mkdir(pipDownloadCacheLocation, { recursive: true });
|
||||
|
||||
await helpers.execWithLog(pip, [
|
||||
'download',
|
||||
'--dest', pipDownloadCacheLocation,
|
||||
'conan==1.43.2', 'setuptools', 'wheel', 'Cython'
|
||||
]);
|
||||
|
||||
await helpers.execWithLog(pip, [
|
||||
'install', '--no-index',
|
||||
'--find-links', pipDownloadCacheLocation,
|
||||
'setuptools', 'wheel'
|
||||
'setuptools', 'wheel', 'Cython'
|
||||
]);
|
||||
|
||||
await helpers.execWithLog(pip, [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user