introducing problem matchers
This commit is contained in:
		
							
								
								
									
										44
									
								
								.github/rust.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								.github/rust.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "problemMatcher": [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "owner": "cargo-common",
 | 
				
			||||||
 | 
					            "pattern": [
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    "regexp": "^(warning|warn|error)(\\[(\\S*)\\])?: (.*)$",
 | 
				
			||||||
 | 
					                    "severity": 1,
 | 
				
			||||||
 | 
					                    "message": 4,
 | 
				
			||||||
 | 
					                    "code": 3
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    "regexp": "^\\s+-->\\s(\\S+):(\\d+):(\\d+)$",
 | 
				
			||||||
 | 
					                    "file": 1,
 | 
				
			||||||
 | 
					                    "line": 2,
 | 
				
			||||||
 | 
					                    "column": 3
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "owner": "cargo-test",
 | 
				
			||||||
 | 
					            "pattern": [
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    "regexp": "^.*panicked\\s+at\\s+'(.*)',\\s+(.*):(\\d+):(\\d+)$",
 | 
				
			||||||
 | 
					                    "message": 1,
 | 
				
			||||||
 | 
					                    "file": 2,
 | 
				
			||||||
 | 
					                    "line": 3,
 | 
				
			||||||
 | 
					                    "column": 4
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "owner": "cargo-fmt",
 | 
				
			||||||
 | 
					            "pattern": [
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    "regexp": "^(Diff in (\\S+)) at line (\\d):",
 | 
				
			||||||
 | 
					                    "message": 1,
 | 
				
			||||||
 | 
					                    "file": 2,
 | 
				
			||||||
 | 
					                    "line": 3
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										11
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								README.md
									
									
									
									
									
								
							@@ -45,6 +45,17 @@ For more details, check out [`action.yml`].
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[`action.yml`]: https://github.com/hecrj/setup-rust-action/blob/master/action.yml
 | 
					[`action.yml`]: https://github.com/hecrj/setup-rust-action/blob/master/action.yml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Problem Matchers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This action registers the following [problem matchers](https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md) to surface relavant information inline with changeset diffs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* `cargo-common` matches common cases of errors and warnings
 | 
				
			||||||
 | 
					* `cargo-test` matches cargo test errors
 | 
				
			||||||
 | 
					* `cargo-fmt` matches rust format errors
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To disable any or all of these you can use the `remove-matcher` directive documented [here](https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Contributing / Feedback
 | 
					# Contributing / Feedback
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Contributions and feedback are welcome! Feel free to open any issues or pull
 | 
					Contributions and feedback are welcome! Feel free to open any issues or pull
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
 | 
				
			|||||||
const core = __importStar(require("@actions/core"));
 | 
					const core = __importStar(require("@actions/core"));
 | 
				
			||||||
const exec = __importStar(require("@actions/exec"));
 | 
					const exec = __importStar(require("@actions/exec"));
 | 
				
			||||||
const rustup = __importStar(require("./rustup"));
 | 
					const rustup = __importStar(require("./rustup"));
 | 
				
			||||||
 | 
					const path = __importStar(require("path"));
 | 
				
			||||||
function run() {
 | 
					function run() {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
@@ -38,6 +39,8 @@ function run() {
 | 
				
			|||||||
                ]);
 | 
					                ]);
 | 
				
			||||||
                yield exec.exec('rustup', ['default', version]);
 | 
					                yield exec.exec('rustup', ['default', version]);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            const matchersPath = path.join(__dirname, '..', '.github');
 | 
				
			||||||
 | 
					            console.log(`##[add-matcher]${path.join(matchersPath, 'go.json')}`);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        catch (error) {
 | 
					        catch (error) {
 | 
				
			||||||
            core.setFailed(error.message);
 | 
					            core.setFailed(error.message);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
import * as core from '@actions/core';
 | 
					import * as core from '@actions/core';
 | 
				
			||||||
import * as exec from '@actions/exec';
 | 
					import * as exec from '@actions/exec';
 | 
				
			||||||
import * as rustup from './rustup';
 | 
					import * as rustup from './rustup';
 | 
				
			||||||
import * as os from 'os';
 | 
					import * as path from 'path';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function run() {
 | 
					async function run() {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
@@ -30,6 +30,10 @@ async function run() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      await exec.exec('rustup', ['default', version]);
 | 
					      await exec.exec('rustup', ['default', version]);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const matchersPath = path.join(__dirname, '..', '.github');
 | 
				
			||||||
 | 
					    console.log(`##[add-matcher]${path.join(matchersPath, 'go.json')}`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  } catch (error) {
 | 
					  } catch (error) {
 | 
				
			||||||
    core.setFailed(error.message);
 | 
					    core.setFailed(error.message);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user