Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f0e275979 | ||
|
|
4c3b4df0ad |
2
.github/workflows/CI.yml
vendored
2
.github/workflows/CI.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Apply problem matcher
|
||||
uses: ./
|
||||
with:
|
||||
build-directory: build/
|
||||
build-directory: ""
|
||||
|
||||
- name: Test problem matcher
|
||||
run: |
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# GCC problem matcher
|
||||
|
||||
# DO NOT COMMIT THIS LINE
|
||||
|
||||
Creates annotations for warnings and errors in gcc builds.
|
||||
|
||||
## Inputs
|
||||
|
||||
13
dist/gcc_matcher.jsontemplate
vendored
13
dist/gcc_matcher.jsontemplate
vendored
@@ -4,13 +4,12 @@
|
||||
"owner": "gcc-problem-matcher",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(${{ BASE }}\\/?)(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"fromPath": 1,
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"column": 4,
|
||||
"severity": 5,
|
||||
"message": 6
|
||||
"regexp": "^\\s*${{ BASE }}\/?(.*?):(\\d+):(\\d+):.*?(warning|error): (.*)$"
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
6
dist/index.js
vendored
6
dist/index.js
vendored
@@ -2848,7 +2848,7 @@ const core = __nccwpck_require__(127);
|
||||
// escapeRegExp :: string => string
|
||||
// escape all characters with special meanings in regexp
|
||||
const escapeRegExp = (s) =>
|
||||
s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\\\$&");
|
||||
s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\$&");
|
||||
|
||||
// variable :: string => RegExp
|
||||
// create regex to match ${{ key }}
|
||||
@@ -2859,12 +2859,12 @@ const variable = (key) =>
|
||||
const templatePath = __nccwpck_require__.ab + "gcc_matcher.jsontemplate";
|
||||
|
||||
// matcherPath :: string
|
||||
const outputPath = __nccwpck_require__.ab + "gcc_matcher.json";
|
||||
const matcherPath = __nccwpck_require__.ab + "gcc_matcher.json";
|
||||
|
||||
// rootdir :: string
|
||||
const rootdir = core.getInput('build-directory', {required: false});
|
||||
|
||||
// parse :: string => string => Error | null
|
||||
// parse :: IO() => IO() => Error | null
|
||||
const parse = (templatePath) => (matcherPath) => {
|
||||
const content = fs.readFileSync(templatePath, 'utf-8');
|
||||
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
"owner": "gcc-problem-matcher",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(${{ BASE }}\\/?)(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"fromPath": 1,
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"column": 4,
|
||||
"severity": 5,
|
||||
"message": 6
|
||||
"regexp": "^\\s*${{ BASE }}\/?(.*?):(\\d+):(\\d+):.*?(warning|error): (.*)$"
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ const core = require('@actions/core');
|
||||
// escapeRegExp :: string => string
|
||||
// escape all characters with special meanings in regexp
|
||||
const escapeRegExp = (s) =>
|
||||
s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\\\$&");
|
||||
s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\$&");
|
||||
|
||||
// variable :: string => RegExp
|
||||
// create regex to match ${{ key }}
|
||||
@@ -16,12 +16,12 @@ const variable = (key) =>
|
||||
const templatePath = path.join(__dirname, "gcc_matcher.jsontemplate");
|
||||
|
||||
// matcherPath :: string
|
||||
const outputPath = path.join(__dirname, "gcc_matcher.json");
|
||||
const matcherPath = path.join(__dirname, "gcc_matcher.json");
|
||||
|
||||
// rootdir :: string
|
||||
const rootdir = core.getInput('build-directory', {required: false});
|
||||
|
||||
// parse :: string => string => Error | null
|
||||
// parse :: IO() => IO() => Error | null
|
||||
const parse = (templatePath) => (matcherPath) => {
|
||||
const content = fs.readFileSync(templatePath, 'utf-8');
|
||||
|
||||
@@ -34,7 +34,7 @@ const parse = (templatePath) => (matcherPath) => {
|
||||
|
||||
// main:
|
||||
try {
|
||||
parse(templatePath)(outputPath);
|
||||
parse(templatePath)(matcherPath);
|
||||
} catch (err) {
|
||||
core.setFailed(`Action failed with error ${err}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user