10000 Merge pull request #4 from actions/problem-matchers · kdheepak/setup-python@0c6bc55 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c6bc55

Browse files
author
Danny McCormick
authored
Merge pull request actions#4 from actions/problem-matchers
Problem matchers
2 parents 87886b8 + 60f686a commit 0c6bc55

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

.github/python.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": "python",
5+
"pattern": [
6+
{
7+
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
8+
"file": 1,
9+
"line": 2
10+
},
11+
{
12+
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
13+
"message": 2
14+
}
15+
]
16+
}
17+
]
18+
}

lib/setup-python.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
1717
Object.defineProperty(exports, "__esModule", { value: true });
1818
const core = __importStar(require("@actions/core"));
1919
const finder = __importStar(require("./find-python"));
20+
const path = __importStar(require("path"));
2021
function run() {
2122
return __awaiter(this, void 0, void 0, function* () {
2223
try {
@@ -25,6 +26,8 @@ function run() {
2526
const arch = core.getInput('architecture', { required: true });
2627
yield finder.findPythonVersion(version, arch);
2728
}
29+
const matchersPath = path.join(__dirname, '..', '.github');
30+
console.log(`##[add-matcher]${path.join(matchersPath, 'python.json')}`);
2831
}
2932
catch (err) {
3033
core.setFailed(err.message);

src/setup-python.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as core from '@actions/core';
22
import * as finder from './find-python';
3+
import * as path from 'path';
34

45
async function run() {
56
try {
@@ -8,6 +9,8 @@ async function run() {
89
const arch: string = core.getInput('architecture', {required: true});
910
await finder.findPythonVersion(version, arch);
1011
}
12+
const matchersPath = path.join(__dirname, '..', '.github');
13+
console.log(`##[add-matcher]${path.join(matchersPath, 'python.json')}`);
1114
} catch (err) {
1215
core.setFailed(err.message);
1316
}

0 commit comments

Comments
 (0)
0