mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-25 08:09:08 +07:00
Fix matchers and add tests
This commit is contained in:
24
src/configs/phpunit.json
Normal file
24
src/configs/phpunit.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "phpunit",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\d+\\)\\s.*$"
|
||||
},
|
||||
{
|
||||
"regexp": "^(.*)$",
|
||||
"message": 1
|
||||
},
|
||||
{
|
||||
"regexp": "^\\s*$"
|
||||
},
|
||||
{
|
||||
"regexp": "^(.*):(\\d+)$",
|
||||
"file": 1,
|
||||
"line": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -4,7 +4,7 @@ import * as config from './config';
|
||||
import * as coverage from './coverage';
|
||||
import * as extensions from './extensions';
|
||||
import * as utils from './utils';
|
||||
import {addMatchers} from './matchers';
|
||||
import * as matchers from './matchers';
|
||||
|
||||
/**
|
||||
* Build the script
|
||||
@ -26,6 +26,7 @@ export async function build(
|
||||
(await utils.getInput('ini-values', false)) ||
|
||||
(await utils.getInput('ini-values-csv', false));
|
||||
const coverage_driver: string = await utils.getInput('coverage', false);
|
||||
const setup_matchers: string = await utils.getInput('matchers', false);
|
||||
|
||||
let script: string = await utils.readScript(filename, version, os_version);
|
||||
if (extension_csv) {
|
||||
@ -69,8 +70,7 @@ export async function run(): Promise<void> {
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
addMatchers();
|
||||
await matchers.addMatchers();
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
@ -1,10 +1,18 @@
|
||||
import * as path from 'path';
|
||||
import * as utils from './utils';
|
||||
import * as io from '@actions/io';
|
||||
|
||||
/**
|
||||
* Add matches using the Actions Toolkit problem matchers syntax
|
||||
* https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md
|
||||
* Cache json files for problem matchers
|
||||
*/
|
||||
export function addMatchers(): void {
|
||||
const matchersPath = path.join(__dirname, '..', '.github/matchers');
|
||||
console.log(`##[add-matcher]${path.join(matchersPath, 'phpunit.json')}`);
|
||||
export async function addMatchers(): Promise<void> {
|
||||
const config_path = path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
'src',
|
||||
'configs',
|
||||
'phpunit.json'
|
||||
);
|
||||
const runner_dir: string = await utils.getInput('RUNNER_TOOL_CACHE', false);
|
||||
await io.cp(config_path, runner_dir);
|
||||
}
|
||||
|
Reference in New Issue
Block a user