Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot] 8458c79bc9 Bump fast-xml-parser from 5.5.10 to 5.7.1
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 5.5.10 to 5.7.1.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.5.10...v5.7.1)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-version: 5.7.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 06:10:20 +00:00
18 changed files with 134 additions and 5681 deletions
+9 -9
View File
@@ -33,7 +33,7 @@ jobs:
]
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -60,7 +60,7 @@ jobs:
]
python-version: [3.13.1t, 3.13.2t, 3.13.5t]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
id: cache-pipenv
uses: ./
@@ -100,7 +100,7 @@ jobs:
]
python-version: [3.13.0, 3.13.1, 3.13.2]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Install poetry
run: pipx install poetry
- name: Init pyproject.toml
@@ -132,7 +132,7 @@ jobs:
]
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -160,7 +160,7 @@ jobs:
]
python-version: [3.13.1t, 3.13.2t, 3.13.5t]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
id: cache-pipenv
uses: ./
@@ -201,7 +201,7 @@ jobs:
]
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -229,7 +229,7 @@ jobs:
]
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -258,7 +258,7 @@ jobs:
]
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -284,7 +284,7 @@ jobs:
]
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
+9 -9
View File
@@ -49,7 +49,7 @@ jobs:
python-version: pypy-3.9-v7.x
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -88,7 +88,7 @@ jobs:
- os: ubuntu-22.04-arm
python-version: pypy-3.10-v7.x
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
id: cache-pipenv
uses: ./
@@ -143,7 +143,7 @@ jobs:
'3.13'
]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Install poetry
run: pipx install poetry
- name: Init pyproject.toml
@@ -189,7 +189,7 @@ jobs:
- os: macos-latest
python-version: pypy-3.9-v7.x
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -227,7 +227,7 @@ jobs:
- os: ubuntu-22.04-arm
python-version: pypy-3.11-v7.x
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
id: cache-pipenv
uses: ./
@@ -273,7 +273,7 @@ jobs:
]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -301,7 +301,7 @@ jobs:
]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -330,7 +330,7 @@ jobs:
]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
@@ -356,7 +356,7 @@ jobs:
]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python
uses: ./
with:
+1 -1
View File
@@ -29,7 +29,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: Run with setup-python 3.9.13
uses: ./
@@ -14,7 +14,7 @@ jobs:
steps:
- name: Checking out
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: Publish
id: publish
uses: actions/publish-immutable-action@v0.0.4
+3 -3
View File
@@ -35,7 +35,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.graalpy }}
id: setup-python
@@ -86,7 +86,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.graalpy }}
id: setup-python
@@ -108,7 +108,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup GraalPy and check latest
uses: ./
id: graalpy
+5 -5
View File
@@ -46,7 +46,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.pypy }}
id: setup-python
@@ -98,7 +98,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.pypy }}
id: setup-python
@@ -150,7 +150,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.pypy }}
id: setup-python
@@ -181,7 +181,7 @@ jobs:
macos-15-intel
]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup PyPy and check latest
uses: ./
with:
@@ -223,7 +223,7 @@ jobs:
macos-15-intel
]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup PyPy and check latest
uses: ./
with:
+15 -15
View File
@@ -33,7 +33,7 @@ jobs:
python: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.python }}
id: setup-python
@@ -70,7 +70,7 @@ jobs:
python: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: echo ${{ matrix.python }} > .python-version
@@ -110,7 +110,7 @@ jobs:
python: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: echo ${{ matrix.python }} > .python-version
@@ -148,7 +148,7 @@ jobs:
python: [3.13.0, 3.13.1, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: |
@@ -189,7 +189,7 @@ jobs:
python: [3.13.0, 3.13.1, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: |
@@ -230,7 +230,7 @@ jobs:
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-tool-versions-file ${{ matrix.python }}
run: |
@@ -261,7 +261,7 @@ jobs:
python: [3.13t, 3.14t-dev]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: |
@@ -301,7 +301,7 @@ jobs:
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: |
@@ -340,7 +340,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python 3.14.0-alpha.6
id: setup-python
@@ -377,7 +377,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python 3.14t-dev
id: setup-python
@@ -414,7 +414,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python 3.14t
id: setup-python
@@ -453,7 +453,7 @@ jobs:
python: [3.13.0t, 3.13.1t, 3.13.2t]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.python }}
id: setup-python
@@ -485,7 +485,7 @@ jobs:
]
python-version: [3.13t, 3.14t-dev]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python and check latest
id: setup-python
uses: ./
@@ -511,7 +511,7 @@ jobs:
macos-15-intel
]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python and check latest
id: setup-python
uses: ./
@@ -542,7 +542,7 @@ jobs:
python: [3.13.1, 3.13.2, 3.14-dev, 3.14.0-alpha.6]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.python }}
id: setup-python
uses: ./
+14 -14
View File
@@ -33,7 +33,7 @@ jobs:
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.python }}
id: setup-python
@@ -77,7 +77,7 @@ jobs:
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: echo ${{ matrix.python }} > .python-version
@@ -124,7 +124,7 @@ jobs:
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: echo ${{ matrix.python }} > .python-version
@@ -169,7 +169,7 @@ jobs:
python: [3.9.13, 3.10.11, 3.11.9, '==3.12.3', 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: |
@@ -219,7 +219,7 @@ jobs:
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: |
@@ -272,7 +272,7 @@ jobs:
python: graalpy-24.1.2
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-tool-versions-file ${{ matrix.python }}
run: |
@@ -303,7 +303,7 @@ jobs:
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: |
@@ -353,7 +353,7 @@ jobs:
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: build-version-file ${{ matrix.python }}
run: |
@@ -402,7 +402,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python 3.14.0-alpha.6
id: setup-python
@@ -445,7 +445,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python 3.14-dev
id: setup-python
@@ -482,7 +482,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python 3.14
id: setup-python
@@ -521,7 +521,7 @@ jobs:
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: setup-python ${{ matrix.python }}
id: setup-python
@@ -553,7 +553,7 @@ jobs:
]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python and check latest
uses: ./
with:
@@ -585,7 +585,7 @@ jobs:
macos-15-intel
]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v6
- name: Setup Python and check latest
uses: ./
with:
+13 -6
View File
@@ -190,12 +190,19 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
restoredKeys.forEach(restoredKey => {
if (restoredKey) {
const osSegment =
process.platform === 'linux' ? '-20.04-Ubuntu' : '';
const versionSuffix = packageManager === 'poetry' ? '-v2' : '';
expect(infoSpy).toHaveBeenCalledWith(
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${pythonVersion}-${packageManager}${versionSuffix}-${fileHash}`
);
if (process.platform === 'linux' && packageManager === 'pip') {
expect(infoSpy).toHaveBeenCalledWith(
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-${process.arch}-20.04-Ubuntu-python-${pythonVersion}-${packageManager}-${fileHash}`
);
} else if (packageManager === 'poetry') {
expect(infoSpy).toHaveBeenCalledWith(
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-${process.arch}-python-${pythonVersion}-${packageManager}-v2-${fileHash}`
);
} else {
expect(infoSpy).toHaveBeenCalledWith(
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-${process.arch}-python-${pythonVersion}-${packageManager}-${fileHash}`
);
}
} else {
expect(infoSpy).toHaveBeenCalledWith(
`${packageManager} cache is not found`
-5342
View File
File diff suppressed because it is too large Load Diff
+19 -114
View File
@@ -53813,7 +53813,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.State = void 0;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(37484));
const utils_1 = __nccwpck_require__(71798);
const constants_1 = __nccwpck_require__(10565);
var State;
(function (State) {
@@ -53830,28 +53829,6 @@ class CacheDistributor {
this.cacheDependencyPath = cacheDependencyPath;
}
async handleLoadedCache() { }
/**
* Builds the Linux distro portion of a cache key (e.g. `-26.04-Ubuntu`, `-9-rhel`).
* RHEL is keyed by major version since it ships one ABI-stable artifact per major.
*/
async getLinuxInfoKeySegment() {
if (!utils_1.IS_LINUX) {
return '';
}
const osInfo = await (0, utils_1.getOSInfo)();
if (!osInfo) {
return '';
}
// lsb_release reports RHEL as "RedHatEnterpriseLinux" while /etc/os-release
// reports it as "rhel"; normalize both to "rhel" so the key is consistent.
const normalizedName = osInfo.osName.toLowerCase();
const isRhel = normalizedName === 'rhel' || normalizedName.includes('redhat');
const osName = isRhel ? 'rhel' : osInfo.osName;
const osVersion = isRhel
? osInfo.osVersion.split('.')[0]
: osInfo.osVersion;
return `-${osVersion}-${osName}`;
}
async restoreCache() {
const { primaryKey, restoreKey } = await this.computeKeys();
if (primaryKey.endsWith('-')) {
@@ -54034,9 +54011,17 @@ class PipCache extends cache_distributor_1.default {
async computeKeys() {
const hash = (await glob.hashFiles(this.cacheDependencyPath)) ||
(await glob.hashFiles(this.cacheDependencyBackupPath));
const osSegment = await this.getLinuxInfoKeySegment();
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
const restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${this.pythonVersion}-${this.packageManager}`;
let primaryKey = '';
let restoreKey = '';
if (utils_1.IS_LINUX) {
const osInfo = await (0, utils_1.getLinuxInfo)();
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}`;
}
else {
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-python-${this.pythonVersion}-${this.packageManager}`;
}
return {
primaryKey,
restoreKey: [restoreKey]
@@ -54120,8 +54105,7 @@ class PipenvCache extends cache_distributor_1.default {
}
async computeKeys() {
const hash = await glob.hashFiles(this.patterns);
const osSegment = await this.getLinuxInfoKeySegment();
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
const restoreKey = undefined;
return {
primaryKey,
@@ -54213,9 +54197,8 @@ class PoetryCache extends cache_distributor_1.default {
}
async computeKeys() {
const hash = await glob.hashFiles(this.patterns);
const osSegment = await this.getLinuxInfoKeySegment();
// "v2" is here to invalidate old caches of this cache distributor, which were created broken:
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${this.pythonVersion}-${this.packageManager}-v2-${hash}`;
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-python-${this.pythonVersion}-${this.packageManager}-v2-${hash}`;
const restoreKey = undefined;
return {
primaryKey,
@@ -55292,8 +55275,6 @@ const core = __importStar(__nccwpck_require__(37484));
const tc = __importStar(__nccwpck_require__(33472));
const exec = __importStar(__nccwpck_require__(95236));
const httpm = __importStar(__nccwpck_require__(54844));
const fs = __importStar(__nccwpck_require__(79896));
const semver = __importStar(__nccwpck_require__(62088));
const utils_1 = __nccwpck_require__(71798);
const TOKEN = core.getInput('token');
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
@@ -55301,69 +55282,10 @@ const MANIFEST_REPO_OWNER = 'actions';
const MANIFEST_REPO_NAME = 'python-versions';
const MANIFEST_REPO_BRANCH = 'main';
exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
function getLinuxOsRelease() {
try {
const content = fs.readFileSync('/etc/os-release', 'utf8');
const lines = content.split('\n');
let id = '';
let versionId = '';
for (const line of lines) {
const parts = line.split('=');
if (parts.length === 2) {
const key = parts[0].trim();
const value = parts[1].trim().replace(/^"/, '').replace(/"$/, '');
if (key === 'ID')
id = value;
if (key === 'VERSION_ID')
versionId = value;
}
}
if (id && versionId) {
return { id, versionId };
}
return null;
}
catch {
return null;
}
}
function findRhelRelease(semanticVersionSpec, architecture, manifest, osVersion) {
for (const candidate of manifest) {
const version = candidate.version;
core.debug(`check ${version} satisfies ${semanticVersionSpec}`);
if (!semver.satisfies(version, semanticVersionSpec))
continue;
const file = candidate.files.find(item => {
core.debug(`${item.arch}===${architecture} && ${item.platform}===rhel && ${item.platform_version}===${osVersion}`);
const archMatch = item.arch === architecture;
const platformMatch = item.platform === 'rhel';
const versionMatch = !item.platform_version ||
item.platform_version === osVersion ||
osVersion.startsWith(item.platform_version);
return archMatch && platformMatch && versionMatch;
});
if (file) {
core.debug(`matched ${candidate.version}`);
const result = Object.assign({}, candidate);
result.files = [file];
return result;
}
}
return undefined;
}
async function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) {
if (!manifest) {
manifest = await getManifest();
}
// On RHEL, tc.findFromManifest() won't match because os.platform() returns 'linux'
// but manifest entries use platform 'rhel'. Use custom filtering for RHEL.
if (utils_1.IS_LINUX) {
const osRelease = getLinuxOsRelease();
if (osRelease && osRelease.id === 'rhel') {
core.debug(`Detected RHEL ${osRelease.versionId}, using custom manifest filtering`);
return findRhelRelease(semanticVersionSpec, architecture, manifest, osRelease.versionId);
}
}
const foundRelease = await tc.findFromManifest(semanticVersionSpec, false, manifest, architecture);
return foundRelease;
}
@@ -55821,29 +55743,12 @@ async function getMacOSInfo() {
return { osName: 'macOS', osVersion: macOSVersion };
}
async function getLinuxInfo() {
try {
const { stdout } = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
silent: true
});
const [osName, osVersion] = stdout.trim().split('\n');
core.debug(`OS Name: ${osName}, Version: ${osVersion}`);
return { osName, osVersion };
}
catch (err) {
core.debug(`lsb_release failed (${err.message}). Falling back to /etc/os-release.`);
const osReleaseContent = fs_1.default.readFileSync('/etc/os-release', 'utf8');
const osInfo = {};
osReleaseContent.split('\n').forEach(line => {
const [key, value] = line.split('=');
if (key && value) {
osInfo[key.trim()] = value.trim().replace(/"/g, '');
}
});
const osName = osInfo['ID'] || 'Linux';
const osVersion = osInfo['VERSION_ID'] || '';
core.debug(`OS Name: ${osName}, Version: ${osVersion}`);
return { osName, osVersion };
}
const { stdout } = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
silent: true
});
const [osName, osVersion] = stdout.trim().split('\n');
core.debug(`OS Name: ${osName}, Version: ${osVersion}`);
return { osName: osName, osVersion: osVersion };
}
async function getOSInfo() {
let osInfo;
+25 -12
View File
@@ -1512,6 +1512,18 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/@nodable/entities": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.1.0.tgz",
"integrity": "sha512-nyT7T3nbMyBI/lvr6L5TyWbFJAI9FTgVRakNoBqCD+PmID8DzFrrNdLLtHMwMszOtqZa8PAOV24ZqDnQrhQINA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/nodable"
}
],
"license": "MIT"
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -3109,9 +3121,9 @@
"license": "MIT"
},
"node_modules/fast-xml-builder": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.1.4.tgz",
"integrity": "sha512-f2jhpN4Eccy0/Uz9csxh3Nu6q4ErKxf0XIsasomfOihuSUa3/xw6w8dnOtCDgEItQFJG8KyXPzQXzcODDrrbOg==",
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.1.5.tgz",
"integrity": "sha512-4TJn/8FKLeslLAH3dnohXqE3QSoxkhvaMzepOIZytwJXZO69Bfz0HBdDHzOTOon6G59Zrk6VQ2bEiv1t61rfkA==",
"funding": [
{
"type": "github",
@@ -3124,9 +3136,9 @@
}
},
"node_modules/fast-xml-parser": {
"version": "5.5.10",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.5.10.tgz",
"integrity": "sha512-go2J2xODMc32hT+4Xr/bBGXMaIoiCwrwp2mMtAvKyvEFW6S/v5Gn2pBmE4nvbwNjGhpcAiOwEv7R6/GZ6XRa9w==",
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.7.1.tgz",
"integrity": "sha512-8Cc3f8GUGUULg34pBch/KGyPLglS+OFs05deyOlY7fL2MTagYPKrVQNmR1fLF/yJ9PH5ZSTd3YDF6pnmeZU+zA==",
"funding": [
{
"type": "github",
@@ -3135,9 +3147,10 @@
],
"license": "MIT",
"dependencies": {
"fast-xml-builder": "^1.1.4",
"path-expression-matcher": "^1.2.1",
"strnum": "^2.2.2"
"@nodable/entities": "^2.1.0",
"fast-xml-builder": "^1.1.5",
"path-expression-matcher": "^1.5.0",
"strnum": "^2.2.3"
},
"bin": {
"fxparser": "src/cli/cli.js"
@@ -4767,9 +4780,9 @@
}
},
"node_modules/path-expression-matcher": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.4.0.tgz",
"integrity": "sha512-s4DQMxIdhj3jLFWd9LxHOplj4p9yQ4ffMGowFf3cpEgrrJjEhN0V5nxw4Ye1EViAGDoL4/1AeO6qHpqYPOzE4Q==",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz",
"integrity": "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ==",
"funding": [
{
"type": "github",
@@ -1,6 +1,5 @@
import * as cache from '@actions/cache';
import * as core from '@actions/core';
import {getOSInfo, IS_LINUX} from '../utils';
import {CACHE_DEPENDENCY_BACKUP_PATH} from './constants';
export enum State {
@@ -23,33 +22,6 @@ abstract class CacheDistributor {
}>;
protected async handleLoadedCache() {}
/**
* Builds the Linux distro portion of a cache key (e.g. `-26.04-Ubuntu`, `-9-rhel`).
* RHEL is keyed by major version since it ships one ABI-stable artifact per major.
*/
protected async getLinuxInfoKeySegment(): Promise<string> {
if (!IS_LINUX) {
return '';
}
const osInfo = await getOSInfo();
if (!osInfo) {
return '';
}
// lsb_release reports RHEL as "RedHatEnterpriseLinux" while /etc/os-release
// reports it as "rhel"; normalize both to "rhel" so the key is consistent.
const normalizedName = osInfo.osName.toLowerCase();
const isRhel =
normalizedName === 'rhel' || normalizedName.includes('redhat');
const osName = isRhel ? 'rhel' : osInfo.osName;
const osVersion = isRhel
? osInfo.osVersion.split('.')[0]
: osInfo.osVersion;
return `-${osVersion}-${osName}`;
}
public async restoreCache() {
const {primaryKey, restoreKey} = await this.computeKeys();
if (primaryKey.endsWith('-')) {
+12 -4
View File
@@ -7,7 +7,7 @@ import * as path from 'path';
import os from 'os';
import CacheDistributor from './cache-distributor';
import {IS_WINDOWS} from '../utils';
import {getLinuxInfo, IS_LINUX, IS_WINDOWS} from '../utils';
import {CACHE_DEPENDENCY_BACKUP_PATH} from './constants';
class PipCache extends CacheDistributor {
@@ -62,9 +62,17 @@ class PipCache extends CacheDistributor {
const hash =
(await glob.hashFiles(this.cacheDependencyPath)) ||
(await glob.hashFiles(this.cacheDependencyBackupPath));
const osSegment = await this.getLinuxInfoKeySegment();
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
const restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${this.pythonVersion}-${this.packageManager}`;
let primaryKey = '';
let restoreKey = '';
if (IS_LINUX) {
const osInfo = await getLinuxInfo();
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}`;
} else {
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-python-${this.pythonVersion}-${this.packageManager}`;
}
return {
primaryKey,
+1 -2
View File
@@ -32,8 +32,7 @@ class PipenvCache extends CacheDistributor {
protected async computeKeys() {
const hash = await glob.hashFiles(this.patterns);
const osSegment = await this.getLinuxInfoKeySegment();
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
const restoreKey = undefined;
return {
primaryKey,
+1 -2
View File
@@ -46,9 +46,8 @@ class PoetryCache extends CacheDistributor {
protected async computeKeys() {
const hash = await glob.hashFiles(this.patterns);
const osSegment = await this.getLinuxInfoKeySegment();
// "v2" is here to invalidate old caches of this cache distributor, which were created broken:
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}${osSegment}-python-${this.pythonVersion}-${this.packageManager}-v2-${hash}`;
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-python-${this.pythonVersion}-${this.packageManager}-v2-${hash}`;
const restoreKey = undefined;
return {
primaryKey,
-85
View File
@@ -3,8 +3,6 @@ import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';
import * as exec from '@actions/exec';
import * as httpm from '@actions/http-client';
import * as fs from 'fs';
import * as semver from 'semver';
import {ExecOptions} from '@actions/exec/lib/interfaces';
import {IS_WINDOWS, IS_LINUX, getDownloadFileName} from './utils';
import {IToolRelease} from '@actions/tool-cache';
@@ -16,70 +14,6 @@ const MANIFEST_REPO_NAME = 'python-versions';
const MANIFEST_REPO_BRANCH = 'main';
export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
interface LinuxOsRelease {
id: string;
versionId: string;
}
function getLinuxOsRelease(): LinuxOsRelease | null {
try {
const content = fs.readFileSync('/etc/os-release', 'utf8');
const lines = content.split('\n');
let id = '';
let versionId = '';
for (const line of lines) {
const parts = line.split('=');
if (parts.length === 2) {
const key = parts[0].trim();
const value = parts[1].trim().replace(/^"/, '').replace(/"$/, '');
if (key === 'ID') id = value;
if (key === 'VERSION_ID') versionId = value;
}
}
if (id && versionId) {
return {id, versionId};
}
return null;
} catch {
return null;
}
}
function findRhelRelease(
semanticVersionSpec: string,
architecture: string,
manifest: tc.IToolRelease[],
osVersion: string
): tc.IToolRelease | undefined {
for (const candidate of manifest) {
const version = candidate.version;
core.debug(`check ${version} satisfies ${semanticVersionSpec}`);
if (!semver.satisfies(version, semanticVersionSpec)) continue;
const file = candidate.files.find(item => {
core.debug(
`${item.arch}===${architecture} && ${item.platform}===rhel && ${item.platform_version}===${osVersion}`
);
const archMatch = item.arch === architecture;
const platformMatch = item.platform === 'rhel';
const versionMatch =
!item.platform_version ||
item.platform_version === osVersion ||
osVersion.startsWith(item.platform_version);
return archMatch && platformMatch && versionMatch;
});
if (file) {
core.debug(`matched ${candidate.version}`);
const result = Object.assign({}, candidate);
result.files = [file];
return result;
}
}
return undefined;
}
export async function findReleaseFromManifest(
semanticVersionSpec: string,
architecture: string,
@@ -89,23 +23,6 @@ export async function findReleaseFromManifest(
manifest = await getManifest();
}
// On RHEL, tc.findFromManifest() won't match because os.platform() returns 'linux'
// but manifest entries use platform 'rhel'. Use custom filtering for RHEL.
if (IS_LINUX) {
const osRelease = getLinuxOsRelease();
if (osRelease && osRelease.id === 'rhel') {
core.debug(
`Detected RHEL ${osRelease.versionId}, using custom manifest filtering`
);
return findRhelRelease(
semanticVersionSpec,
architecture,
manifest,
osRelease.versionId
);
}
}
const foundRelease = await tc.findFromManifest(
semanticVersionSpec,
false,
@@ -115,7 +32,6 @@ export async function findReleaseFromManifest(
return foundRelease;
}
function isIToolRelease(obj: any): obj is IToolRelease {
return (
typeof obj === 'object' &&
@@ -132,7 +48,6 @@ function isIToolRelease(obj: any): obj is IToolRelease {
)
);
}
export async function getManifest(): Promise<tc.IToolRelease[]> {
try {
const repoManifest = await getManifestFromRepo();
+6 -29
View File
@@ -173,38 +173,15 @@ async function getMacOSInfo() {
}
export async function getLinuxInfo() {
try {
const {stdout} = await exec.getExecOutput(
'lsb_release',
['-i', '-r', '-s'],
{
silent: true
}
);
const {stdout} = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
silent: true
});
const [osName, osVersion] = stdout.trim().split('\n');
core.debug(`OS Name: ${osName}, Version: ${osVersion}`);
return {osName, osVersion};
} catch (err) {
core.debug(
`lsb_release failed (${(err as Error).message}). Falling back to /etc/os-release.`
);
const [osName, osVersion] = stdout.trim().split('\n');
const osReleaseContent = fs.readFileSync('/etc/os-release', 'utf8');
const osInfo: {[key: string]: string} = {};
core.debug(`OS Name: ${osName}, Version: ${osVersion}`);
osReleaseContent.split('\n').forEach(line => {
const [key, value] = line.split('=');
if (key && value) {
osInfo[key.trim()] = value.trim().replace(/"/g, '');
}
});
const osName = osInfo['ID'] || 'Linux';
const osVersion = osInfo['VERSION_ID'] || '';
core.debug(`OS Name: ${osName}, Version: ${osVersion}`);
return {osName, osVersion};
}
return {osName: osName, osVersion: osVersion};
}
export async function getOSInfo() {