Skip to content

Commit 9aa0e78

Browse files
committed
Simplify CI detection
1 parent a35747c commit 9aa0e78

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
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
@@ -110,7 +110,6 @@
110110
"clean": "gulp clean",
111111
"gulp": "gulp",
112112
"lint": "gulp lint",
113-
"lint:ci": "gulp lint --ci",
114113
"setup-hooks": "node scripts/link-hooks.js"
115114
},
116115
"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", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
9+
boolean: ["dirty", "light", "colors", "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 */
@@ -32,12 +34,13 @@ module.exports = minimist(process.argv.slice(2), {
3234
light: process.env.light === undefined || process.env.light !== "false",
3335
reporter: process.env.reporter || process.env.r,
3436
fix: process.env.fix || process.env.f,
35-
workers: process.env.workerCount || ((os.cpus().length - (process.env.CI ? 0 : 1)) || 1),
37+
workers: process.env.workerCount || ((os.cpus().length - (ci ? 0 : 1)) || 1),
3638
failed: false,
3739
keepFailed: false,
3840
lkg: true,
3941
dirty: false,
40-
built: false
42+
built: false,
43+
ci,
4144
}
4245
});
4346

@@ -65,6 +68,7 @@ if (module.exports.built) {
6568
* @property {string|number} timeout
6669
* @property {boolean} failed
6770
* @property {boolean} keepFailed
71+
* @property {boolean} ci
6872
*
6973
* @typedef {import("minimist").ParsedArgs & TypedOptions} CommandLineOptions
7074
*/

scripts/build/tests.js

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

0 commit comments

Comments
 (0)