Skip to content

Split the GH actions CI into multiple stages #39210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/tsc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "tsc",
"pattern": [
{
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),(\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,19 @@ jobs:
run: |
npm uninstall typescript --no-save
npm uninstall tslint --no-save
- name: npm install and test
run: |
npm install
npm update
npm test

- run: npm install
- run: npm update

# Re: https://github.com/actions/setup-node/pull/125
- name: Register Problem Matcher for TSC
run: echo "##[add-matcher].github/tsc.json"

- name: Tests
run: npm test -- --no-lint

- name: Linter
run: npm run lint:ci

- name: Validate the browser can import TypeScript
run: gulp test-browser-integration

9 changes: 8 additions & 1 deletion Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ const eslint = (folder) => async () => {
"node_modules/eslint/bin/eslint",
"--cache",
"--cache-location", `${folder}/.eslintcache`,
"--format", "autolinkable-stylish",
"--rulesdir", "scripts/eslint/built/rules",
"--ext", ".ts",
];
Expand All @@ -363,6 +362,14 @@ const eslint = (folder) => async () => {
args.push("--fix");
}

// Use stylish format on CI, so that it can be picked up by GH Action's rule matchers
if (cmdLineOptions.ci) {
args.push("--format", "stylish");
}
else {
args.push("--format", "autolinkable-stylish");
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stylish:

/Users/ortatherox/dev/typescript/typescript-compiler/src/compiler/builderState.ts
  93:90  error  Missing semicolon  @typescript-eslint/semi
  94:83  error  Missing semicolon  @typescript-eslint/semi

Autolinkable Stylish

Error: /Users/ortatherox/dev/typescript/typescript-compiler/src/compiler/builderState.ts:93:90 @typescript-eslint/semi Missing semicolon.
Error: /Users/ortatherox/dev/typescript/typescript-compiler/src/compiler/builderState.ts:94:83 @typescript-eslint/semi Missing semicolon.

Stylish support is shipped with setup-node here: https://github.com/actions/setup-node/blob/master/.github/eslint-stylish.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this in the files tab of the PR:
Screen Shot 2020-06-23 at 1 37 29 PM

args.push(folder);

log(`Linting: ${args.join(" ")}`);
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/builderState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ namespace ts {
*/
function getReferencedFileFromImportedModuleSymbol(symbol: Symbol) {
if (symbol.declarations && symbol.declarations[0]) {
const declarationSourceFile = getSourceFileOfNode(symbol.declarations[0]);
return declarationSourceFile && declarationSourceFile.resolvedPath;
const declarationSourceFile = getSourceFileOfNode(symbol.declarations[0])
return declarationSourceFile && declarationSourceFile.resolvedPath
}
}

Expand Down