mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
Update multiple packages and configs
This commit is contained in:
parent
81fcbf17a9
commit
57e5862411
8 changed files with 5212 additions and 14306 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
dist/
|
dist/
|
||||||
lib/
|
lib/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
jest.config.js
|
||||||
|
|
|
||||||
110
.eslintrc.json
110
.eslintrc.json
|
|
@ -1,57 +1,57 @@
|
||||||
{
|
{
|
||||||
"plugins": ["jest", "@typescript-eslint"],
|
"plugins": ["jest", "@typescript-eslint"],
|
||||||
"extends": ["plugin:github/recommended"],
|
"extends": ["plugin:github/recommended"],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 9,
|
"ecmaVersion": 9,
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"project": "./tsconfig.json"
|
"project": "./tsconfig.json"
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"camelcase": "off",
|
"i18n-text/no-en": "off",
|
||||||
"eslint-comments/no-use": "off",
|
"eslint-comments/no-use": "off",
|
||||||
"import/no-namespace": "off",
|
"import/no-namespace": "off",
|
||||||
"no-shadow": "off",
|
"no-shadow": "off",
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"prefer-template": "off",
|
"prefer-template": "off",
|
||||||
"semi": [ "error", "never"],
|
"@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}],
|
||||||
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
|
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
|
||||||
"@typescript-eslint/array-type": "error",
|
"@typescript-eslint/no-require-imports": "error",
|
||||||
"@typescript-eslint/await-thenable": "error",
|
"@typescript-eslint/array-type": "error",
|
||||||
"@typescript-eslint/ban-ts-comment": "error",
|
"@typescript-eslint/await-thenable": "error",
|
||||||
"@typescript-eslint/consistent-type-assertions": "error",
|
"@typescript-eslint/ban-ts-comment": "error",
|
||||||
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
|
"camelcase": "off",
|
||||||
"@typescript-eslint/func-call-spacing": ["error", "never"],
|
"@typescript-eslint/consistent-type-assertions": "error",
|
||||||
"@typescript-eslint/no-array-constructor": "error",
|
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
|
||||||
"@typescript-eslint/no-empty-interface": "error",
|
"@typescript-eslint/func-call-spacing": ["error", "never"],
|
||||||
"@typescript-eslint/no-explicit-any": "error",
|
"@typescript-eslint/no-array-constructor": "error",
|
||||||
"@typescript-eslint/no-extraneous-class": "error",
|
"@typescript-eslint/no-empty-interface": "error",
|
||||||
"@typescript-eslint/no-for-in-array": "error",
|
"@typescript-eslint/no-explicit-any": "error",
|
||||||
"@typescript-eslint/no-inferrable-types": "error",
|
"@typescript-eslint/no-extraneous-class": "error",
|
||||||
"@typescript-eslint/no-misused-new": "error",
|
"@typescript-eslint/no-for-in-array": "error",
|
||||||
"@typescript-eslint/no-namespace": "error",
|
"@typescript-eslint/no-inferrable-types": "error",
|
||||||
"@typescript-eslint/no-require-imports": "error",
|
"@typescript-eslint/no-misused-new": "error",
|
||||||
"@typescript-eslint/no-shadow": "error",
|
"@typescript-eslint/no-namespace": "error",
|
||||||
"@typescript-eslint/no-non-null-assertion": "warn",
|
"@typescript-eslint/no-non-null-assertion": "warn",
|
||||||
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
||||||
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
||||||
"@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}],
|
"@typescript-eslint/no-useless-constructor": "error",
|
||||||
"@typescript-eslint/no-useless-constructor": "error",
|
"@typescript-eslint/no-var-requires": "error",
|
||||||
"@typescript-eslint/no-var-requires": "error",
|
"@typescript-eslint/prefer-for-of": "warn",
|
||||||
"@typescript-eslint/prefer-for-of": "warn",
|
"@typescript-eslint/prefer-function-type": "warn",
|
||||||
"@typescript-eslint/prefer-function-type": "warn",
|
"@typescript-eslint/prefer-includes": "error",
|
||||||
"@typescript-eslint/prefer-includes": "error",
|
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
||||||
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
"@typescript-eslint/promise-function-async": "error",
|
||||||
"@typescript-eslint/promise-function-async": "error",
|
"@typescript-eslint/require-array-sort-compare": "error",
|
||||||
"@typescript-eslint/require-array-sort-compare": "error",
|
"@typescript-eslint/restrict-plus-operands": "error",
|
||||||
"@typescript-eslint/restrict-plus-operands": "error",
|
"semi": "off",
|
||||||
"@typescript-eslint/semi": ["error", "never"],
|
"@typescript-eslint/semi": ["error", "never"],
|
||||||
"@typescript-eslint/type-annotation-spacing": "error",
|
"@typescript-eslint/type-annotation-spacing": "error",
|
||||||
"@typescript-eslint/unbound-method": "error"
|
"@typescript-eslint/unbound-method": "error"
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"node": true,
|
"node": true,
|
||||||
"es6": true,
|
"es6": true,
|
||||||
"jest/globals": true
|
"jest/globals": true
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
19351
package-lock.json
generated
19351
package-lock.json
generated
File diff suppressed because it is too large
Load diff
27
package.json
27
package.json
|
|
@ -32,7 +32,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.6",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/github": "^4.0.0",
|
"@actions/github": "^5.0.3",
|
||||||
"adm-zip": "^0.5.3",
|
"adm-zip": "^0.5.3",
|
||||||
"fast-glob": "^3.2.5",
|
"fast-glob": "^3.2.5",
|
||||||
"got": "^11.8.2",
|
"got": "^11.8.2",
|
||||||
|
|
@ -40,26 +40,27 @@
|
||||||
"xml2js": "^0.4.23"
|
"xml2js": "^0.4.23"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@octokit/types": "^6.12.0",
|
"@octokit/types": "^7.1.0",
|
||||||
"@octokit/webhooks": "^7.21.0",
|
"@octokit/webhooks": "^10.1.5",
|
||||||
|
"@octokit/webhooks-types": "^6.3.6",
|
||||||
"@types/adm-zip": "^0.4.33",
|
"@types/adm-zip": "^0.4.33",
|
||||||
"@types/github-slugger": "^1.3.0",
|
"@types/github-slugger": "^1.3.0",
|
||||||
"@types/jest": "^26.0.20",
|
"@types/jest": "^28.1.7",
|
||||||
"@types/node": "^14.14.20",
|
"@types/node": "^18.7.7",
|
||||||
"@types/picomatch": "^2.2.1",
|
"@types/picomatch": "^2.2.1",
|
||||||
"@types/xml2js": "^0.4.8",
|
"@types/xml2js": "^0.4.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.16.1",
|
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
||||||
"@typescript-eslint/parser": "^4.16.1",
|
"@typescript-eslint/parser": "^5.33.1",
|
||||||
"@vercel/ncc": "^0.27.0",
|
"@vercel/ncc": "^0.27.0",
|
||||||
"eslint": "^7.21.0",
|
"eslint": "^8.22.0",
|
||||||
"eslint-plugin-github": "^4.1.2",
|
"eslint-plugin-github": "^4.1.2",
|
||||||
"eslint-plugin-jest": "^24.1.7",
|
"eslint-plugin-jest": "^26.8.3",
|
||||||
"jest": "^26.6.3",
|
"jest": "^28.1.3",
|
||||||
"jest-circus": "^26.6.3",
|
"jest-circus": "^28.1.3",
|
||||||
"jest-junit": "^12.0.0",
|
"jest-junit": "^14.0.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "2.2.1",
|
"prettier": "2.2.1",
|
||||||
"ts-jest": "^26.5.3",
|
"ts-jest": "^28.0.8",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4"
|
||||||
},
|
},
|
||||||
"jest-junit": {
|
"jest-junit": {
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export class ArtifactProvider implements InputProvider {
|
||||||
async load(): Promise<ReportInput> {
|
async load(): Promise<ReportInput> {
|
||||||
const result: ReportInput = {}
|
const result: ReportInput = {}
|
||||||
|
|
||||||
const resp = await this.octokit.actions.listWorkflowRunArtifacts({
|
const resp = await this.octokit.rest.actions.listWorkflowRunArtifacts({
|
||||||
...github.context.repo,
|
...github.context.repo,
|
||||||
run_id: this.runId
|
run_id: this.runId
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ class TestReporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(`Creating check run ${name}`)
|
core.info(`Creating check run ${name}`)
|
||||||
const createResp = await this.octokit.checks.create({
|
const createResp = await this.octokit.rest.checks.create({
|
||||||
head_sha: this.context.sha,
|
head_sha: this.context.sha,
|
||||||
name,
|
name,
|
||||||
status: 'in_progress',
|
status: 'in_progress',
|
||||||
|
|
@ -168,7 +168,7 @@ class TestReporter {
|
||||||
|
|
||||||
core.info('Creating report summary')
|
core.info('Creating report summary')
|
||||||
const {listSuites, listTests, onlySummary} = this
|
const {listSuites, listTests, onlySummary} = this
|
||||||
const baseUrl = createResp.data.html_url
|
const baseUrl = createResp.data.html_url as string
|
||||||
const summary = getReport(results, {listSuites, listTests, baseUrl, onlySummary})
|
const summary = getReport(results, {listSuites, listTests, baseUrl, onlySummary})
|
||||||
|
|
||||||
core.info('Creating annotations')
|
core.info('Creating annotations')
|
||||||
|
|
@ -179,7 +179,7 @@ class TestReporter {
|
||||||
const icon = isFailed ? Icon.fail : Icon.success
|
const icon = isFailed ? Icon.fail : Icon.success
|
||||||
|
|
||||||
core.info(`Updating check run conclusion (${conclusion}) and output`)
|
core.info(`Updating check run conclusion (${conclusion}) and output`)
|
||||||
const resp = await this.octokit.checks.update({
|
const resp = await this.octokit.rest.checks.update({
|
||||||
check_run_id: createResp.data.id,
|
check_run_id: createResp.data.id,
|
||||||
conclusion,
|
conclusion,
|
||||||
status: 'completed',
|
status: 'completed',
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import {createWriteStream} from 'fs'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import {GitHub} from '@actions/github/lib/utils'
|
import {GitHub} from '@actions/github/lib/utils'
|
||||||
import {EventPayloads} from '@octokit/webhooks'
|
import {PullRequest} from '@octokit/webhooks-types/schema.d'
|
||||||
import * as stream from 'stream'
|
import * as stream from 'stream'
|
||||||
import {promisify} from 'util'
|
import {promisify} from 'util'
|
||||||
import got from 'got'
|
import got from 'got'
|
||||||
|
|
@ -11,7 +11,7 @@ const asyncStream = promisify(stream.pipeline)
|
||||||
export function getCheckRunContext(): {sha: string; runId: number} {
|
export function getCheckRunContext(): {sha: string; runId: number} {
|
||||||
if (github.context.eventName === 'workflow_run') {
|
if (github.context.eventName === 'workflow_run') {
|
||||||
core.info('Action was triggered by workflow_run: using SHA and RUN_ID from triggering workflow')
|
core.info('Action was triggered by workflow_run: using SHA and RUN_ID from triggering workflow')
|
||||||
const event = github.context.payload as EventPayloads.WebhookPayloadWorkflowRun
|
const event = github.context.payload //as EventPayloads.WebhookPayloadWorkflowRun
|
||||||
if (!event.workflow_run) {
|
if (!event.workflow_run) {
|
||||||
throw new Error("Event of type 'workflow_run' is missing 'workflow_run' field")
|
throw new Error("Event of type 'workflow_run' is missing 'workflow_run' field")
|
||||||
}
|
}
|
||||||
|
|
@ -24,7 +24,7 @@ export function getCheckRunContext(): {sha: string; runId: number} {
|
||||||
const runId = github.context.runId
|
const runId = github.context.runId
|
||||||
if (github.context.payload.pull_request) {
|
if (github.context.payload.pull_request) {
|
||||||
core.info(`Action was triggered by ${github.context.eventName}: using SHA from head of source branch`)
|
core.info(`Action was triggered by ${github.context.eventName}: using SHA from head of source branch`)
|
||||||
const pr = github.context.payload.pull_request as EventPayloads.WebhookPayloadPullRequestPullRequest
|
const pr = github.context.payload.pull_request as PullRequest
|
||||||
return {sha: pr.head.sha, runId}
|
return {sha: pr.head.sha, runId}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ export async function downloadArtifact(
|
||||||
try {
|
try {
|
||||||
core.info(`Artifact ID: ${artifactId}`)
|
core.info(`Artifact ID: ${artifactId}`)
|
||||||
|
|
||||||
const req = octokit.actions.downloadArtifact.endpoint({
|
const req = octokit.rest.actions.downloadArtifact.endpoint({
|
||||||
...github.context.repo,
|
...github.context.repo,
|
||||||
artifact_id: artifactId,
|
artifact_id: artifactId,
|
||||||
archive_format: 'zip'
|
archive_format: 'zip'
|
||||||
|
|
@ -86,7 +86,7 @@ export async function downloadArtifact(
|
||||||
export async function listFiles(octokit: InstanceType<typeof GitHub>, sha: string): Promise<string[]> {
|
export async function listFiles(octokit: InstanceType<typeof GitHub>, sha: string): Promise<string[]> {
|
||||||
core.startGroup('Fetching list of tracked files from GitHub')
|
core.startGroup('Fetching list of tracked files from GitHub')
|
||||||
try {
|
try {
|
||||||
const commit = await octokit.git.getCommit({
|
const commit = await octokit.rest.git.getCommit({
|
||||||
commit_sha: sha,
|
commit_sha: sha,
|
||||||
...github.context.repo
|
...github.context.repo
|
||||||
})
|
})
|
||||||
|
|
@ -101,7 +101,7 @@ async function listGitTree(octokit: InstanceType<typeof GitHub>, sha: string, pa
|
||||||
const pathLog = path ? ` at ${path}` : ''
|
const pathLog = path ? ` at ${path}` : ''
|
||||||
core.info(`Fetching tree ${sha}${pathLog}`)
|
core.info(`Fetching tree ${sha}${pathLog}`)
|
||||||
let truncated = false
|
let truncated = false
|
||||||
let tree = await octokit.git.getTree({
|
let tree = await octokit.rest.git.getTree({
|
||||||
recursive: 'true',
|
recursive: 'true',
|
||||||
tree_sha: sha,
|
tree_sha: sha,
|
||||||
...github.context.repo
|
...github.context.repo
|
||||||
|
|
@ -109,7 +109,7 @@ async function listGitTree(octokit: InstanceType<typeof GitHub>, sha: string, pa
|
||||||
|
|
||||||
if (tree.data.truncated) {
|
if (tree.data.truncated) {
|
||||||
truncated = true
|
truncated = true
|
||||||
tree = await octokit.git.getTree({
|
tree = await octokit.rest.git.getTree({
|
||||||
tree_sha: sha,
|
tree_sha: sha,
|
||||||
...github.context.repo
|
...github.context.repo
|
||||||
})
|
})
|
||||||
|
|
@ -121,7 +121,7 @@ async function listGitTree(octokit: InstanceType<typeof GitHub>, sha: string, pa
|
||||||
if (tr.type === 'blob') {
|
if (tr.type === 'blob') {
|
||||||
result.push(file)
|
result.push(file)
|
||||||
} else if (tr.type === 'tree' && truncated) {
|
} else if (tr.type === 'tree' && truncated) {
|
||||||
const files = await listGitTree(octokit, tr.sha, `${file}/`)
|
const files = await listGitTree(octokit, tr.sha as string, `${file}/`)
|
||||||
result.push(...files)
|
result.push(...files)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||||
"lib": ["ES2019"],
|
|
||||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue