Skip to content

Commit d462fb2

Browse files
author
Orta Therox
authored
Split the GH actions CI into multiple stages (microsoft#39210)
* Split the GH actions CI into multiple stages * Add the -- for npm * Improve the CI reports * Use stylish formatting on CI * Break TSC instead * Try add the problem register for TSC only on node 12 * Fix GH Actions syntax maybe
1 parent d66db61 commit d462fb2

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

.github/tsc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "tsc",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),(\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"code": 5,
13+
"message": 6
14+
}
15+
]
16+
}
17+
]
18+
}

.github/workflows/ci.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,19 @@ jobs:
3030
run: |
3131
npm uninstall typescript --no-save
3232
npm uninstall tslint --no-save
33-
- name: npm install and test
34-
run: |
35-
npm install
36-
npm update
37-
npm test
38-
33+
- run: npm install
34+
- run: npm update
35+
36+
# Re: https://github.com/actions/setup-node/pull/125
37+
- name: Register Problem Matcher for TSC
38+
run: echo "##[add-matcher].github/tsc.json"
39+
40+
- name: Tests
41+
run: npm test -- --no-lint
42+
43+
- name: Linter
44+
run: npm run lint:ci
45+
3946
- name: Validate the browser can import TypeScript
4047
run: gulp test-browser-integration
4148

Gulpfile.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ const eslint = (folder) => async () => {
354354
"node_modules/eslint/bin/eslint",
355355
"--cache",
356356
"--cache-location", `${folder}/.eslintcache`,
357-
"--format", "autolinkable-stylish",
358357
"--rulesdir", "scripts/eslint/built/rules",
359358
"--ext", ".ts",
360359
];
@@ -363,11 +362,19 @@ const eslint = (folder) => async () => {
363362
args.push("--fix");
364363
}
365364

365+
// Use stylish format on CI, so that it can be picked up by GH Action's rule matchers
366+
if (cmdLineOptions.ci) {
367+
args.push("--format", "stylish");
368+
}
369+
else {
370+
args.push("--format", "autolinkable-stylish");
371+
}
372+
366373
args.push(folder);
367374

368375
log(`Linting: ${args.join(" ")}`);
369376
return exec(process.execPath, args);
370-
}
377+
};
371378

372379
const lintScripts = eslint("scripts");
373380
lintScripts.displayName = "lint-scripts";

0 commit comments

Comments
 (0)