mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 17:20:35 +08:00
CI: only enable why-is-node-running in GHA debug logging mode
This commit is contained in:
parent
7dfcf0f560
commit
44e6c3f062
@ -30,6 +30,7 @@ import { createSpan, printTraceResult, whyIsNodeRunning } from './trace';
|
|||||||
import { buildDeprecateFiles } from './build-deprecate-files';
|
import { buildDeprecateFiles } from './build-deprecate-files';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { ROOT_DIR } from './constants/dir';
|
import { ROOT_DIR } from './constants/dir';
|
||||||
|
import { isCI } from 'ci-info';
|
||||||
|
|
||||||
process.on('uncaughtException', (error) => {
|
process.on('uncaughtException', (error) => {
|
||||||
console.error('Uncaught exception:', error);
|
console.error('Uncaught exception:', error);
|
||||||
@ -69,7 +70,10 @@ const buildFinishedLock = path.join(ROOT_DIR, '.BUILD_FINISHED');
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// only enable why-is-node-running in GitHub Actions debug mode
|
||||||
|
if (isCI && process.env.RUNNER_DEBUG === '1') {
|
||||||
await import('why-is-node-running');
|
await import('why-is-node-running');
|
||||||
|
}
|
||||||
|
|
||||||
const downloadPreviousBuildPromise = downloadPreviousBuild(rootSpan);
|
const downloadPreviousBuildPromise = downloadPreviousBuild(rootSpan);
|
||||||
const buildCommonPromise = downloadPreviousBuildPromise.then(() => buildCommon(rootSpan));
|
const buildCommonPromise = downloadPreviousBuildPromise.then(() => buildCommon(rootSpan));
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { isCI } from 'ci-info';
|
||||||
import { noop } from 'foxts/noop';
|
import { noop } from 'foxts/noop';
|
||||||
import { basename, extname } from 'node:path';
|
import { basename, extname } from 'node:path';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
@ -134,9 +135,11 @@ export function task(importMetaMain: boolean, importMetaPath: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function whyIsNodeRunning() {
|
export async function whyIsNodeRunning() {
|
||||||
|
if (isCI && process.env.RUNNER_DEBUG === '1') {
|
||||||
const mod = await import('why-is-node-running');
|
const mod = await import('why-is-node-running');
|
||||||
return mod.default();
|
return mod.default();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// const isSpan = (obj: any): obj is Span => {
|
// const isSpan = (obj: any): obj is Span => {
|
||||||
// return typeof obj === 'object' && obj && spanTag in obj;
|
// return typeof obj === 'object' && obj && spanTag in obj;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user