Compare commits

..

2 Commits
v5 ... main

Author SHA1 Message Date
aparnajyothi-y
6ed2c67c8a
Fix for Candidate Not Iterable Error (#1082)
Some checks failed
Validate Python e2e / check-latest (ubuntu-22.04-arm, 3.13) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-22.04-arm, 3.9) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-24.04-arm, 3.10) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-24.04-arm, 3.11) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-24.04-arm, 3.12) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-24.04-arm, 3.13) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-24.04-arm, 3.9) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-latest, 3.10) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-latest, 3.11) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-latest, 3.12) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-latest, 3.13) (push) Waiting to run
Validate Python e2e / check-latest (ubuntu-latest, 3.9) (push) Waiting to run
Validate Python e2e / check-latest (windows-latest, 3.10) (push) Waiting to run
Validate Python e2e / check-latest (windows-latest, 3.11) (push) Waiting to run
Validate Python e2e / check-latest (windows-latest, 3.12) (push) Waiting to run
Validate Python e2e / check-latest (windows-latest, 3.13) (push) Waiting to run
Validate Python e2e / check-latest (windows-latest, 3.9) (push) Waiting to run
Validate Python e2e / setup-python-multiple-python-versions (macos-13) (push) Waiting to run
Validate Python e2e / setup-python-multiple-python-versions (macos-latest) (push) Waiting to run
Validate Python e2e / setup-python-multiple-python-versions (ubuntu-22.04) (push) Waiting to run
Validate Python e2e / setup-python-multiple-python-versions (ubuntu-22.04-arm) (push) Waiting to run
Validate Python e2e / setup-python-multiple-python-versions (ubuntu-24.04-arm) (push) Waiting to run
Validate Python e2e / setup-python-multiple-python-versions (ubuntu-latest) (push) Waiting to run
Validate Python e2e / setup-python-multiple-python-versions (windows-latest) (push) Waiting to run
Validate Python e2e / Setup ${{ matrix.python }} ${{ matrix.os }} (ubuntu-22.04, 3.11.9) (push) Failing after 3m25s
Validate Python e2e / Setup ${{ matrix.python }} ${{ matrix.os }} (ubuntu-22.04, 3.12.3) (push) Failing after 1m31s
Validate Python e2e / Setup ${{ matrix.python }} ${{ matrix.os }} (ubuntu-22.04, 3.13.2) (push) Failing after 31s
Validate Python e2e / Setup ${{ matrix.python }} ${{ matrix.os }} (ubuntu-22.04, 3.9.13) (push) Failing after 32s
Validate Python e2e / Setup ${{ matrix.python }} ${{ matrix.os }} (ubuntu-latest, 3.10.11) (push) Failing after 31s
Validate Python e2e / Setup ${{ matrix.python }} ${{ matrix.os }} (ubuntu-latest, 3.11.9) (push) Failing after 5s
* candidates not iterable

* update the error message

* update error to debug

* update debug to info

