From f7f8dbaddf3868f88511cc091724ade373bc735b Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 14:43:29 -0400 Subject: [PATCH 01/10] Add matcher --- .github/python.json | 16 ++++++++++++++++ lib/setup-python.js | 3 +++ src/setup-python.ts | 3 +++ 3 files changed, 22 insertions(+) create mode 100644 .github/python.json diff --git a/.github/python.json b/.github/python.json new file mode 100644 index 0000000..8232713 --- /dev/null +++ b/.github/python.json @@ -0,0 +1,16 @@ +{ + "problemMatcher": [ + { + "owner": "python", + "pattern": [ + { + "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)\\s*raise\\s(.*)\\(\\'(.*)\\'\\)\\s*(.*)\\:\\s.*$", + "file": 1, + "line": 2, + "severity": 4, + "message": 5 + } + ] + } + ] +} diff --git a/lib/setup-python.js b/lib/setup-python.js index a2e5222..7b7fe07 100644 --- a/lib/setup-python.js +++ b/lib/setup-python.js @@ -17,6 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(require("@actions/core")); const finder = __importStar(require("./find-python")); +const path = __importStar(require("path")); function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -25,6 +26,8 @@ function run() { const arch = core.getInput('architecture', { required: true }); yield finder.findPythonVersion(version, arch); } + const matchersPath = path.join(__dirname, '..', '.github'); + console.log(`##[add-matcher]${path.join(matchersPath, 'python.json')}`); } catch (err) { core.setFailed(err.message); diff --git a/src/setup-python.ts b/src/setup-python.ts index 746c824..68540d8 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -1,5 +1,6 @@ import * as core from '@actions/core'; import * as finder from './find-python'; +import * as path from 'path'; async function run() { try { @@ -8,6 +9,8 @@ async function run() { const arch: string = core.getInput('architecture', {required: true}); await finder.findPythonVersion(version, arch); } + const matchersPath = path.join(__dirname, '..', '.github'); + console.log(`##[add-matcher]${path.join(matchersPath, 'python.json')}`); } catch (err) { core.setFailed(err.message); } From a907799389410d89abe837d71dffe7ffb00feac9 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 14:49:33 -0400 Subject: [PATCH 02/10] Start simple --- .github/python.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/python.json b/.github/python.json index 8232713..d2f9243 100644 --- a/.github/python.json +++ b/.github/python.json @@ -4,11 +4,9 @@ "owner": "python", "pattern": [ { - "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)\\s*raise\\s(.*)\\(\\'(.*)\\'\\)\\s*(.*)\\:\\s.*$", - "file": 1, - "line": 2, - "severity": 4, - "message": 5 + "regexp": "^\s*raise\s(.*)\(\'(.*)\'\)$", + "severity": 1, + "message": 2 } ] } From 05cb37363293f21e9764d2bcd401f707d96675fa Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 14:49:52 -0400 Subject: [PATCH 03/10] escaping --- .github/python.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/python.json b/.github/python.json index d2f9243..c8ac9cb 100644 --- a/.github/python.json +++ b/.github/python.json @@ -4,7 +4,7 @@ "owner": "python", "pattern": [ { - "regexp": "^\s*raise\s(.*)\(\'(.*)\'\)$", + "regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", "severity": 1, "message": 2 } From 6e3973ea1c197f9582b4e76372a90672aff2ed69 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 14:52:17 -0400 Subject: [PATCH 04/10] Little more complex --- .github/python.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/python.json b/.github/python.json index c8ac9cb..11a3967 100644 --- a/.github/python.json +++ b/.github/python.json @@ -4,9 +4,11 @@ "owner": "python", "pattern": [ { - "regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", - "severity": 1, - "message": 2 + "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", + "file": 1, + "line": 2, + "severity": 4, + "message": 5 } ] } From f2e7c5bedb8f9f6e4e8e3bf296cfcfb7ee447025 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 14:54:20 -0400 Subject: [PATCH 05/10] Simplify again --- .github/python.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/python.json b/.github/python.json index 11a3967..5323b3e 100644 --- a/.github/python.json +++ b/.github/python.json @@ -4,11 +4,9 @@ "owner": "python", "pattern": [ { - "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", + "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", "file": 1, - "line": 2, - "severity": 4, - "message": 5 + "line": 2 } ] } From 6c3425b8b761978281983200e23faea92b26839f Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 14:55:44 -0400 Subject: [PATCH 06/10] message placeholder --- .github/python.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/python.json b/.github/python.json index 5323b3e..126b65a 100644 --- a/.github/python.json +++ b/.github/python.json @@ -6,7 +6,8 @@ { "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", "file": 1, - "line": 2 + "line": 2, + "message": 3 } ] } From 0524204ca4439dd94be888c66058fb866398d6d7 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 15:02:46 -0400 Subject: [PATCH 07/10] multipart --- .github/python.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/python.json b/.github/python.json index 126b65a..ff5b1e9 100644 --- a/.github/python.json +++ b/.github/python.json @@ -6,8 +6,11 @@ { "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", "file": 1, - "line": 2, - "message": 3 + "line": 2 + }, + { + "regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", + "message": 4 } ] } From 7f7fc5b3760fa70f0966ec38fd173f2c8d467152 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 15:03:54 -0400 Subject: [PATCH 08/10] Wrong index --- .github/python.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/python.json b/.github/python.json index ff5b1e9..9c3095c 100644 --- a/.github/python.json +++ b/.github/python.json @@ -10,7 +10,7 @@ }, { "regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", - "message": 4 + "message": 2 } ] } From 3fb911cdc7ce3b1ed98a6b40d30406ac6363233e Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 15:06:11 -0400 Subject: [PATCH 09/10] Less escaping --- .github/python.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/python.json b/.github/python.json index 9c3095c..8d89933 100644 --- a/.github/python.json +++ b/.github/python.json @@ -4,7 +4,7 @@ "owner": "python", "pattern": [ { - "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", + "regexp": "^\\s*File\\s\"(.*)\",\\sline\\s(\\d+),\\sin\\s(.*)$", "file": 1, "line": 2 }, From 60f686a14891caf7b5c205c91e1413fdb0ff1684 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 8 Jul 2019 15:07:01 -0400 Subject: [PATCH 10/10] Update python.json --- .github/python.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/python.json b/.github/python.json index 8d89933..9c3095c 100644 --- a/.github/python.json +++ b/.github/python.json @@ -4,7 +4,7 @@ "owner": "python", "pattern": [ { - "regexp": "^\\s*File\\s\"(.*)\",\\sline\\s(\\d+),\\sin\\s(.*)$", + "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", "file": 1, "line": 2 },