3
0
Fork 0
mirror of https://gitea.com/actions/setup-go.git synced 2024-11-22 01:29:32 +01:00

Add problem matcher

This commit is contained in:
Danny McCormick 2019-06-20 13:51:56 -04:00
parent 886b49b2b3
commit 5f2246e3c5
4 changed files with 28 additions and 7 deletions

16
.github/go.json vendored Normal file
View file

@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "go",
"pattern": [
{
"regexp": "^([^:]*: )?((.:)?[^:]*):(\\d+)(:(\\d+))?: (.*)$",
"file": 2,
"line": 4,
"column": 6,
"message": 7
}
]
}
]
}

View file

@ -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

View file

@ -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 {
@ -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);

View file

@ -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 {
@ -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);
}