* error message updates
2025-04-17 08:55:44 -05:00
aparnajyothi-y
e348410e00
Remove Ubuntu 20.04 from workflows due to deprecation from 2025-04-15 (#1065)
Some checks failed
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-22.04, pypy3.10-v7.3.17) (push) Failing after 44m28s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-22.04, pypy3.11-v7.3.19) (push) Successful in 40m43s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-22.04, pypy3.9) (push) Successful in 8s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-2.7) (push) Successful in 7s
Validate PyPy e2e / Check non-eol ${{ matrix.pypy }} on ${{ matrix.os }} (ubuntu-22.04, pypy-2.7) (push) Successful in 8s
Validate PyPy e2e / Check non-eol ${{ matrix.pypy }} on ${{ matrix.os }} (ubuntu-22.04, pypy-3.10) (push) Successful in 3s
Validate PyPy e2e / Check non-eol ${{ matrix.pypy }} on ${{ matrix.os }} (ubuntu-22.04, pypy-3.11) (push) Successful in 4s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) (ubuntu-22.04, pypy2.7) (push) Successful in 3s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) (ubuntu-22.04, pypy3.10-nightly) (push) Failing after 11m33s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-2.7-v7.3.12rc1) (push) Successful in 29m5s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-2.7-v7.3.17) (push) Failing after 3h21m5s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-3.10) (push) Failing after 6m47s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-3.10-nightly) (push) Failing after 26m55s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-3.10-v7.3.16) (push) Failing after 3h17m19s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-3.10-v7.3.17) (push) Failing after 1m32s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-3.10-v7.3.x) (push) Failing after 31s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy-3.10-v7.x) (push) Failing after 32s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy3.10-v7.3.17) (push) Failing after 31s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy3.11-v7.3.19) (push) Failing after 31s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (ubuntu-latest, pypy3.9) (push) Failing after 32s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) (ubuntu-22.04, pypy3.11) (push) Failing after 31s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) (ubuntu-22.04, pypy3.9) (push) Failing after 32s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) (ubuntu-latest, pypy2.7) (push) Failing after 31s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) (ubuntu-latest, pypy3.10-nightly) (push) Failing after 26s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) (ubuntu-latest, pypy3.11) (push) Failing after 32s
Validate PyPy e2e / Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) (ubuntu-latest, pypy3.9) (push) Failing after 31s
Validate PyPy e2e / check-latest (ubuntu-22.04) (push) Failing after 31s
Validate PyPy e2e / check-latest (ubuntu-latest) (push) Failing after 32s
Validate PyPy e2e / setup-pypy-multiple-versions (ubuntu-22.04) (push) Failing after 31s
Validate PyPy e2e / setup-pypy-multiple-versions (ubuntu-latest) (push) Failing after 32s
* remove ubuntu-20.04

* check failure fix

* remove spaces

* npm run format-check
2025-04-11 13:36:23 -05:00
8 changed files with 93 additions and 24 deletions

View File

@ -78,8 +78,12 @@ jobs:
python-version: pypy-3.11-v7.x
- os: ubuntu-22.04
python-version: pypy-3.11-v7.x
- os: ubuntu-22.04-arm
python-version: pypy-3.10-v7.x
- os: ubuntu-22.04-arm
python-version: pypy-3.11-v7.x
- os: ubuntu-22.04-arm
python-version: pypy-3.10-v7.x
steps:
- uses: actions/checkout@v4
- name: Setup Python

View File

