Update action to node20 (#772)

This commit is contained in:
Dmitry Shibanov 2023-12-05 14:52:09 +01:00 committed by GitHub
parent 0ae58361cd
commit 0a5c615913
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 59993 additions and 18727 deletions

View file

@ -13,3 +13,5 @@ jobs:
call-basic-validation:
name: Basic validation
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
with:
node-version: '20.x'

View file

@ -15,3 +15,5 @@ jobs:
call-check-dist:
name: Check dist/
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
with:
node-version: '20.x'

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/@fastify/busboy.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/undici-types.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/undici.dep.yml generated Normal file

Binary file not shown.

View file

@ -1,7 +1,7 @@
import fs from 'fs';
import {HttpClient} from '@actions/http-client';
import * as ifm from '@actions/http-client/interfaces';
import * as ifm from '@actions/http-client/lib/interfaces';
import * as tc from '@actions/tool-cache';
import * as exec from '@actions/exec';
import * as core from '@actions/core';
@ -179,7 +179,7 @@ describeSkipOnWindows('findGraalPyVersion', () => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient.mockImplementation(
async (): Promise<ifm.ITypedResponse<IGraalPyManifestRelease[]>> => {
async (): Promise<ifm.TypedResponse<IGraalPyManifestRelease[]>> => {
const result = JSON.stringify(manifestData);
return {
statusCode: 200,

View file

@ -2,7 +2,7 @@ import fs from 'fs';
import * as utils from '../src/utils';
import {HttpClient} from '@actions/http-client';
import * as ifm from '@actions/http-client/interfaces';
import * as ifm from '@actions/http-client/lib/interfaces';
import * as tc from '@actions/tool-cache';
import * as exec from '@actions/exec';
import * as core from '@actions/core';
@ -240,7 +240,7 @@ describe('findPyPyVersion', () => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient.mockImplementation(
async (): Promise<ifm.ITypedResponse<IPyPyManifestRelease[]>> => {
async (): Promise<ifm.TypedResponse<IPyPyManifestRelease[]>> => {
const result = JSON.stringify(manifestData);
return {
statusCode: 200,

View file

@ -1,7 +1,7 @@
import fs from 'fs';
import {HttpClient} from '@actions/http-client';
import * as ifm from '@actions/http-client/interfaces';
import * as ifm from '@actions/http-client/lib/interfaces';
import * as tc from '@actions/tool-cache';
import * as exec from '@actions/exec';
import * as core from '@actions/core';
@ -169,7 +169,7 @@ describeSkipOnWindows('installGraalPy', () => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient.mockImplementation(
async (): Promise<ifm.ITypedResponse<IGraalPyManifestRelease[]>> => {
async (): Promise<ifm.TypedResponse<IGraalPyManifestRelease[]>> => {
const result = JSON.stringify(manifestData);
return {
statusCode: 200,

View file

@ -1,7 +1,7 @@
import fs from 'fs';
import {HttpClient} from '@actions/http-client';
import * as ifm from '@actions/http-client/interfaces';
import * as ifm from '@actions/http-client/lib/interfaces';
import * as tc from '@actions/tool-cache';
import * as exec from '@actions/exec';
import * as core from '@actions/core';
@ -265,7 +265,7 @@ describe('installPyPy', () => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient.mockImplementation(
async (): Promise<ifm.ITypedResponse<IPyPyManifestRelease[]>> => {
async (): Promise<ifm.TypedResponse<IPyPyManifestRelease[]>> => {
const result = JSON.stringify(manifestData);
return {
statusCode: 200,

View file

@ -34,7 +34,7 @@ outputs:
python-path:
description: "The absolute path to the Python or PyPy executable."
runs:
using: 'node16'
using: 'node20'
main: 'dist/setup/index.js'
post: 'dist/cache-save/index.js'
post-if: success()

35491
dist/cache-save/index.js vendored

File diff suppressed because one or more lines are too long

37282
dist/setup/index.js vendored

File diff suppressed because one or more lines are too long

5877
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "setup-python",
"version": "4.0.0",
"version": "5.0.0",
"private": true,
"description": "Setup python action",
"main": "dist/index.js",
@ -11,7 +11,7 @@
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
"lint:fix": "eslint --config ./.eslintrc.js \"**/*.ts\" --fix",
"release": "ncc build -o dist/setup src/setup-python.ts && ncc build -o dist/cache-save src/cache-save.ts && git add -f dist/",
"test": "jest --coverage"
"test": "jest --runInBand --coverage"
},
"repository": {
"type": "git",
@ -28,16 +28,16 @@
"@actions/cache": "^3.0.4",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.0",
"@actions/glob": "^0.2.0",
"@actions/http-client": "^1.0.11",
"@actions/glob": "^0.4.0",
"@actions/http-client": "^2.2.0",
"@actions/io": "^1.0.2",
"@actions/tool-cache": "^1.5.5",
"@actions/tool-cache": "^2.0.1",
"@iarna/toml": "^2.2.5",
"semver": "^7.5.2"
},
"devDependencies": {
"@types/jest": "^29.5.6",
"@types/node": "^16.11.25",
"@types/node": "^20.9.1",
"@types/semver": "^7.1.0",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
@ -46,17 +46,10 @@
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-node": "^11.1.0",
"husky": "^7.0.2",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"prettier": "^2.8.4",
"ts-jest": "^29.1.1",
"typescript": "^4.2.3"
},
"husky": {
"skipCI": true,
"hooks": {
"pre-commit": "npm run build && npm run format-check"
}
"typescript": "^5.2.2"
}
}

View file

@ -4,11 +4,18 @@ import * as cache from '@actions/cache';
import fs from 'fs';
import {State} from './cache-distributions/cache-distributor';
export async function run() {
// Added early exit to resolve issue with slow post action step:
// - https://github.com/actions/setup-node/issues/878
// https://github.com/actions/cache/pull/1217
export async function run(earlyExit?: boolean) {
try {
const cache = core.getInput('cache');
if (cache) {
await saveCache(cache);
if (earlyExit) {
process.exit(0);
}
}
} catch (error) {
const err = error as Error;
@ -76,4 +83,4 @@ function isCacheDirectoryExists(cacheDirectory: string[]) {
return result;
}
run();
run(true);

View file

@ -4,9 +4,11 @@ import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';
import * as semver from 'semver';
import * as httpm from '@actions/http-client';
import * as ifm from '@actions/http-client/interfaces';
import * as ifm from '@actions/http-client/lib/interfaces';
import * as exec from '@actions/exec';
import fs from 'fs';
import * as http from 'http';
import {
IS_WINDOWS,
@ -108,7 +110,7 @@ export async function installGraalPy(
export async function getAvailableGraalPyVersions() {
const http: httpm.HttpClient = new httpm.HttpClient('tool-cache');
const headers: ifm.IHeaders = {};
const headers: http.OutgoingHttpHeaders = {};
if (AUTH) {
headers.authorization = AUTH;
}
@ -117,7 +119,7 @@ export async function getAvailableGraalPyVersions() {
'https://api.github.com/repos/oracle/graalpython/releases';
const result: IGraalPyManifestRelease[] = [];
do {
const response: ifm.ITypedResponse<IGraalPyManifestRelease[]> =
const response: ifm.TypedResponse<IGraalPyManifestRelease[]> =
await http.getJson(url, headers);
if (!response.result) {
throw new Error(

View file

@ -6,7 +6,9 @@ import * as path from 'path';
import * as semver from 'semver';
import * as toml from '@iarna/toml';
import * as exec from '@actions/exec';
import * as ifm from '@actions/http-client/interfaces';
import * as ifm from '@actions/http-client/lib/interfaces';
import * as http from 'http';
export const IS_WINDOWS = process.platform === 'win32';
export const IS_LINUX = process.platform === 'linux';
@ -290,8 +292,8 @@ export function getBinaryDirectory(installDir: string) {
/**
* Extract next page URL from a HTTP response "link" header. Such headers are used in GitHub APIs.
*/
export function getNextPageUrl<T>(response: ifm.ITypedResponse<T>) {
const responseHeaders = <ifm.IHeaders>response.headers;
export function getNextPageUrl<T>(response: ifm.TypedResponse<T>) {
const responseHeaders = <http.OutgoingHttpHeaders>response.headers;
const linkHeader = responseHeaders.link;
if (typeof linkHeader === 'string') {
for (const link of linkHeader.split(/\s*,\s*/)) {