From 0e4f033c24e06e5c1a91f6d31ab274c95efeb64f Mon Sep 17 00:00:00 2001 From: jjspace <8007967+jjspace@users.noreply.github.com> Date: Wed, 7 May 2025 13:52:05 -0400 Subject: [PATCH 1/2] only set up playwright when not in CI --- package.json | 2 +- scripts/isCI.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 scripts/isCI.js diff --git a/package.json b/package.json index 93ec4e85d67..c6e955342e8 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "yargs": "^17.0.1" }, "scripts": { - "prepare": "gulp prepare && husky && playwright install --with-deps", + "prepare": "gulp prepare && husky && node scripts/isCI.js || playwright install --with-deps", "start": "node server.js", "start-public": "node server.js --public", "build": "gulp build", diff --git a/scripts/isCI.js b/scripts/isCI.js new file mode 100644 index 00000000000..fe0786b9642 --- /dev/null +++ b/scripts/isCI.js @@ -0,0 +1,21 @@ +// Logic and values based on is-ci https://github.com/watson/is-ci/blob/master/bin.js +// which uses ci-info under the hood https://github.com/watson/ci-info/blob/master/index.js +// This just extracts the specific parts we need without adding more dependencies + +const { env } = process; + +const isCI = !!( + env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false' + (env.BUILD_ID || // Jenkins, Cloudbees + env.BUILD_NUMBER || // Jenkins, TeamCity + env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages + env.CI_APP_ID || // Appflow + env.CI_BUILD_ID || // Appflow + env.CI_BUILD_NUMBER || // Appflow + env.CI_NAME || // Codeship and others + env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI + env.RUN_ID || // TaskCluster, dsari + false) +); + +process.exit(isCI ? 0 : 1); From 55d6daebaef5a2317aa2ee686496b709a4a901a8 Mon Sep 17 00:00:00 2001 From: jjspace <8007967+jjspace@users.noreply.github.com> Date: Thu, 8 May 2025 11:57:17 -0400 Subject: [PATCH 2/2] we only care about GH CI --- scripts/isCI.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/isCI.js b/scripts/isCI.js index fe0786b9642..559a2e71535 100644 --- a/scripts/isCI.js +++ b/scripts/isCI.js @@ -6,16 +6,7 @@ const { env } = process; const isCI = !!( env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false' - (env.BUILD_ID || // Jenkins, Cloudbees - env.BUILD_NUMBER || // Jenkins, TeamCity - env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages - env.CI_APP_ID || // Appflow - env.CI_BUILD_ID || // Appflow - env.CI_BUILD_NUMBER || // Appflow - env.CI_NAME || // Codeship and others - env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI - env.RUN_ID || // TaskCluster, dsari - false) + env.CI // GitHub CI ); process.exit(isCI ? 0 : 1);