From 03f36220f412696b8d3203667b6c266f1136a640 Mon Sep 17 00:00:00 2001 From: Dec Norton Date: Sun, 24 Nov 2019 16:35:21 +0000 Subject: [PATCH 1/9] Add PHPUnit problem matcher --- .github/matchers/phpunit.json | 24 ++++++++++++++++++++++++ __tests__/install.test.ts | 32 ++++++++++++++++++++++++++++++++ src/install.ts | 3 +++ src/matchers.ts | 10 ++++++++++ 4 files changed, 69 insertions(+) create mode 100644 .github/matchers/phpunit.json create mode 100644 src/matchers.ts diff --git a/.github/matchers/phpunit.json b/.github/matchers/phpunit.json new file mode 100644 index 00000000..44b9db6b --- /dev/null +++ b/.github/matchers/phpunit.json @@ -0,0 +1,24 @@ +{ + "problemMatcher": [ + { + "owner": "phpunit", + "pattern": [ + { + "regexp": "^\\d+\\)\\s.*$" + }, + { + "regexp": "^(.*)$", + "message": 1 + }, + { + "regexp": "^\\s*$" + }, + { + "regexp": "^(.*):(\\d+)$", + "file": 1, + "line": 2 + } + ] + } + ] +} diff --git a/__tests__/install.test.ts b/__tests__/install.test.ts index bbd93a49..df1eca42 100644 --- a/__tests__/install.test.ts +++ b/__tests__/install.test.ts @@ -1,4 +1,6 @@ import * as install from '../src/install'; +import * as matchers from '../src/matchers'; +import * as path from 'path'; /** * Mock install.ts @@ -143,4 +145,34 @@ describe('Install', () => { expect(script).toContain('set coverage driver'); expect(script).toContain('sh script.sh 7.3 ' + __dirname); }); + + describe('Matchers', () => { + let originalLogMethod: any; + let outputData: any[] = []; + + beforeAll(() => { + originalLogMethod = console.log; + console['log'] = jest.fn(inputs => outputData.push(inputs)); + }); + + beforeEach(() => { + outputData = []; + }); + + afterAll(() => { + console['log'] = originalLogMethod; + }); + + it('Add matchers', async () => { + matchers.addMatchers(); + + expect(outputData).toEqual([ + `##[add-matcher]${path.join( + __dirname, + '..', + '.github/matchers/phpunit.json' + )}` + ]); + }); + }); }); diff --git a/src/install.ts b/src/install.ts index 8fa60eee..6813ab01 100644 --- a/src/install.ts +++ b/src/install.ts @@ -4,6 +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'; /** * Build the script @@ -63,6 +64,8 @@ export async function run(): Promise { ); break; } + + addMatchers(); } catch (error) { core.setFailed(error.message); } diff --git a/src/matchers.ts b/src/matchers.ts new file mode 100644 index 00000000..18116ccb --- /dev/null +++ b/src/matchers.ts @@ -0,0 +1,10 @@ +import * as path from 'path'; + +/** + * Add matches using the Actions Toolkit problem matchers syntax + * https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md + */ +export function addMatchers(): void { + const matchersPath = path.join(__dirname, '..', '.github/matchers'); + console.log(`##[add-matcher]${path.join(matchersPath, 'phpunit.json')}`); +} From 2d3750b36e0f300f8ae827395a6bb9a9232a9141 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 18 Dec 2019 17:50:25 +0530 Subject: [PATCH 2/9] Install 64bit version of PHP on windows --- src/scripts/win32.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 28187395..4afaf75d 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -33,11 +33,13 @@ if (Test-Path -LiteralPath $php_dir -PathType Container) { } Step-Log "Setup PHP and Composer" if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.')))) { + $arch='x64' if ($version -lt '7.0') { Install-Module -Name VcRedist -Force + $arch='x86' } - Install-Php -Version $version -Architecture x86 -ThreadSafe $true -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1 + Install-Php -Version $version -Architecture $arch -ThreadSafe $true -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1 $installed = Get-Php -Path $php_dir $status = "Installed PHP $($installed.FullVersion)" } From 922f1e27b8f1471ce2f3737dee4cd6e7dfed92a7 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 18 Dec 2019 18:52:46 +0530 Subject: [PATCH 3/9] Set ProgressPreference to Silent in win32.ps1 --- src/scripts/win32.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 4afaf75d..d4e34ac7 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -5,6 +5,7 @@ param ( $tick = ([char]8730) $cross = ([char]10007) $php_dir = 'C:\tools\php' +$ProgressPreference = 'SilentlyContinue' Function Step-Log($message) { printf "\n\033[90;1m==> \033[0m\033[37;1m%s \033[0m\n" $message From c6ad3d1a70e50a3ebafc52827c927bab95bdfdcc Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 18 Dec 2019 21:44:02 +0530 Subject: [PATCH 4/9] Add 8.0 support on windows --- .github/workflows/experimental-workflow.yml | 11 ++++-- README.md | 40 ++++++++++++++++---- dist/index.js | 2 +- src/ext/php_pcov.dll | Bin 27136 -> 31744 bytes src/install.ts | 4 +- src/scripts/win32.ps1 | 19 +++++++--- 6 files changed, 56 insertions(+), 20 deletions(-) diff --git a/.github/workflows/experimental-workflow.yml b/.github/workflows/experimental-workflow.yml index 500e5b0e..6c867953 100644 --- a/.github/workflows/experimental-workflow.yml +++ b/.github/workflows/experimental-workflow.yml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-latest, ubuntu-16.04, macOS-latest] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] php-versions: ['8.0'] steps: - name: Checkout @@ -59,7 +59,7 @@ jobs: run: node dist/index.js env: php-version: ${{ matrix.php-versions }} - extensions: mbstring, xdebug, pcov #optional + extensions: mbstring, opcache, xdebug, pcov #optional ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #optional coverage: xdebug @@ -83,10 +83,13 @@ jobs: php -r "if(ini_get('post_max_size')!='256M') {throw new Exception('post_max_size not added');}" php -r "if(ini_get('short_open_tag')!=1) {throw new Exception('short_open_tag not added');}" php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}" - - name: Test and Benchmark JIT + - name: Test JIT run: | php -r "if(! extension_loaded('Zend OPcache')) {throw new Exception('Zend OPcache not found');}" php -r "if(ini_get('opcache.jit_buffer_size')!='256M') {throw new Exception('opcache.jit_buffer_size not set');}" php -r "if(ini_get('opcache.jit')!=1235) {throw new Exception('opcache.jit not set');}" php -r "if(ini_get('pcre.jit')!=1) {throw new Exception('pcre.jit not set');}" - curl https://raw.githubusercontent.com/php/php-src/master/Zend/bench.php | php \ No newline at end of file + - name: Benchmark JIT + run: | + curl -o bench.php https://raw.githubusercontent.com/php/php-src/master/Zend/bench.php + php bench.php \ No newline at end of file diff --git a/README.md b/README.md index ca7ff3b3..b19670d7 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,9 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support - [PCOV](#pcov) - [Disable coverage](#disable-coverage) - [Usage](#memo-usage) - - [Basic Usage](#basic-usage) - - [Matrix Testing](#matrix-testing) + - [Basic Setup](#basic-setup) + - [Matrix Setup](#matrix-setup) + - [Experimental Setup](#experimental-setup) - [Cache dependencies](#cache-dependencies) - [Examples](#examples) - [License](#scroll-license) @@ -47,7 +48,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support |7.4|`Stable`|`Active`| |8.0|`Experimental`|`In development`| -**Note:** Specifying `8.0` in `php-version` input installs `PHP 8.0.0-dev`. This is an experimental feature on this action available on `ubuntu` and `macOS`. Currently some extensions might not be available for this version. +**Note:** Specifying `8.0` in `php-version` input installs a nightly build of `PHP 8.0.0-dev` with `PHP JIT` support. See [experimental setup](#experimental-setup) for more information. ## :cloud: OS/Platform Support @@ -70,7 +71,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support ### Xdebug Specify `coverage: xdebug` to use `Xdebug`. -Runs on all [PHP versions supported](#tada-php-support "List of PHP versions supported on this GitHub Action") +Runs on all [PHP versions supported](#tada-php-support "List of PHP versions supported on this GitHub Action") except `8.0`. ```yaml uses: shivammathur/setup-php@v1 @@ -123,9 +124,9 @@ Inputs supported by this GitHub Action. See [action.yml](action.yml "Metadata for this GitHub Action") and usage below for more info. -### Basic Usage +### Basic Setup -> Setup a particular PHP version +> Setup a particular PHP version. ```yaml steps: @@ -142,9 +143,9 @@ steps: pecl: false #optional, setup PECL ``` -### Matrix Testing +### Matrix Setup -> Setup multiple PHP versions +> Setup multiple PHP versions on multiple operating systems. ```yaml jobs: @@ -169,6 +170,29 @@ jobs: pecl: false #optional, setup PECL ``` +### Experimental Setup + +> Setup a nightly build of `PHP 8.0.0-dev` from the [master branch](https://github.com/php/php-src/tree/master "Master branch on PHP source repository") of PHP. + +- This version is currently in development and is an experimental feature on this action. +- `PECL` is installed by default with this version on `ubuntu`. +- Some extensions might not support this version currently. +- Refer to this [RFC](https://wiki.php.net/rfc/jit "PHP JIT RFC configuration") for configuring `PHP JIT` on this version. + +```yaml +steps: +- name: Checkout + uses: actions/checkout@v1 + +- name: Setup PHP + uses: shivammathur/setup-php@v1 + with: + php-version: '8.0' + extensions: mbstring #optional, setup extensions + ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1 #optional, setup php.ini configuration + coverage: pcov #optional, setup PCOV, Xdebug does not support this version yet. +``` + ### Cache dependencies You can persist composer's internal cache directory using the [`action/cache`](https://github.com/actions/cache "GitHub Action to cache files") GitHub Action. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time. diff --git a/dist/index.js b/dist/index.js index 2deebbb8..97611682 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1848,7 +1848,7 @@ function run() { } case 'win32': script_path = yield build('win32.ps1', version, os_version); - yield exec_1.exec('pwsh ' + script_path + ' -version ' + version); + yield exec_1.exec('pwsh ' + script_path + ' -version ' + version + ' -dir ' + __dirname); break; } } diff --git a/src/ext/php_pcov.dll b/src/ext/php_pcov.dll index a63db08da2df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~72kcMVe` z$rnlnOLmuhz2y5Pua~@8GFhT>XdH7LS2?VXn;nA=+3|?upB&FQUUB@|@$Zf)ht|2k zdA+mHS>bd$H#%=~e!=-A=l7k%&KI1&bxt_naZWl}X=dqlrTL}yQdenB>6+5U(oLl; zrJbch>CV!-O21h8aOrnS50xG({YB}i(s1cJrRPfjQaZaVvn;1>_MNgrWus-|Wp9_AEla;qd*cl^-cCWS0pGab@rdb{&{Ue)ZZ0=3H`kjx%tPk; z%@3I$Ge2W~)BJn$r1^q5%VM-tSlpJamhF~%Ee~4$-g3Y)W_i={KD75aYq7P~y3V@Z z+G!0~@3%f@{gaj1=Gm^a8Ek88UfaF4hiw03`@QW$TSmck1!V=d7xow4TX?eY9Y`~y z_>0BOj@upE9q%|)&MfD>&Ig?*oS!fCmu@fJSk_tgOxd$HQm{;G%%!FWOe*sh^V)*V z1rHTu6wNI%*`4-2`@Z7GiVqY&QT$}_Q^g01pDi9PK2khZe7yKX@z07+7Qb11s`#zq zaB*MBK*>7leutq1>3#H^kvgGP2V#eHdUKN^F8KA%?Hef z%ty_ynis%U-IiM|KFb}JFI#?#9)HI=VNJ7@*eYzRZ0l^I?F+Vk^f6@nitVem{k8+P z@7jJ~`;qMk?DuE3H*I0tJFwy@TY7=Mz))Z+a22d5@D*$?=qm^nJX-L}fih5cH))m~}8)!t(tu*E}xGN-eOnveHVD2?F5(dYJW=OiK=u`$#?oZj zU}?2QC*noJu^n@z1IA1vc<*MGMJ{x7@w0B8UJ diff --git a/src/install.ts b/src/install.ts index 2070ee2f..e3d93327 100644 --- a/src/install.ts +++ b/src/install.ts @@ -63,7 +63,9 @@ export async function run(): Promise { } case 'win32': script_path = await build('win32.ps1', version, os_version); - await exec('pwsh ' + script_path + ' -version ' + version); + await exec( + 'pwsh ' + script_path + ' -version ' + version + ' -dir ' + __dirname + ); break; } } catch (error) { diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index d4e34ac7..7193d900 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -1,11 +1,14 @@ param ( - [Parameter(Mandatory = $true)][string]$version = "7.3" + [Parameter(Mandatory = $true)][string]$version = "7.4", + [Parameter(Mandatory=$true)][string]$dir ) $tick = ([char]8730) $cross = ([char]10007) $php_dir = 'C:\tools\php' +$ext_dir = $php_dir + '\ext' $ProgressPreference = 'SilentlyContinue' +$master_version = '8.0' Function Step-Log($message) { printf "\n\033[90;1m==> \033[0m\033[37;1m%s \033[0m\n" $message @@ -16,10 +19,6 @@ Function Add-Log($mark, $subject, $message) { printf "\033[%s;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $code $mark $subject $message } -if ($version -eq '8.0') { - $version = '7.4' -} - Step-Log "Setup PhpManager" Install-Module -Name PhpManager -Force -Scope CurrentUser Add-Log $tick "PhpManager" "Installed" @@ -39,6 +38,9 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version Install-Module -Name VcRedist -Force $arch='x86' } + if ($version -eq $master_version) { + $version = 'master' + } Install-Php -Version $version -Architecture $arch -ThreadSafe $true -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1 $installed = Get-Php -Path $php_dir @@ -49,12 +51,17 @@ else { } Set-PhpIniKey -Key 'date.timezone' -Value 'UTC' -Path $php_dir -Enable-PhpExtension -Extension openssl, curl -Path $php_dir +Enable-PhpExtension -Extension openssl, curl, opcache -Path $php_dir Update-PhpCAInfo -Path $php_dir -Source CurrentUser Add-Log $tick "PHP" $status Install-Composer -Scope System -Path $php_dir -PhpPath $php_dir Add-Log $tick "Composer" "Installed" +if ($version -eq 'master') { + Copy-Item $dir"\..\src\ext\php_pcov.dll" -Destination $ext_dir"\php_pcov.dll" + Set-PhpIniKey -Key 'opcache.jit_buffer_size' -Value '256M' -Path $php_dir + Set-PhpIniKey -Key 'opcache.jit' -Value '1235' -Path $php_dir +} Function Add-Extension { Param ( From 1798f4d6159698fafcbb1ebfae3644667c507f24 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 19 Dec 2019 02:38:12 +0530 Subject: [PATCH 5/9] Fix matchers and add tests --- README.md | 10 +++++ __tests__/install.test.ts | 32 -------------- __tests__/matchers.test.ts | 34 +++++++++++++++ dist/index.js | 43 +++++++++++++++++++ .../matchers => src/configs}/phpunit.json | 0 src/install.ts | 6 +-- src/matchers.ts | 18 +++++--- 7 files changed, 103 insertions(+), 40 deletions(-) create mode 100644 __tests__/matchers.test.ts rename {.github/matchers => src/configs}/phpunit.json (100%) diff --git a/README.md b/README.md index b19670d7..400e2b2c 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support - [Matrix Setup](#matrix-setup) - [Experimental Setup](#experimental-setup) - [Cache dependencies](#cache-dependencies) + - [Problem Matchers](#problem-matchers) - [Examples](#examples) - [License](#scroll-license) - [Contributions](#1-contributions) @@ -215,6 +216,15 @@ You can persist composer's internal cache directory using the [`action/cache`](h run: composer install --prefer-dist ``` +### Problem Matchers + +You can setup problem matchers for your `PHPUnit` output. This will scan the errors in your tests and surface that information prominently in the GitHub Actions UI by creating annotations and log file decorations. + +```yaml +- name: Setup Problem Matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" +``` + ### Examples Examples for setting up this GitHub Action with different PHP Frameworks/Packages. diff --git a/__tests__/install.test.ts b/__tests__/install.test.ts index 5dd5dcab..9842a38e 100644 --- a/__tests__/install.test.ts +++ b/__tests__/install.test.ts @@ -1,6 +1,4 @@ import * as install from '../src/install'; -import * as matchers from '../src/matchers'; -import * as path from 'path'; /** * Mock install.ts @@ -152,34 +150,4 @@ describe('Install', () => { expect(script).toContain('set coverage driver'); expect(script).toContain('sh script.sh 7.3 ' + __dirname); }); - - describe('Matchers', () => { - let originalLogMethod: any; - let outputData: any[] = []; - - beforeAll(() => { - originalLogMethod = console.log; - console['log'] = jest.fn(inputs => outputData.push(inputs)); - }); - - beforeEach(() => { - outputData = []; - }); - - afterAll(() => { - console['log'] = originalLogMethod; - }); - - it('Add matchers', async () => { - matchers.addMatchers(); - - expect(outputData).toEqual([ - `##[add-matcher]${path.join( - __dirname, - '..', - '.github/matchers/phpunit.json' - )}` - ]); - }); - }); }); diff --git a/__tests__/matchers.test.ts b/__tests__/matchers.test.ts new file mode 100644 index 00000000..23e74830 --- /dev/null +++ b/__tests__/matchers.test.ts @@ -0,0 +1,34 @@ +import * as io from '@actions/io'; +import * as path from 'path'; +import * as fs from 'fs'; +import * as matchers from '../src/matchers'; + +async function cleanup(path: string): Promise { + fs.unlink(path, error => { + if (error) { + console.log(error); + } + }); +} + +jest.mock('@actions/io'); + +describe('Matchers', () => { + it('Add matchers', async () => { + process.env['RUNNER_TOOL_CACHE'] = __dirname; + await matchers.addMatchers(); + const spy = jest.spyOn(io, 'cp'); + expect(spy).toHaveBeenCalledTimes(1); + }); + + it('Test Regex', async () => { + const regex1 = /^\d+\)\s.*$/; + const regex2 = /^(.*)$/; + const regex3 = /^\s*$/; + const regex4 = /^(.*):(\d+)$/; + expect(regex1.test('1) Tests\\Test::it_tests')).toBe(true); + expect(regex2.test('Failed asserting that false is true')).toBe(true); + expect(regex3.test('\n')).toBe(true); + expect(regex4.test('/path/to/file.php:42')).toBe(true); + }); +}); diff --git a/dist/index.js b/dist/index.js index 97611682..e943c162 100644 --- a/dist/index.js +++ b/dist/index.js @@ -932,6 +932,46 @@ class ExecState extends events.EventEmitter { } //# sourceMappingURL=toolrunner.js.map +/***/ }), + +/***/ 86: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = __importStar(__webpack_require__(622)); +const utils = __importStar(__webpack_require__(163)); +const io = __importStar(__webpack_require__(1)); +/** + * Cache json files for problem matchers + */ +function addMatchers() { + return __awaiter(this, void 0, void 0, function* () { + const config_path = path.join(__dirname, '..', 'src', 'configs', 'phpunit.json'); + const runner_dir = yield utils.getInput('RUNNER_TOOL_CACHE', false); + yield io.cp(config_path, runner_dir); + }); +} +exports.addMatchers = addMatchers; + + /***/ }), /***/ 87: @@ -1795,6 +1835,7 @@ const config = __importStar(__webpack_require__(641)); const coverage = __importStar(__webpack_require__(635)); const extensions = __importStar(__webpack_require__(911)); const utils = __importStar(__webpack_require__(163)); +const matchers = __importStar(__webpack_require__(86)); /** * Build the script * @@ -1810,6 +1851,7 @@ function build(filename, version, os_version) { const ini_values_csv = (yield utils.getInput('ini-values', false)) || (yield utils.getInput('ini-values-csv', false)); const coverage_driver = yield utils.getInput('coverage', false); + const setup_matchers = yield utils.getInput('matchers', false); let script = yield utils.readScript(filename, version, os_version); if (extension_csv) { script += yield extensions.addExtension(extension_csv, version, os_version); @@ -1851,6 +1893,7 @@ function run() { yield exec_1.exec('pwsh ' + script_path + ' -version ' + version + ' -dir ' + __dirname); break; } + yield matchers.addMatchers(); } catch (error) { core.setFailed(error.message); diff --git a/.github/matchers/phpunit.json b/src/configs/phpunit.json similarity index 100% rename from .github/matchers/phpunit.json rename to src/configs/phpunit.json diff --git a/src/install.ts b/src/install.ts index 6b88d3d7..b36434d8 100644 --- a/src/install.ts +++ b/src/install.ts @@ -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 { ); break; } - - addMatchers(); + await matchers.addMatchers(); } catch (error) { core.setFailed(error.message); } diff --git a/src/matchers.ts b/src/matchers.ts index 18116ccb..500f2101 100644 --- a/src/matchers.ts +++ b/src/matchers.ts @@ -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 { + 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); } From 421187c870871398bdb40b949781086a1d2c1c0b Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 19 Dec 2019 10:39:50 +0530 Subject: [PATCH 6/9] Fix experimental workflow --- .github/workflows/experimental-workflow.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/experimental-workflow.yml b/.github/workflows/experimental-workflow.yml index 6c867953..4a506260 100644 --- a/.github/workflows/experimental-workflow.yml +++ b/.github/workflows/experimental-workflow.yml @@ -61,7 +61,7 @@ jobs: php-version: ${{ matrix.php-versions }} extensions: mbstring, opcache, xdebug, pcov #optional ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #optional - coverage: xdebug + coverage: pcov - name: Testing PHP version run: | @@ -76,7 +76,6 @@ jobs: run: | php -m php -r "if(! extension_loaded('mbstring')) {throw new Exception('mbstring not found');}" - # php -r "if(! extension_loaded('Xdebug')) {throw new Exception('Xdebug not found');}" php -r "if(! extension_loaded('pcov')) {throw new Exception('PCOV not found');}" - name: Testing ini values run: | From 2d488f53fdee9a1863efc6c33c71c8add791637d Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 19 Dec 2019 10:38:24 +0530 Subject: [PATCH 7/9] Bump version to 1.6.2 --- package-lock.json | 114 +++++++++++++++++++++++----------------------- package.json | 3 +- 2 files changed, 59 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a6612c6..83d564e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "setup-php", - "version": "1.6.1", + "version": "1.6.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -32,15 +32,15 @@ } }, "@babel/core": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.5.tgz", - "integrity": "sha512-M42+ScN4+1S9iB6f+TL7QBpoQETxbclx+KNoKJABghnKYE+fMzSGqst0BZJc8CpI625bwPwYgUyRvxZ+0mZzpw==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", + "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", + "@babel/generator": "^7.7.7", "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.5", + "@babel/parser": "^7.7.7", "@babel/template": "^7.7.4", "@babel/traverse": "^7.7.4", "@babel/types": "^7.7.4", @@ -68,9 +68,9 @@ } }, "@babel/generator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.4.tgz", - "integrity": "sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", + "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", "dev": true, "requires": { "@babel/types": "^7.7.4", @@ -145,9 +145,9 @@ } }, "@babel/parser": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.5.tgz", - "integrity": "sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", "dev": true }, "@babel/plugin-syntax-object-rest-spread": { @@ -503,9 +503,9 @@ } }, "@types/jest": { - "version": "24.0.23", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.23.tgz", - "integrity": "sha512-L7MBvwfNpe7yVPTXLn32df/EK+AMBFAFvZrRuArGs7npEWnlziUXK+5GMIUTI4NIuwok3XibsjXCs5HxviYXjg==", + "version": "24.0.24", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.24.tgz", + "integrity": "sha512-vgaG968EDPSJPMunEDdZvZgvxYSmeH8wKqBlHSkBt1pV2XlLEVDzsj1ZhLuI4iG4Pv841tES61txSBF0obh4CQ==", "dev": true, "requires": { "jest-diff": "^24.3.0" @@ -518,9 +518,9 @@ "dev": true }, "@types/node": { - "version": "12.12.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz", - "integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA==", + "version": "12.12.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.21.tgz", + "integrity": "sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA==", "dev": true }, "@types/normalize-package-data": { @@ -551,12 +551,12 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.11.0.tgz", - "integrity": "sha512-G2HHA1vpMN0EEbUuWubiCCfd0R3a30BB+UdvnFkxwZIxYEGOrWEXDv8tBFO9f44CWc47Xv9lLM3VSn4ORLI2bA==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.12.0.tgz", + "integrity": "sha512-1t4r9rpLuEwl3hgt90jY18wJHSyb0E3orVL3DaqwmpiSDHmHiSspVsvsFF78BJ/3NNG3qmeso836jpuBWYziAA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.11.0", + "@typescript-eslint/experimental-utils": "2.12.0", "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -564,32 +564,32 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.11.0.tgz", - "integrity": "sha512-YxcA/y0ZJaCc/fB/MClhcDxHI0nOBB7v2/WxBju2cOTanX7jO9ttQq6Fy4yW9UaY5bPd9xL3cun3lDVqk67sPQ==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.12.0.tgz", + "integrity": "sha512-jv4gYpw5N5BrWF3ntROvCuLe1IjRenLy5+U57J24NbPGwZFAjhnM45qpq0nDH1y/AZMb3Br25YiNVwyPbz6RkA==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.11.0", + "@typescript-eslint/typescript-estree": "2.12.0", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/parser": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.11.0.tgz", - "integrity": "sha512-DyGXeqhb3moMioEFZIHIp7oXBBh7dEfPTzGrlyP0Mi9ScCra4SWEGs3kPd18mG7Sy9Wy8z88zmrw5tSGL6r/6A==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.12.0.tgz", + "integrity": "sha512-lPdkwpdzxEfjI8TyTzZqPatkrswLSVu4bqUgnB03fHSOwpC7KSerPgJRgIAf11UGNf7HKjJV6oaPZI4AghLU6g==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.11.0", - "@typescript-eslint/typescript-estree": "2.11.0", + "@typescript-eslint/experimental-utils": "2.12.0", + "@typescript-eslint/typescript-estree": "2.12.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.11.0.tgz", - "integrity": "sha512-HGY4+d4MagO6cKMcKfIKaTMxcAv7dEVnji2Zi+vi5VV8uWAM631KjAB5GxFcexMYrwKT0EekRiiGK1/Sd7VFGA==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.12.0.tgz", + "integrity": "sha512-rGehVfjHEn8Frh9UW02ZZIfJs6SIIxIu/K1bbci8rFfDE/1lQ8krIJy5OXOV3DVnNdDPtoiPOdEANkLMrwXbiQ==", "dev": true, "requires": { "debug": "^4.1.1", @@ -1815,9 +1815,9 @@ } }, "eslint-plugin-prettier": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz", - "integrity": "sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz", + "integrity": "sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" @@ -3210,9 +3210,9 @@ "dev": true }, "inquirer": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.0.tgz", - "integrity": "sha512-rSdC7zelHdRQFkWnhsMu2+2SO41mpv2oF2zy4tMhmiLWkcKbOAs87fWAJhVXttKVwhdZvymvnuM95EyEXg2/tQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.1.tgz", + "integrity": "sha512-V1FFQ3TIO15det8PijPLFR9M9baSlnRs9nL7zWu1MNVA2T9YVl9ZbrHJhYs7e9X8jeMZ3lr2JH/rdHFgNCBdYw==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", @@ -3224,7 +3224,7 @@ "lodash": "^4.17.15", "mute-stream": "0.0.8", "run-async": "^2.2.0", - "rxjs": "^6.4.0", + "rxjs": "^6.5.3", "string-width": "^4.1.0", "strip-ansi": "^5.1.0", "through": "^2.3.6" @@ -3307,9 +3307,9 @@ } }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, "is-descriptor": { @@ -3406,12 +3406,12 @@ "dev": true }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "dev": true, "requires": { - "has": "^1.0.1" + "has": "^1.0.3" } }, "is-stream": { @@ -5054,9 +5054,9 @@ "dev": true }, "resolve": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", - "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.1.tgz", + "integrity": "sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -5613,9 +5613,9 @@ } }, "string.prototype.trimleft": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", - "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", "dev": true, "requires": { "define-properties": "^1.1.3", @@ -5623,9 +5623,9 @@ } }, "string.prototype.trimright": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", - "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", "dev": true, "requires": { "define-properties": "^1.1.3", diff --git a/package.json b/package.json index d6ddeeb0..8615419b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-php", - "version": "1.6.1", + "version": "1.6.2", "private": false, "description": "Setup PHP for use with GitHub Actions", "main": "dist/index.js", @@ -26,6 +26,7 @@ "dependencies": { "@actions/core": "^1.2.0", "@actions/exec": "^1.0.2", + "@actions/io": "^1.0.1", "fs": "0.0.1-security" }, "devDependencies": { From f2972dcf18b2230204e2ab491af8d85ca0d4ba41 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 19 Dec 2019 11:29:27 +0530 Subject: [PATCH 8/9] Fix enabling zend extensions --- .github/workflows/experimental-workflow.yml | 2 +- .github/workflows/workflow.yml | 4 +-- src/scripts/darwin.sh | 27 ++++++++++++++++----- src/scripts/linux.sh | 23 +++++++++++++++--- 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/.github/workflows/experimental-workflow.yml b/.github/workflows/experimental-workflow.yml index 4a506260..a2993568 100644 --- a/.github/workflows/experimental-workflow.yml +++ b/.github/workflows/experimental-workflow.yml @@ -59,7 +59,7 @@ jobs: run: node dist/index.js env: php-version: ${{ matrix.php-versions }} - extensions: mbstring, opcache, xdebug, pcov #optional + extensions: xml, opcache, xdebug, pcov #optional ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #optional coverage: pcov diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2ee9edbf..e7b62138 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -57,7 +57,7 @@ jobs: run: node dist/index.js env: php-version: ${{ matrix.php-versions }} - extensions: mbstring, xdebug, pcov #optional + extensions: xml, opcache, xdebug, pcov #optional ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #optional - name: Testing PHP version @@ -72,7 +72,7 @@ jobs: - name: Testing Extensions run: | php -m - php -r "if(! extension_loaded('mbstring')) {throw new Exception('mbstring not found');}" + php -r "if(! extension_loaded('xml')) {throw new Exception('xml not found');}" php -r "if(! extension_loaded('Xdebug')) {throw new Exception('Xdebug not found');}" php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}" - name: Testing ini values diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index c918c8cb..f5f6934f 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -17,8 +17,22 @@ add_log() { fi } +get_extension_regex() { + extension=$1 + case $extension in + "opcache") + echo "^Zend\sOPcache$" + ;; + "xdebug") + echo "^Xdebug$" + ;; + *) + echo ^"$extension"$ + ;; + esac +} + step_log "Setup PHP and Composer" -version=$1 export HOMEBREW_NO_INSTALL_CLEANUP=TRUE brew tap shivammathur/homebrew-php >/dev/null 2>&1 brew install shivammathur/php/php@"$1" composer >/dev/null 2>&1 @@ -37,11 +51,12 @@ add_extension() { extension=$1 install_command=$2 prefix=$3 - if ! php -m | grep -i -q ^"$extension"$ && [ -e "$ext_dir/$extension.so" ]; then - echo "$prefix=$extension" >>"$ini_file" && add_log $tick "$extension" "Enabled" - elif php -m | grep -i -q ^"$extension"$; then + extension_regex="$(get_extension_regex "$extension")" + if ! php -m | grep -i -q "$extension_regex" && [ -e "$ext_dir/$extension.so" ]; then + echo "$prefix=$extension" >>"$ini_file" && add_log "$tick" "$extension" "Enabled" + elif php -m | grep -i -q "$extension_regex"; then add_log "$tick" "$extension" "Enabled" - elif ! php -m | grep -i -q ^"$extension"$; then + elif ! php -m | grep -i -q "$extension_regex"; then exists=$(curl -sL https://pecl.php.net/json.php?package="$extension" -w "%{http_code}" -o /dev/null) if [ "$exists" = "200" ]; then ( @@ -49,7 +64,7 @@ add_extension() { add_log "$tick" "$extension" "Installed and enabled" ) || add_log "$cross" "$extension" "Could not install $extension on PHP $semver" else - if ! php -m | grep -i -q ^"$extension"$; then + if ! php -m | grep -i -q "$extension_regex"; then add_log "$cross" "$extension" "Could not find $extension for PHP $semver on PECL" fi fi diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 499a2958..0e89a247 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -16,6 +16,22 @@ add_log() { printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message" fi } + +get_extension_regex() { + extension=$1 + case $extension in + "opcache") + echo "^Zend\sOPcache$" + ;; + "xdebug") + echo "^Xdebug$" + ;; + *) + echo ^"$extension"$ + ;; + esac +} + existing_version=$(php-config --version | cut -c 1-3) semver=$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-') step_log "Setup PHP and Composer" @@ -96,11 +112,12 @@ add_extension() extension=$1 install_command=$2 prefix=$3 - if ! php -m | grep -i -q ^"$extension"$ && [ -e "$ext_dir/$extension.so" ]; then + extension_regex="$(get_extension_regex "$extension")" + if ! php -m | grep -i -q "$extension_regex" && [ -e "$ext_dir/$extension.so" ]; then echo "$prefix=$extension" >> "$ini_file" && add_log "$tick" "$extension" "Enabled" - elif php -m | grep -i -q ^"$extension"$; then + elif php -m | grep -i -q "$extension_regex"; then add_log "$tick" "$extension" "Enabled" - elif ! php -m | grep -i -q ^"$extension"$; then + elif ! php -m | grep -i -q "$extension_regex"; then ( eval "$install_command" && \ add_log "$tick" "$extension" "Installed and enabled" From 7f805f22affdfb6667111fac21c4172fd219f173 Mon Sep 17 00:00:00 2001 From: Sven Luijten <11269635+svenluijten@users.noreply.github.com> Date: Thu, 19 Dec 2019 10:40:58 +0100 Subject: [PATCH 9/9] Fix year in comment above deprecated options --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 6bf077c8..673c7e8b 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: pecl: description: 'Setup PECL on ubuntu' required: false - # Deprecated options, do not use. Will not be supported after February 1, 2019. + # Deprecated options, do not use. Will not be supported after February 1, 2020. extension-csv: description: 'Deprecated! Use extensions instead.' deprecationMessage: 'The extension-csv property will not be supported after February 1, 2020. Use extensions instead.'