Skip to content

Commit

Permalink
Move matchers setup to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Oct 5, 2020
1 parent 1da4fe9 commit 30df32a
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 102 deletions.
41 changes: 0 additions & 41 deletions __tests__/matchers.test.ts

This file was deleted.

45 changes: 0 additions & 45 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,49 +977,6 @@ function toCommandValue(input) {
exports.toCommandValue = toCommandValue;
//# sourceMappingURL=utils.js.map

/***/ }),

/***/ 86:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.addMatchers = void 0;
const path = __importStar(__webpack_require__(622));
const utils = __importStar(__webpack_require__(163));
const io = __importStar(__webpack_require__(1));
/**
* Cache json files for problem matchers
*/
async function addMatchers() {
const config_path = path.join(__dirname, '..', 'src', 'configs');
const runner_dir = await utils.getInput('RUNNER_TOOL_CACHE', false);
await io.cp(path.join(config_path, 'phpunit.json'), runner_dir);
await io.cp(path.join(config_path, 'php.json'), runner_dir);
}
exports.addMatchers = addMatchers;


/***/ }),

/***/ 87:
Expand Down Expand Up @@ -2578,7 +2535,6 @@ const coverage = __importStar(__webpack_require__(635));
const extensions = __importStar(__webpack_require__(911));
const tools = __importStar(__webpack_require__(534));
const utils = __importStar(__webpack_require__(163));
const matchers = __importStar(__webpack_require__(86));
/**
* Build the script
*
Expand Down Expand Up @@ -2624,7 +2580,6 @@ async function run() {
const script = os_version + (await utils.scriptExtension(os_version));
const location = await getScript(script, version, os_version);
await exec_1.exec(await utils.joins(tool, location, version, __dirname));
await matchers.addMatchers();
}
catch (error) {
core.setFailed(error.message);
Expand Down
2 changes: 0 additions & 2 deletions src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as coverage from './coverage';
import * as extensions from './extensions';
import * as tools from './tools';
import * as utils from './utils';
import * as matchers from './matchers';

/**
* Build the script
Expand Down Expand Up @@ -62,7 +61,6 @@ export async function run(): Promise<void> {
const script = os_version + (await utils.scriptExtension(os_version));
const location = await getScript(script, version, os_version);
await exec(await utils.joins(tool, location, version, __dirname));
await matchers.addMatchers();
} catch (error) {
core.setFailed(error.message);
}
Expand Down
13 changes: 0 additions & 13 deletions src/matchers.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/scripts/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ setup_php() {
tick=""
cross=""
version=$1
dist=$2
nodot_version=${1/./}
old_versions="5.[3-5]"
tool_path_dir="/usr/local/bin"
Expand Down Expand Up @@ -305,4 +306,5 @@ scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
sudo mkdir -p "$ext_dir"
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
if [[ ! "$version" =~ $old_versions ]]; then configure_pecl >/dev/null 2>&1; fi
sudo mv "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
add_log "$tick" "PHP" "$status PHP $semver"
2 changes: 2 additions & 0 deletions src/scripts/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ tick="✓"
cross=""
pecl_config="false"
version=$1
dist=$2
master_version="8.0"
old_versions="5.[3-5]"
debconf_fix="DEBIAN_FRONTEND=noninteractive"
Expand Down Expand Up @@ -477,4 +478,5 @@ pecl_file="$scan_dir"/99-pecl.ini
echo '' | sudo tee "$pecl_file" >/dev/null 2>&1
sudo rm -rf /usr/local/bin/phpunit >/dev/null 2>&1
sudo chmod 777 "$ini_file" "$pecl_file" "$tool_path_dir"
sudo mv "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
add_log "$tick" "PHP" "$status PHP $semver"
3 changes: 2 additions & 1 deletion src/scripts/win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param (
[ValidateNotNull()]
[ValidateLength(1, [int]::MaxValue)]
[string]
$dir
$dist
)

# Function to log start of a operation.
Expand Down Expand Up @@ -396,4 +396,5 @@ if($version -eq "master") {
Set-PhpIniKey -Key 'opcache.jit' -Value '1235' -Path $php_dir
}
Update-PhpCAInfo -Path $php_dir -Source $cert_source
Move-Item -path $dist\..\src\configs\*.json -Destination $env:RUNNER_TOOL_CACHE
Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)"

0 comments on commit 30df32a

Please sign in to comment.