Skip to content

Commit 3c3820b

Browse files
authored
Simplify CI detection (#50661)
1 parent 9ac1fce commit 3c3820b

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- run: npm ci
4747

4848
- name: Linter
49-
run: npm run lint:ci
49+
run: npm run lint
5050

5151
browser-integration:
5252
runs-on: ubuntu-latest

Gulpfile.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,6 @@ const lint = eslint(".");
372372
lint.displayName = "lint";
373373
task("lint", lint);
374374
task("lint").description = "Runs eslint on the compiler and scripts sources.";
375-
task("lint").flags = {
376-
" --ci": "Runs eslint additional rules",
377-
};
378375

379376
const buildCancellationToken = () => buildProject("src/cancellationToken");
380377
const cleanCancellationToken = () => cleanProject("src/cancellationToken");

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
"clean": "gulp clean",
110110
"gulp": "gulp",
111111
"lint": "gulp lint",
112-
"lint:ci": "gulp lint --ci",
113112
"setup-hooks": "node scripts/link-hooks.js"
114113
},
115114
"browser": {

scripts/build/options.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
const minimist = require("minimist");
33
const os = require("os");
44

5+
const ci = ["1", "true"].includes(process.env.CI);
6+
57
/** @type {CommandLineOptions} */
68
module.exports = minimist(process.argv.slice(2), {
7-
boolean: ["dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
9+
boolean: ["dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built", "ci"],
810
string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
911
alias: {
1012
/* eslint-disable quote-props */
@@ -33,12 +35,13 @@ module.exports = minimist(process.argv.slice(2), {
3335
reporter: process.env.reporter || process.env.r,
3436
lint: process.env.lint || true,
3537
fix: process.env.fix || process.env.f,
36-
workers: process.env.workerCount || ((os.cpus().length - (process.env.CI ? 0 : 1)) || 1),
38+
workers: process.env.workerCount || ((os.cpus().length - (ci ? 0 : 1)) || 1),
3739
failed: false,
3840
keepFailed: false,
3941
lkg: true,
4042
dirty: false,
41-
built: false
43+
built: false,
44+
ci,
4245
}
4346
});
4447

@@ -67,6 +70,7 @@ if (module.exports.built) {
6770
* @property {string|number} timeout
6871
* @property {boolean} failed
6972
* @property {boolean} keepFailed
73+
* @property {boolean} ci
7074
*
7175
* @typedef {import("minimist").ParsedArgs & TypedOptions} CommandLineOptions
7276
*/

scripts/build/tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode)
123123
errorStatus = exitCode;
124124
error = new Error(`Process exited with status code ${errorStatus}.`);
125125
}
126-
else if (process.env.CI === "true") {
126+
else if (cmdLineOptions.ci) {
127127
// finally, do a sanity check and build the compiler with the built version of itself
128128
log.info("Starting sanity check build...");
129129
// Cleanup everything except lint rules (we'll need those later and would rather not waste time rebuilding them)

0 commit comments

Comments
 (0)