Skip to content

Commit

Permalink
add tsc problem matcher for GH Actions ...
Browse files Browse the repository at this point in the history
that detects the correct line number.
This gives us nice annotations if any `tsc` errors occur in a PR, which
helps track down issues.
`actions/setup-node` already registers a `tsc` problem matcher, but
theirs doesn't respect line numbers
(actions/setup-node#97). Once that issue is
fixed we can revert this commit.
  • Loading branch information
marcelgerber committed Sep 5, 2020
1 parent c06f2a0 commit a6ad5c9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/problemMatchers/tsc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"problemMatcher": [
{
"owner": "tsc",
"pattern": [
{
"name": "tsc",
"regexp": "^([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+TS(\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
- name: Install dependencies
run: yarn --frozen-lockfile

- name: Register Problem Matcher
run: echo "##[add-matcher].github/problemMatchers/tsc.json"

- name: Run tests & checks
run: yarn testcheck

Expand Down

0 comments on commit a6ad5c9

Please sign in to comment.