Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add problem matcher
  • Loading branch information
Danny McCormick committed Jun 20, 2019
1 parent 886b49b commit 5f2246e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/go.json
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "go",
"pattern": [
{
"regexp": "^([^:]*: )?((.:)?[^:]*):(\\d+)(:(\\d+))?: (.*)$",
"file": 2,
"line": 4,
"column": 6,
"message": 7
}
]
}
]
}
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@
This action sets by Go environment for use in actions by:

- optionally downloading and caching a version of Go
- TODO: registering problem matchers for error output
- registering problem matchers for error output
- TODO: configuring proxy if the runner is configured to use a proxy (coming with private runners)

# License
Expand Down
8 changes: 5 additions & 3 deletions lib/setup-go.js
Expand Up @@ -16,7 +16,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
// import * as installer from './installer';
const installer = __importStar(require("./installer"));
const path = __importStar(require("path"));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
Expand All @@ -26,10 +27,11 @@ function run() {
//
const version = core.getInput('version');
if (version) {
// await installer.getGo(version);
yield installer.getGo(version);
}
// TODO: setup proxy from runner proxy config
// TODO: problem matchers registered
const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'go.json')}`);
}
catch (error) {
core.setFailed(error.message);
Expand Down
9 changes: 6 additions & 3 deletions src/setup-go.ts
@@ -1,5 +1,6 @@
import * as core from '@actions/core';
// import * as installer from './installer';
import * as installer from './installer';
import * as path from 'path';

async function run() {
try {
Expand All @@ -9,11 +10,13 @@ async function run() {
//
const version = core.getInput('version');
if (version) {
// await installer.getGo(version);
await installer.getGo(version);
}

// TODO: setup proxy from runner proxy config
// TODO: problem matchers registered

const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'go.json')}`);
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit 5f2246e

Please sign in to comment.