@ -19,7 +19,6 @@ jobs:
matrix:
operating-system:
[
ubuntu-20.04,
windows-latest,
ubuntu-22.04,
ubuntu-22.04-arm,

View File

@ -21,7 +21,6 @@ jobs:
os:
[
macos-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
ubuntu-24.04-arm,
@ -77,7 +76,6 @@ jobs:
os:
[
macos-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
ubuntu-24.04-arm,

View File

@ -24,7 +24,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
ubuntu-24.04-arm,
@ -142,7 +141,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
ubuntu-24.04-arm,
@ -177,7 +175,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
ubuntu-24.04-arm,
@ -220,7 +217,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
ubuntu-24.04-arm,

View File

@ -24,7 +24,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
@ -69,7 +68,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
@ -117,7 +115,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
@ -163,7 +160,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
@ -214,7 +210,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
@ -265,7 +260,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
@ -300,7 +294,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
@ -419,7 +412,6 @@ jobs:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,

View File

@ -8,10 +8,29 @@ import * as tc from '@actions/tool-cache';
jest.mock('@actions/http-client');
jest.mock('@actions/tool-cache');
const mockManifest = [{version: '1.0.0'}];
jest.mock('@actions/tool-cache', () => ({
getManifestFromRepo: jest.fn()
}));
const mockManifest = [
{
version: '1.0.0',
stable: true,
files: [
{
filename: 'tool-v1.0.0-linux-x64.tar.gz',
platform: 'linux',
arch: 'x64',
download_url: 'https://example.com/tool-v1.0.0-linux-x64.tar.gz'
}
]
}
];
describe('getManifest', () => {
beforeEach(() => {
jest.resetAllMocks();
});
it('should return manifest from repo', async () => {
(tc.getManifestFromRepo as jest.Mock).mockResolvedValue(mockManifest);
const manifest = await getManifest();

32
dist/setup/index.js vendored
View File

@ -97461,16 +97461,36 @@ function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) {
});
}
exports.findReleaseFromManifest = findReleaseFromManifest;
function isIToolRelease(obj) {
return (typeof obj === 'object' &&
obj !== null &&
typeof obj.version === 'string' &&
typeof obj.stable === 'boolean' &&
Array.isArray(obj.files) &&
obj.files.every((file) => typeof file.filename === 'string' &&
typeof file.platform === 'string' &&
typeof file.arch === 'string' &&
typeof file.download_url === 'string'));
}
function getManifest() {
return __awaiter(this, void 0, void 0, function* () {
try {
return yield getManifestFromRepo();
const repoManifest = yield getManifestFromRepo();
if (Array.isArray(repoManifest) &&
repoManifest.length &&
repoManifest.every(isIToolRelease)) {
return repoManifest;
}
throw new Error('The repository manifest is invalid or does not include any valid tool release (IToolRelease) entries.');
}
catch (err) {
core.debug('Fetching the manifest via the API failed.');
if (err instanceof Error) {
core.debug(err.message);
}
else {
core.error('An unexpected error occurred while fetching the manifest.');
}
}
return yield getManifestFromURL();
});
@ -97518,6 +97538,9 @@ function installPython(workingDirectory) {
}
function installCpythonFromRelease(release) {
return __awaiter(this, void 0, void 0, function* () {
if (!release.files || release.files.length === 0) {
throw new Error('No files found in the release to download.');
}
const downloadUrl = release.files[0].download_url;
core.info(`Download from "${downloadUrl}"`);
let pythonPath = '';
@ -97538,8 +97561,11 @@ function installCpythonFromRelease(release) {
catch (err) {
if (err instanceof tc.HTTPError) {
// Rate limit?
if (err.httpStatusCode === 403 || err.httpStatusCode === 429) {
core.info(`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`);
if (err.httpStatusCode === 403) {
core.error(`Received HTTP status code 403. This indicates a permission issue or restricted access.`);
}
else if (err.httpStatusCode === 429) {
core.info(`Received HTTP status code 429. This usually indicates the rate limit has been exceeded`);
}
else {
core.info(err.message);

View File

@ -5,6 +5,7 @@ import * as exec from '@actions/exec';
import * as httpm from '@actions/http-client';
import {ExecOptions} from '@actions/exec/lib/interfaces';
import {IS_WINDOWS, IS_LINUX, getDownloadFileName} from './utils';
import {IToolRelease} from '@actions/tool-cache';
const TOKEN = core.getInput('token');
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
@ -31,14 +32,41 @@ export async function findReleaseFromManifest(
return foundRelease;
}
function isIToolRelease(obj: any): obj is IToolRelease {
return (
typeof obj === 'object' &&
obj !== null &&
typeof obj.version === 'string' &&
typeof obj.stable === 'boolean' &&
Array.isArray(obj.files) &&
obj.files.every(
(file: any) =>
typeof file.filename === 'string' &&
typeof file.platform === 'string' &&
typeof file.arch === 'string' &&
typeof file.download_url === 'string'
)
);
}
export async function getManifest(): Promise<tc.IToolRelease[]> {
try {
return await getManifestFromRepo();
const repoManifest = await getManifestFromRepo();
if (
Array.isArray(repoManifest) &&
repoManifest.length &&
repoManifest.every(isIToolRelease)
) {
return repoManifest;
}
throw new Error(
'The repository manifest is invalid or does not include any valid tool release (IToolRelease) entries.'
);
} catch (err) {
core.debug('Fetching the manifest via the API failed.');
if (err instanceof Error) {
core.debug(err.message);
} else {
core.error('An unexpected error occurred while fetching the manifest.');
}
}
return await getManifestFromURL();
@ -93,6 +121,9 @@ async function installPython(workingDirectory: string) {
}
export async function installCpythonFromRelease(release: tc.IToolRelease) {
if (!release.files || release.files.length === 0) {
throw new Error('No files found in the release to download.');
}
const downloadUrl = release.files[0].download_url;
core.info(`Download from "${downloadUrl}"`);
@ -113,9 +144,13 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) {
} catch (err) {
if (err instanceof tc.HTTPError) {
// Rate limit?
if (err.httpStatusCode === 403 || err.httpStatusCode === 429) {
if (err.httpStatusCode === 403) {
core.error(
`Received HTTP status code 403. This indicates a permission issue or restricted access.`
);
} else if (err.httpStatusCode === 429) {
core.info(
`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`
`Received HTTP status code 429. This usually indicates the rate limit has been exceeded`
);
} else {
core.info(err.message);