mirror of
https://github.com/actions/setup-python.git
synced 2025-06-12 15:27:13 +02:00
Add GraalPy support (#694)
* Add support for graalpy * add graalpy test workflow * format, lint and build * symlink graalpy binaries names * fix macos names for graalpy * Don't attempt to update pip for graalpy * Remove test schedule * Extract common getBinaryDirectory function for PyPy and GraalPy * Clean up and format * Pass GitHub token to GraalPy queries * Utilize pagination when querying GraalPy GitHub releases * Build * Fix lint errors * Deal with possible multiple artifacts for a single releases * Skip few GraalPy tests on windows - we don't have a windows release yet * Fix GraalPy test on Mac OS * Build * Skip one more GraalPy test on windows --------- Co-authored-by: Michael Simacek <michael.simacek@oracle.com>
This commit is contained in:
@ -11,7 +11,8 @@ import {
|
||||
isCacheFeatureAvailable,
|
||||
getVersionInputFromFile,
|
||||
getVersionInputFromPlainFile,
|
||||
getVersionInputFromTomlFile
|
||||
getVersionInputFromTomlFile,
|
||||
getNextPageUrl
|
||||
} from '../src/utils';
|
||||
|
||||
jest.mock('@actions/cache');
|
||||
@ -136,3 +137,25 @@ describe('Version from file test', () => {
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('getNextPageUrl', () => {
|
||||
it('GitHub API pagination next page is parsed correctly', () => {
|
||||
function generateResponse(link: string) {
|
||||
return {
|
||||
statusCode: 200,
|
||||
result: null,
|
||||
headers: {
|
||||
link: link
|
||||
}
|
||||
};
|
||||
}
|
||||
const page1Links =
|
||||
'<https://api.github.com/repositories/129883600/releases?page=2>; rel="next", <https://api.github.com/repositories/129883600/releases?page=3>; rel="last"';
|
||||
expect(getNextPageUrl(generateResponse(page1Links))).toStrictEqual(
|
||||
'https://api.github.com/repositories/129883600/releases?page=2'
|
||||
);
|
||||
const page2Links =
|
||||
'<https://api.github.com/repositories/129883600/releases?page=1>; rel="prev", <https://api.github.com/repositories/129883600/releases?page=1>; rel="first"';
|
||||
expect(getNextPageUrl(generateResponse(page2Links))).toBeNull();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user