Compare commits

...

69 Commits
1.5.5 ... 1.6.2

Author SHA1 Message Date
a507be73b5 Merge pull request #127 from shivammathur/develop
Hotfix to support phalcon after v4 release
2019-12-22 10:02:11 +05:30
673dcaff6d Hotfix after phalcon4 release 2019-12-22 09:30:28 +05:30
2cbfd4fb41 Update extensions.ts
Phalcon 4.0.0 is released and now in the master.
2019-12-22 07:47:17 +05:30
0969980399 Merge pull request #125 from shivammathur/develop
Remove coverage drivers completely if requested
2019-12-20 15:04:11 +05:30
1fa2905bc6 Remove coverage drivers completely if requested 2019-12-20 14:32:47 +05:30
790a48c30d Merge pull request #124 from shivammathur/develop
1.6.2
2019-12-20 11:29:34 +05:30
4b69160eff Merge pull request #122 from svenluijten/patch-1
Fix year in comment above deprecated options
2019-12-19 15:55:35 +05:30
7f805f22af Fix year in comment above deprecated options 2019-12-19 10:40:58 +01:00
f2972dcf18 Fix enabling zend extensions 2019-12-19 11:33:35 +05:30
2d488f53fd Bump version to 1.6.2 2019-12-19 10:45:29 +05:30
421187c870 Fix experimental workflow 2019-12-19 10:45:08 +05:30
1798f4d615 Fix matchers and add tests 2019-12-19 10:44:43 +05:30
8039546df3 Merge pull request #84 from decnorton/develop
Add problem matcher for PHPUnit
2019-12-19 02:18:02 +05:30
c6ad3d1a70 Add 8.0 support on windows 2019-12-19 00:23:32 +05:30
922f1e27b8 Set ProgressPreference to Silent in win32.ps1 2019-12-18 18:52:46 +05:30
2d3750b36e Install 64bit version of PHP on windows 2019-12-18 18:42:55 +05:30
51c7527bd8 Merge pull request #121 from shivammathur/develop
Fix add_extension on linux and macOS
2019-12-17 04:28:05 +05:30
2bf7ab0207 Fix add_extension on linux and macOS 2019-12-16 19:40:50 +05:30
b3a84fc51e Merge pull request #119 from shivammathur/develop
1.6.1
2019-12-15 02:28:01 +05:30
1330950cd5 Bump version to 1.6.1 2019-12-15 02:09:03 +05:30
afb57fca4e Merge pull request #118 from svenluijten/patch-1
Fix typo in available options
2019-12-15 01:27:07 +05:30
50344f4883 Fix typo in available options
`extension` should actually be `extensions`.
2019-12-14 14:53:04 +01:00
2b027bd9bc Fix reading unquoted versions 2019-12-14 10:13:01 +05:30
8f8207a1ca Add support for ext-gearman. Closes #116 2019-12-14 09:21:11 +05:30
87e6c70743 Update PEAR channel after installation 2019-12-10 05:34:26 +05:30
e3d18718a9 Update dependencies 2019-12-10 05:22:33 +05:30
cfa7bc51cd Merge pull request #106 from shivammathur/develop
Fix coverage log for Xdebug on PHP 8.0
2019-12-09 15:30:42 +05:30
ade633f0da Fix coverage log for Xdebug on PHP 8.0 2019-12-09 14:58:42 +05:30
2cabcf2941 Merge pull request #105 from shivammathur/develop
1.6.0
2019-12-09 14:00:34 +05:30
9ce4bd6f1b Fix logs on linux 2019-12-09 13:17:02 +05:30
190ae49ac1 Improve README 2019-12-09 12:45:26 +05:30
032bc86056 Fix actions.yml 2019-12-09 12:32:55 +05:30
704c5180a4 Update examples 2019-12-09 12:20:03 +05:30
e4fc767f9c Deprecate extension-csv and ini-values-csv inputs 2019-12-09 11:14:07 +05:30
1cf6a369bb Add support for PHP 8.0.0-dev #104 2019-12-09 10:31:11 +05:30
14acb26bdc Merge pull request #103 from shivammathur/develop
1.5.8
2019-12-06 09:30:32 +05:30
3ff7f9cedc Bump version to 1.5.8 2019-12-06 09:13:56 +05:30
98e937751c Merge branch 'develop' of https://github.com/shivammathur/setup-php into develop 2019-12-06 09:11:34 +05:30
31b338b199 Install PCOV from pecl for PHP7.4 on windows 2019-12-06 09:10:20 +05:30
9e32964a24 Merge pull request #102 from shivammathur/dependabot/npm_and_yarn/develop/typescript-3.7.3
Bump typescript from 3.7.2 to 3.7.3
2019-12-05 04:57:13 +05:30
4dcf2b117f Bump typescript from 3.7.2 to 3.7.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.7.2 to 3.7.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.7.2...v3.7.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-04 23:19:02 +00:00
6d8250310d Update PHP release support 2019-12-05 02:07:21 +05:30
3164116a42 Merge pull request #101 from shivammathur/develop
1.5.7
2019-12-03 01:17:20 +05:30
747d45cb52 Bump version to 1.5.7 2019-12-03 00:53:35 +05:30
4b7ad1ca81 Merge pull request #100 from shivammathur/dependabot/npm_and_yarn/develop/typescript-eslint/parser-2.10.0
Bump @typescript-eslint/parser from 2.9.0 to 2.10.0
2019-12-03 00:43:15 +05:30
31ef16e586 Merge pull request #99 from shivammathur/dependabot/npm_and_yarn/develop/typescript-eslint/eslint-plugin-2.10.0
Bump @typescript-eslint/eslint-plugin from 2.9.0 to 2.10.0
2019-12-03 00:43:02 +05:30
dd1def7620 Merge pull request #97 from shivammathur/dependabot/npm_and_yarn/develop/eslint-6.7.2
Bump eslint from 6.7.1 to 6.7.2
2019-12-03 00:34:52 +05:30
693a73d8da Merge pull request #98 from shivammathur/dependabot/npm_and_yarn/develop/eslint-plugin-jest-23.1.1
Bump eslint-plugin-jest from 23.1.0 to 23.1.1
2019-12-03 00:34:43 +05:30
965eb91efd Bump @typescript-eslint/parser from 2.9.0 to 2.10.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.9.0 to 2.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.10.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 18:56:07 +00:00
db9f610623 Bump @typescript-eslint/eslint-plugin from 2.9.0 to 2.10.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.9.0 to 2.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.10.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 18:55:28 +00:00
24fb306a50 Bump eslint-plugin-jest from 23.1.0 to 23.1.1
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 23.1.0 to 23.1.1.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v23.1.0...v23.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 18:54:52 +00:00
919fe77b43 Bump eslint from 6.7.1 to 6.7.2
Bumps [eslint](https://github.com/eslint/eslint) from 6.7.1 to 6.7.2.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v6.7.1...v6.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 18:54:44 +00:00
914c51cfb6 Fix ext-redis 2019-12-03 00:12:29 +05:30
8d8c2bd524 Use shivammathur/homebrew-php for macOS 2019-12-02 17:24:50 +05:30
7ef437ee9d Update pre-commit hook 2019-12-02 07:00:41 +05:30
0871fbb11b Update action.yml 2019-11-30 23:30:48 +05:30
3039a720ed Merge pull request #95 from shivammathur/develop
1.5.6
2019-11-30 07:11:14 +05:30
7f32ab318e Show semantic versions on PHP install and correct logs 2019-11-30 06:57:39 +05:30
ddcacf4760 Improve readme and workflow 2019-11-30 05:30:17 +05:30
2f951ef5cd Use Homebrew for PHP 7.4 on macOS 2019-11-30 04:59:05 +05:30
5a081357b4 Merge pull request #94 from shivammathur/develop
Fix phpdbg and improve windows script.
2019-11-29 12:10:41 +05:30
c4a64dff61 Install phpdbg with PHP7.4 2019-11-29 11:41:25 +05:30
aad33a8e35 Update Update-PhpCAInfo command in win32.ps1 2019-11-29 10:52:07 +05:30
eae890b1b2 Fix phpdbg version 2019-11-29 10:14:53 +05:30
8fbd2ea6bb Merge pull request #92 from shivammathur/develop
Switch to v1 tag and stable PHP 7.4.0
2019-11-28 16:47:42 +05:30
46161660dc Bump to 7.4.0 stable on linux 2019-11-28 15:58:33 +05:30
de68427afb Bump to 7.4.0 stable on windows and macOS 2019-11-28 15:54:15 +05:30
4ba36c5432 Shift to rotating stable tags 2019-11-28 05:17:56 +05:30
03f36220f4 Add PHPUnit problem matcher 2019-11-24 16:35:21 +00:00
43 changed files with 1540 additions and 502 deletions

View File

@ -0,0 +1,94 @@
name: Experimental workflow
on:
pull_request:
branches:
- nightly
- master
- develop
- verbose
paths-ignore:
- '**.md'
- 'examples/**'
push:
branches:
- nightly
- master
- develop
- verbose
paths-ignore:
- '**.md'
- 'examples/**'
jobs:
run:
name: Run
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['8.0']
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: npm install
- name: Prettier Format Check
run: npm run format-check
- name: ESLint Check
run: npm run lint
- name: Run tests
run: npm test
- name: Send Coverage
continue-on-error: true
timeout-minutes: 1
run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }}
- name: Setup PHP with extensions and custom config
run: node dist/index.js
env:
php-version: ${{ matrix.php-versions }}
extensions: xml, opcache, xdebug, pcov #optional
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #optional
coverage: pcov
- name: Testing PHP version
run: |
php -v
php -r "if(strpos(phpversion(), '${{ matrix.php-versions }}') === false) {throw new Exception('Wrong PHP version Installed');}"
- name: Testing Composer version
run: |
composer -V
php -r "if(strpos(@exec('composer -V'), 'Composer version') === false) {throw new Exception('Composer not found');}"
- name: Testing Extensions
run: |
php -m
php -r "if(! extension_loaded('mbstring')) {throw new Exception('mbstring not found');}"
php -r "if(! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
- name: Testing ini values
run: |
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 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');}"
- name: Benchmark JIT
run: |
curl -o bench.php https://raw.githubusercontent.com/php/php-src/master/Zend/bench.php
php bench.php

View File

@ -24,15 +24,15 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Node.js 12.x
uses: actions/setup-node@master
uses: actions/setup-node@v1
with:
node-version: 12.x
@ -57,17 +57,26 @@ jobs:
run: node dist/index.js
env:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, xdebug, pcov #optional
ini-values-csv: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #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
run: php -v
run: |
php -v
php -r "if(strpos(phpversion(), '${{ matrix.php-versions }}') === false) {throw new Exception('Wrong PHP version Installed');}"
- name: Testing Composer version
run: composer -V
run: |
composer -V
php -r "if(strpos(@exec('composer -V'), 'Composer version') === false) {throw new Exception('Composer not found');}"
- name: Testing Extensions
run: php -m
run: |
php -m
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
run: |
printf "post_max_size: %s\n" $(php -r "echo ini_get('post_max_size');")
printf "short_open_tag: %s\n" $(php -r "echo ini_get('short_open_tag');")
printf "date.timezone: %s\n" $(php -r "echo ini_get('date.timezone');")
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');}"

118
README.md
View File

@ -13,7 +13,7 @@
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg"></a>
</p>
Setup PHP with required extensions, php.ini configuration and composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action can be added as a step in your action workflow and it will setup the PHP environment you need to test your application. Refer to [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
Setup PHP with required extensions, php.ini configuration, code-coverage support and composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross platform interface to setup the PHP environment you need to test your application. Refer to [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
## Contents
@ -25,9 +25,11 @@ Setup PHP with required extensions, php.ini configuration and composer in [GitHu
- [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)
- [Problem Matchers](#problem-matchers)
- [Examples](#examples)
- [License](#scroll-license)
- [Contributions](#1-contributions)
@ -41,10 +43,13 @@ Setup PHP with required extensions, php.ini configuration and composer in [GitHu
|--- |--- |--- |
|5.6|`Stable`|`End of life`|
|7.0|`Stable`|`End of life`|
|7.1|`Stable`|`Security fixes only`|
|7.2|`Stable`|`Active`|
|7.1|`Stable`|`End of life`|
|7.2|`Stable`|`Security fixes only`|
|7.3|`Stable`|`Active`|
|7.4|`RC6`|`Active`|
|7.4|`Stable`|`Active`|
|8.0|`Experimental`|`In development`|
**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
@ -67,12 +72,12 @@ Setup PHP with required extensions, php.ini configuration and composer in [GitHu
### 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@master
uses: shivammathur/setup-php@v1
with:
php-version: '7.3'
php-version: '7.4'
coverage: xdebug
```
@ -81,14 +86,14 @@ with:
Specify `coverage: pcov` to use `PCOV`.
It is much faster than `Xdebug`.
`PCOV` needs `PHP >= 7.1`.
If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values-csv` input.
If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values` input.
```yaml
uses: shivammathur/setup-php@master
uses: shivammathur/setup-php@v1
with:
php-version: '7.3'
ini-values-csv: pcov.directory=api #optional, see above for usage.
php-version: '7.4'
ini-values: pcov.directory=api #optional, see above for usage.
coverage: pcov
```
@ -102,9 +107,9 @@ Consider disabling the coverage using this PHP action for these reasons.
- You are using `phpdbg` for running your tests.
```yaml
uses: shivammathur/setup-php@master
uses: shivammathur/setup-php@v1
with:
php-version: '7.3'
php-version: '7.4'
coverage: none
```
@ -113,40 +118,35 @@ with:
Inputs supported by this GitHub Action.
- php-version `required`
- extension-csv `optional`
- ini-values-csv `optional`
- extensions `optional`
- ini-values `optional`
- coverage `optional`
- pecl `optional`
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.
```yaml
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@master
uses: shivammathur/setup-php@v1
with:
php-version: '7.3'
extension-csv: mbstring, intl #optional, setup extensions
ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
php-version: '7.4'
extensions: mbstring, intl #optional, setup extensions
ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
coverage: xdebug #optional, setup coverage driver
pecl: false #optional, setup PECL
- name: Check PHP Version
run: php -v
- name: Check Composer Version
run: composer -V
- name: Check PHP Extensions
run: php -m
```
### Matrix Testing
### Matrix Setup
> Setup multiple PHP versions on multiple operating systems.
```yaml
jobs:
@ -155,29 +155,43 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@master
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, intl #optional, setup extensions
ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
extensions: mbstring, intl #optional, setup extensions
ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
coverage: xdebug #optional, setup coverage driver
pecl: false #optional, setup PECL
```
- name: Check PHP Version
run: php -v
### Experimental Setup
- name: Check Composer Version
run: composer -V
> 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.
- name: Check PHP Extensions
run: php -m
- 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
@ -202,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.
@ -246,11 +269,10 @@ If this action helped you.
## :bookmark: This action uses the following works
- [powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
- [Homebrew](https://brew.sh/ "MacOS package manager")
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Pre-compiled ubuntu packages")
- [exolnet/homebrew-deprecated](https://github.com/eXolnet/homebrew-deprecated "Pre-compiled deprecated PHP for macOS")
- [phpbrew](https://github.com/phpbrew/phpbrew "PHP packages manager")
- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Pre-compiled nightly PHP builds")
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
- [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds for MacOS")
## :bookmark_tabs: Further Reading

View File

@ -11,7 +11,10 @@ describe('Config tests', () => {
let win32: string = await coverage.addCoverage('pcov', '7.4', 'win32');
expect(win32).toContain('addExtension pcov');
expect(win32).toContain(
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug C:\\tools\\php'
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug $php_dir'
);
expect(win32).toContain(
'if (Test-Path $ext_dir\\php_xdebug.dll) { Remove-Item $ext_dir\\php_xdebug.dll }'
);
win32 = await coverage.addCoverage('pcov', '7.0', 'win32');
@ -24,25 +27,40 @@ describe('Config tests', () => {
it('checking addCoverage with PCOV on linux', async () => {
const linux: string = await coverage.addCoverage('pcov', '7.4', 'linux');
expect(linux).toContain('addExtension pcov');
expect(linux).toContain('sudo sed -i "/xdebug/d" $ini_file');
expect(linux).toContain('sudo sed -i "/xdebug/d" "$ini_file"');
expect(linux).toContain('sudo phpdismod -v 7.4 xdebug');
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt-fast remove php-xdebug'
);
});
it('checking addCoverage with PCOV on darwin', async () => {
const darwin: string = await coverage.addCoverage('pcov', '7.4', 'darwin');
expect(darwin).toContain('addExtension pcov');
expect(darwin).toContain('sudo sed -i \'\' "/xdebug/d" "$ini_file"');
expect(darwin).toContain('sudo rm -rf "$ext_dir"/xdebug.so');
});
it('checking addCoverage with Xdebug on windows', async () => {
const win32: string = await coverage.addCoverage('xdebug', '7.3', 'win32');
const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32');
expect(win32).toContain('addExtension xdebug');
});
it('checking addCoverage with Xdebug on windows', async () => {
const win32: string = await coverage.addCoverage('xdebug', '8.0', 'win32');
expect(win32).toContain('Xdebug currently only supports PHP 7.4 or lower');
});
it('checking addCoverage with Xdebug on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug', '7.4', 'linux');
expect(linux).toContain('addExtension xdebug');
});
it('checking addCoverage with Xdebug on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
expect(linux).toContain('Xdebug currently only supports PHP 7.4 or lower');
});
it('checking addCoverage with Xdebug on darwin', async () => {
const darwin: string = await coverage.addCoverage(
'xdebug',
@ -52,24 +70,44 @@ describe('Config tests', () => {
expect(darwin).toContain('addExtension xdebug');
});
it('checking addCoverage with Xdebug on darwin', async () => {
const darwin: string = await coverage.addCoverage(
'xdebug',
'8.0',
'darwin'
);
expect(darwin).toContain('Xdebug currently only supports PHP 7.4 or lower');
});
it('checking disableCoverage windows', async () => {
const win32 = await coverage.addCoverage('none', '7.4', 'win32');
expect(win32).toContain('Disable-PhpExtension xdebug');
expect(win32).toContain('Disable-PhpExtension pcov');
expect(win32).toContain(
'if (Test-Path $ext_dir\\php_xdebug.dll) { Remove-Item $ext_dir\\php_xdebug.dll }'
);
expect(win32).toContain(
'if (Test-Path $ext_dir\\php_pcov.dll) { Remove-Item $ext_dir\\php_pcov.dll }'
);
});
it('checking disableCoverage on linux', async () => {
const linux: string = await coverage.addCoverage('none', '7.4', 'linux');
expect(linux).toContain('sudo phpdismod -v 7.4 xdebug');
expect(linux).toContain('sudo phpdismod -v 7.4 pcov');
expect(linux).toContain('sudo sed -i "/xdebug/d" $ini_file');
expect(linux).toContain('sudo sed -i "/pcov/d" $ini_file');
expect(linux).toContain('sudo sed -i "/xdebug/d" "$ini_file"');
expect(linux).toContain('sudo sed -i "/pcov/d" "$ini_file"');
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt-fast remove php-xdebug php-pcov'
);
});
it('checking disableCoverage on darwin', async () => {
const darwin: string = await coverage.addCoverage('none', '7.4', 'darwin');
expect(darwin).toContain('sudo sed -i \'\' "/xdebug/d" $ini_file');
expect(darwin).toContain('sudo sed -i \'\' "/pcov/d" $ini_file');
expect(darwin).toContain('sudo sed -i \'\' "/xdebug/d" "$ini_file"');
expect(darwin).toContain('sudo sed -i \'\' "/pcov/d" "$ini_file"');
expect(darwin).toContain('sudo rm -rf "$ext_dir"/xdebug.so');
expect(darwin).toContain('sudo rm -rf "$ext_dir"/pcov.so');
});
it('checking no or invalid coverage driver', async () => {

View File

@ -3,14 +3,13 @@ import * as extensions from '../src/extensions';
describe('Extension tests', () => {
it('checking addExtensionOnWindows', async () => {
let win32: string = await extensions.addExtension(
'xdebug, pcov',
'7.2',
'xdebug, pcov, redis',
'7.4',
'win32'
);
expect(win32).toContain('Add-Extension xdebug');
expect(win32).toContain('Add-Extension pcov');
win32 = await extensions.addExtension('xdebug, pcov', '7.4', 'win32');
expect(win32).toContain('Add-Extension xdebug');
expect(win32).toContain('Add-Extension redis beta');
win32 = await extensions.addExtension(
'does_not_exist',
@ -26,26 +25,48 @@ describe('Extension tests', () => {
it('checking addExtensionOnLinux', async () => {
let linux: string = await extensions.addExtension(
'xdebug, pcov',
'7.2',
'xdebug, pcov, redis',
'7.4',
'linux'
);
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.2-xdebug'
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-xdebug'
);
expect(linux).toContain('pecl install xdebug');
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.2-pcov'
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-pcov'
);
expect(linux).toContain('pecl install pcov');
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-igbinary php7.4-redis'
);
linux = await extensions.addExtension('phalcon3, phalcon4', '7.2', 'linux');
linux = await extensions.addExtension('gearman', '7.0', 'linux');
expect(linux).toContain('gearman.sh 7.0');
linux = await extensions.addExtension('gearman', '7.1', 'linux');
expect(linux).toContain('gearman.sh 7.1');
linux = await extensions.addExtension(
'phalcon3, phalcon4, gearman',
'7.2',
'linux'
);
expect(linux).toContain('phalcon.sh 3.4.x 7.2');
expect(linux).toContain('phalcon.sh master 7.2');
expect(linux).toContain('phalcon.sh 4.0.x 7.2');
expect(linux).toContain('gearman.sh 7.2');
linux = await extensions.addExtension('phalcon3, phalcon4', '7.3', 'linux');
linux = await extensions.addExtension(
'phalcon3, phalcon4, gearman',
'7.3',
'linux'
);
expect(linux).toContain('phalcon.sh 3.4.x 7.3');
expect(linux).toContain('phalcon.sh master 7.3');
expect(linux).toContain('phalcon.sh 4.0.x 7.3');
expect(linux).toContain('gearman.sh 7.3');
linux = await extensions.addExtension('phalcon4, gearman', '7.4', 'linux');
expect(linux).toContain('phalcon.sh master 7.4');
expect(linux).toContain('gearman.sh 7.4');
linux = await extensions.addExtension('xdebug', '7.2', 'fedora');
expect(linux).toContain('Platform fedora is not supported');
@ -72,6 +93,12 @@ describe('Extension tests', () => {
darwin = await extensions.addExtension('xdebug', '7.2', 'darwin');
expect(darwin).toContain('sudo pecl install xdebug');
darwin = await extensions.addExtension('redis', '5.6', 'darwin');
expect(darwin).toContain('sudo pecl install redis-2.2.8');
darwin = await extensions.addExtension('redis', '7.2', 'darwin');
expect(darwin).toContain('sudo pecl install redis');
darwin = await extensions.addExtension(
'does_not_exist',
'7.2',

View File

@ -10,8 +10,8 @@ jest.mock('../src/install', () => ({
version: string,
os_version: string
): Promise<string> => {
const extension_csv: string = process.env['extension-csv'] || '';
const ini_values_csv: string = process.env['ini-values-csv'] || '';
const extension_csv: string = process.env['extensions'] || '';
const ini_values_csv: string = process.env['ini-values'] || '';
const coverage_driver: string = process.env['coverage'] || '';
let script = 'initial script ' + filename + version + os_version;
@ -31,7 +31,8 @@ jest.mock('../src/install', () => ({
run: jest.fn().mockImplementation(
async (): Promise<string> => {
const os_version: string = process.env['RUNNER_OS'] || '';
const version: string = process.env['php-version'] || '';
let version: string = process.env['php-version'] || '';
version = version.length > 1 ? version : version + '.0';
let script = '';
switch (os_version) {
case 'darwin':
@ -77,18 +78,24 @@ function setEnv(
): void {
process.env['php-version'] = version;
process.env['RUNNER_OS'] = os;
process.env['extension-csv'] = extension_csv;
process.env['ini-values-csv'] = ini_values_csv;
process.env['extensions'] = extension_csv;
process.env['ini-values'] = ini_values_csv;
process.env['coverage'] = coverage_driver;
process.env['pecl'] = pecl;
}
describe('Install', () => {
it('Test install on windows', async () => {
setEnv('7.3', 'win32', '', '', '', '');
setEnv('7.0', 'win32', '', '', '', '');
// @ts-ignore
let script: string = await install.run();
expect(script).toContain('initial script');
expect(script).toContain('pwsh script.ps1 -version 7.0 -dir ' + __dirname);
setEnv('7.3', 'win32', '', '', '', '');
// @ts-ignore
script = await install.run();
expect(script).toContain('initial script');
expect(script).toContain('pwsh script.ps1 -version 7.3 -dir ' + __dirname);
setEnv('7.3', 'win32', 'a, b', 'a=b', 'x', '');

View File

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

View File

@ -26,23 +26,6 @@ describe('Utils tests', () => {
expect(await utils.getInput('DoesNotExist', false)).toBe('');
});
it('checking getVersion', async () => {
process.env['php-version'] = '7.3';
expect(await utils.getVersion()).toBe('7.3');
process.env['php-version'] = '7.4';
expect(await utils.getVersion()).toBe('7.4');
process.env['php-version'] = '8.0';
expect(await utils.getVersion()).toBe('7.4');
process.env['php-version'] = '8.0-dev';
expect(await utils.getVersion()).toBe('7.4');
process.env['php-version'] = '7.4nightly';
expect(await utils.getVersion()).toBe('7.4');
process.env['php-version'] = '7.4snapshot';
expect(await utils.getVersion()).toBe('7.4');
process.env['php-version'] = 'nightly';
expect(await utils.getVersion()).toBe('7.4');
});
it('checking asyncForEach', async () => {
const array: Array<string> = ['a', 'b', 'c'];
let concat = '';
@ -60,10 +43,6 @@ describe('Utils tests', () => {
});
it('checking readScripts', async () => {
const rc: string = fs.readFileSync(
path.join(__dirname, '../src/scripts/7.4.sh'),
'utf8'
);
const darwin: string = fs.readFileSync(
path.join(__dirname, '../src/scripts/darwin.sh'),
'utf8'
@ -76,15 +55,12 @@ describe('Utils tests', () => {
path.join(__dirname, '../src/scripts/win32.ps1'),
'utf8'
);
expect(await utils.readScript('darwin.sh', '7.4', 'darwin')).toBe(rc);
expect(await utils.readScript('darwin.sh', '7.4', 'darwin')).toBe(darwin);
expect(await utils.readScript('darwin.sh', '7.3', 'darwin')).toBe(darwin);
expect(await utils.readScript('linux.sh', '7.4', 'linux')).toBe(linux);
expect(await utils.readScript('linux.sh', '7.3', 'linux')).toBe(linux);
expect(await utils.readScript('win32.ps1', '7.4', 'win32')).toBe(win32);
expect(await utils.readScript('win32.ps1', '7.3', 'win32')).toBe(win32);
expect(await utils.readScript('fedora.sh', '7.3', 'fedora')).toContain(
'Platform fedora is not supported'
);
});
it('checking writeScripts', async () => {

View File

@ -5,19 +5,29 @@ branding:
color: 'purple'
inputs:
php-version:
description: 'PHP version you want to install.'
description: 'Setup PHP version.'
default: '7.4'
required: true
extension-csv:
description: '(Optional) PHP extensions you want to install.'
extensions:
description: 'Setup PHP extensions.'
required: false
ini-values-csv:
description: '(Optional) Custom values you want to set in php.ini.'
ini-values:
description: 'Add values to php.ini.'
required: false
coverage:
description: '(Optional) Code coverage driver you want to install. (Accepts: xdebug, pcov and none)'
description: 'Setup code coverage driver.'
required: false
pecl:
description: '(Optional) Setup PECL on ubuntu'
description: 'Setup PECL on ubuntu'
required: false
# 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.'
required: false
ini-values-csv:
description: 'Deprecated! Use ini-values instead.'
deprecationMessage: 'The ini-values-csv property will not be supported after February 1, 2020. Use ini-values instead.'
required: false
runs:
using: 'node12'

709
dist/index.js vendored
View File

@ -43,6 +43,303 @@ module.exports =
/************************************************************************/
/******/ ({
/***/ 1:
/***/ (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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const childProcess = __webpack_require__(129);
const path = __webpack_require__(622);
const util_1 = __webpack_require__(669);
const ioUtil = __webpack_require__(672);
const exec = util_1.promisify(childProcess.exec);
/**
* Copies a file or folder.
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
*
* @param source source path
* @param dest destination path
* @param options optional. See CopyOptions.
*/
function cp(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
const { force, recursive } = readCopyOptions(options);
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
// Dest is an existing file, but not forcing
if (destStat && destStat.isFile() && !force) {
return;
}
// If dest is an existing directory, should copy inside.
const newDest = destStat && destStat.isDirectory()
? path.join(dest, path.basename(source))
: dest;
if (!(yield ioUtil.exists(source))) {
throw new Error(`no such file or directory: ${source}`);
}
const sourceStat = yield ioUtil.stat(source);
if (sourceStat.isDirectory()) {
if (!recursive) {
throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
}
else {
yield cpDirRecursive(source, newDest, 0, force);
}
}
else {
if (path.relative(source, newDest) === '') {
// a file cannot be copied to itself
throw new Error(`'${newDest}' and '${source}' are the same file`);
}
yield copyFile(source, newDest, force);
}
});
}
exports.cp = cp;
/**
* Moves a path.
*
* @param source source path
* @param dest destination path
* @param options optional. See MoveOptions.
*/
function mv(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
if (yield ioUtil.exists(dest)) {
let destExists = true;
if (yield ioUtil.isDirectory(dest)) {
// If dest is directory copy src into dest
dest = path.join(dest, path.basename(source));
destExists = yield ioUtil.exists(dest);
}
if (destExists) {
if (options.force == null || options.force) {
yield rmRF(dest);
}
else {
throw new Error('Destination already exists');
}
}
}
yield mkdirP(path.dirname(dest));
yield ioUtil.rename(source, dest);
});
}
exports.mv = mv;
/**
* Remove a path recursively with force
*
* @param inputPath path to remove
*/
function rmRF(inputPath) {
return __awaiter(this, void 0, void 0, function* () {
if (ioUtil.IS_WINDOWS) {
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
try {
if (yield ioUtil.isDirectory(inputPath, true)) {
yield exec(`rd /s /q "${inputPath}"`);
}
else {
yield exec(`del /f /a "${inputPath}"`);
}
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
}
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
try {
yield ioUtil.unlink(inputPath);
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
}
}
else {
let isDir = false;
try {
isDir = yield ioUtil.isDirectory(inputPath);
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
return;
}
if (isDir) {
yield exec(`rm -rf "${inputPath}"`);
}
else {
yield ioUtil.unlink(inputPath);
}
}
});
}
exports.rmRF = rmRF;
/**
* Make a directory. Creates the full path with folders in between
* Will throw if it fails
*
* @param fsPath path to create
* @returns Promise<void>
*/
function mkdirP(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
yield ioUtil.mkdirP(fsPath);
});
}
exports.mkdirP = mkdirP;
/**
* Returns path of a tool had the tool actually been invoked. Resolves via paths.
* If you check and the tool does not exist, it will throw.
*
* @param tool name of the tool
* @param check whether to check if tool exists
* @returns Promise<string> path to tool
*/
function which(tool, check) {
return __awaiter(this, void 0, void 0, function* () {
if (!tool) {
throw new Error("parameter 'tool' is required");
}
// recursive when check=true
if (check) {
const result = yield which(tool, false);
if (!result) {
if (ioUtil.IS_WINDOWS) {
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
}
else {
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
}
}
}
try {
// build the list of extensions to try
const extensions = [];
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
if (extension) {
extensions.push(extension);
}
}
}
// if it's rooted, return it if exists. otherwise return empty.
if (ioUtil.isRooted(tool)) {
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
if (filePath) {
return filePath;
}
return '';
}
// if any path separators, return empty
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
return '';
}
// build the list of directories
//
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
// it feels like we should not do this. Checking the current directory seems like more of a use
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
// across platforms.
const directories = [];
if (process.env.PATH) {
for (const p of process.env.PATH.split(path.delimiter)) {
if (p) {
directories.push(p);
}
}
}
// return the first match
for (const directory of directories) {
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
if (filePath) {
return filePath;
}
}
return '';
}
catch (err) {
throw new Error(`which failed with message ${err.message}`);
}
});
}
exports.which = which;
function readCopyOptions(options) {
const force = options.force == null ? true : options.force;
const recursive = Boolean(options.recursive);
return { force, recursive };
}
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
return __awaiter(this, void 0, void 0, function* () {
// Ensure there is not a run away recursive copy
if (currentDepth >= 255)
return;
currentDepth++;
yield mkdirP(destDir);
const files = yield ioUtil.readdir(sourceDir);
for (const fileName of files) {
const srcFile = `${sourceDir}/${fileName}`;
const destFile = `${destDir}/${fileName}`;
const srcFileStat = yield ioUtil.lstat(srcFile);
if (srcFileStat.isDirectory()) {
// Recurse
yield cpDirRecursive(srcFile, destFile, currentDepth, force);
}
else {
yield copyFile(srcFile, destFile, force);
}
}
// Change the mode for the newly created directory
yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
});
}
// Buffered file copy
function copyFile(srcFile, destFile, force) {
return __awaiter(this, void 0, void 0, function* () {
if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
// unlink/re-link it
try {
yield ioUtil.lstat(destFile);
yield ioUtil.unlink(destFile);
}
catch (e) {
// Try to override file permission
if (e.code === 'EPERM') {
yield ioUtil.chmod(destFile, '0666');
yield ioUtil.unlink(destFile);
}
// other errors = it doesn't exist, no work to do
}
// Copy over symlink
const symlinkFull = yield ioUtil.readlink(srcFile);
yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
}
else if (!(yield ioUtil.exists(destFile)) || force) {
yield ioUtil.copyFile(srcFile, destFile);
}
});
}
//# sourceMappingURL=io.js.map
/***/ }),
/***/ 9:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
@ -61,6 +358,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
const os = __webpack_require__(87);
const events = __webpack_require__(614);
const child = __webpack_require__(129);
const path = __webpack_require__(622);
const io = __webpack_require__(1);
const ioUtil = __webpack_require__(672);
/* eslint-disable @typescript-eslint/unbound-method */
const IS_WINDOWS = process.platform === 'win32';
/*
@ -406,6 +706,16 @@ class ToolRunner extends events.EventEmitter {
*/
exec() {
return __awaiter(this, void 0, void 0, function* () {
// root the tool path if it is unrooted and contains relative pathing
if (!ioUtil.isRooted(this.toolPath) &&
(this.toolPath.includes('/') ||
(IS_WINDOWS && this.toolPath.includes('\\')))) {
// prefer options.cwd if it is specified, however options.cwd may also need to be rooted
this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
}
// if the tool is only a file name, then resolve it from the PATH
// otherwise verify it exists (add extension on Windows if necessary)
this.toolPath = yield io.which(this.toolPath, true);
return new Promise((resolve, reject) => {
this._debug(`exec tool: ${this.toolPath}`);
this._debug('arguments:');
@ -622,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:
@ -682,26 +1032,6 @@ function getInput(name, mandatory) {
});
}
exports.getInput = getInput;
/**
* Function to read the PHP version.
*/
function getVersion() {
return __awaiter(this, void 0, void 0, function* () {
const version = yield getInput('php-version', true);
switch (version) {
case '8.0':
case '8.0-dev':
case '7.4':
case '7.4snapshot':
case '7.4nightly':
case 'nightly':
return '7.4';
default:
return version;
}
});
}
exports.getVersion = getVersion;
/**
* Async foreach loop
*
@ -810,19 +1140,7 @@ exports.addLog = addLog;
*/
function readScript(filename, version, os_version) {
return __awaiter(this, void 0, void 0, function* () {
switch (os_version) {
case 'darwin':
switch (version) {
case '7.4':
return fs.readFileSync(path.join(__dirname, '../src/scripts/7.4.sh'), 'utf8');
}
return fs.readFileSync(path.join(__dirname, '../src/scripts/' + filename), 'utf8');
case 'linux':
case 'win32':
return fs.readFileSync(path.join(__dirname, '../src/scripts/' + filename), 'utf8');
default:
return yield log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
return fs.readFileSync(path.join(__dirname, '../src/scripts/' + filename), 'utf8');
});
}
exports.readScript = readScript;
@ -924,6 +1242,13 @@ function suppressOutput(os_version) {
exports.suppressOutput = suppressOutput;
/***/ }),
/***/ 357:
/***/ (function(module) {
module.exports = require("assert");
/***/ }),
/***/ 431:
@ -1248,10 +1573,17 @@ const config = __importStar(__webpack_require__(641));
*/
function addCoverageXdebug(version, os_version) {
return __awaiter(this, void 0, void 0, function* () {
return ((yield extensions.addExtension('xdebug', version, os_version, true)) +
(yield utils.suppressOutput(os_version)) +
'\n' +
(yield utils.addLog('$tick', 'xdebug', 'Xdebug enabled as coverage driver', os_version)));
switch (version) {
case '8.0':
return ('\n' +
(yield utils.addLog('$cross', 'xdebug', 'Xdebug currently only supports PHP 7.4 or lower', os_version)));
case '7.4':
default:
return ((yield extensions.addExtension('xdebug', version, os_version, true)) +
(yield utils.suppressOutput(os_version)) +
'\n' +
(yield utils.addLog('$tick', 'xdebug', 'Xdebug enabled as coverage driver', os_version)));
}
});
}
exports.addCoverageXdebug = addCoverageXdebug;
@ -1281,14 +1613,26 @@ function addCoveragePCOV(version, os_version) {
'/mods-available/xdebug.ini ]; then sudo phpdismod -v ' +
version +
' xdebug; fi\n';
script += 'sudo sed -i "/xdebug/d" $ini_file\n';
script += 'sudo sed -i "/xdebug/d" "$ini_file"\n';
script +=
'sudo DEBIAN_FRONTEND=noninteractive apt-fast remove php-xdebug -y ' +
(yield utils.suppressOutput('linux')) +
'\n';
break;
case 'darwin':
script += 'sudo sed -i \'\' "/xdebug/d" $ini_file\n';
script += 'sudo sed -i \'\' "/xdebug/d" "$ini_file"\n';
script +=
'sudo rm -rf "$ext_dir"/xdebug.so ' +
(yield utils.suppressOutput('darwin')) +
'\n';
break;
case 'win32':
script +=
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug C:\\tools\\php }\n';
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug $php_dir }\n';
script +=
'if (Test-Path $ext_dir\\php_xdebug.dll) { Remove-Item $ext_dir\\php_xdebug.dll }' +
(yield utils.suppressOutput('win32')) +
'\n';
break;
}
// success
@ -1327,18 +1671,38 @@ function disableCoverage(version, os_version) {
'/mods-available/pcov.ini ]; then sudo phpdismod -v ' +
version +
' pcov; fi\n';
script += 'sudo sed -i "/xdebug/d" $ini_file\n';
script += 'sudo sed -i "/pcov/d" $ini_file\n';
script += 'sudo sed -i "/xdebug/d" "$ini_file"\n';
script += 'sudo sed -i "/pcov/d" "$ini_file"\n';
script +=
'sudo DEBIAN_FRONTEND=noninteractive apt-fast remove php-xdebug php-pcov -y ' +
(yield utils.suppressOutput('linux')) +
'\n';
break;
case 'darwin':
script += 'sudo sed -i \'\' "/xdebug/d" $ini_file\n';
script += 'sudo sed -i \'\' "/pcov/d" $ini_file\n';
script += 'sudo sed -i \'\' "/xdebug/d" "$ini_file"\n';
script += 'sudo sed -i \'\' "/pcov/d" "$ini_file"\n';
script +=
'sudo rm -rf "$ext_dir"/xdebug.so ' +
(yield utils.suppressOutput('darwin')) +
'\n';
script +=
'sudo rm -rf "$ext_dir"/pcov.so ' +
(yield utils.suppressOutput('darwin')) +
'\n';
break;
case 'win32':
script +=
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug C:\\tools\\php }\n';
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug $php_dir }\n';
script +=
'if(php -m | findstr -i pcov) { Disable-PhpExtension pcov C:\\tools\\php }\n';
'if(php -m | findstr -i pcov) { Disable-PhpExtension pcov $php_dir }\n';
script +=
'if (Test-Path $ext_dir\\php_xdebug.dll) { Remove-Item $ext_dir\\php_xdebug.dll }' +
(yield utils.suppressOutput('win32')) +
'\n';
script +=
'if (Test-Path $ext_dir\\php_pcov.dll) { Remove-Item $ext_dir\\php_pcov.dll }' +
(yield utils.suppressOutput('win32')) +
'\n';
break;
}
script += yield utils.addLog('$tick', 'none', 'Disabled Xdebug and PCOV', os_version);
@ -1503,6 +1867,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
*
@ -1513,9 +1878,12 @@ const utils = __importStar(__webpack_require__(163));
function build(filename, version, os_version) {
return __awaiter(this, void 0, void 0, function* () {
// taking inputs
const extension_csv = yield utils.getInput('extension-csv', false);
const ini_values_csv = yield utils.getInput('ini-values-csv', false);
const extension_csv = (yield utils.getInput('extensions', false)) ||
(yield utils.getInput('extension-csv', false));
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);
@ -1537,7 +1905,8 @@ function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const os_version = process.platform;
const version = yield utils.getVersion();
let version = yield utils.getInput('php-version', true);
version = version.length > 1 ? version : version + '.0';
// check the os version and run the respective script
let script_path = '';
switch (os_version) {
@ -1556,6 +1925,7 @@ function run() {
yield exec_1.exec('pwsh ' + script_path + ' -version ' + version + ' -dir ' + __dirname);
break;
}
yield matchers.addMatchers();
}
catch (error) {
core.setFailed(error.message);
@ -1567,6 +1937,215 @@ exports.run = run;
run();
/***/ }),
/***/ 669:
/***/ (function(module) {
module.exports = require("util");
/***/ }),
/***/ 672:
/***/ (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 _a;
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __webpack_require__(357);
const fs = __webpack_require__(747);
const path = __webpack_require__(622);
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
exports.IS_WINDOWS = process.platform === 'win32';
function exists(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
try {
yield exports.stat(fsPath);
}
catch (err) {
if (err.code === 'ENOENT') {
return false;
}
throw err;
}
return true;
});
}
exports.exists = exists;
function isDirectory(fsPath, useStat = false) {
return __awaiter(this, void 0, void 0, function* () {
const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
return stats.isDirectory();
});
}
exports.isDirectory = isDirectory;
/**
* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
*/
function isRooted(p) {
p = normalizeSeparators(p);
if (!p) {
throw new Error('isRooted() parameter "p" cannot be empty');
}
if (exports.IS_WINDOWS) {
return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
); // e.g. C: or C:\hello
}
return p.startsWith('/');
}
exports.isRooted = isRooted;
/**
* Recursively create a directory at `fsPath`.
*
* This implementation is optimistic, meaning it attempts to create the full
* path first, and backs up the path stack from there.
*
* @param fsPath The path to create
* @param maxDepth The maximum recursion depth
* @param depth The current recursion depth
*/
function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(fsPath, 'a path argument must be provided');
fsPath = path.resolve(fsPath);
if (depth >= maxDepth)
return exports.mkdir(fsPath);
try {
yield exports.mkdir(fsPath);
return;
}
catch (err) {
switch (err.code) {
case 'ENOENT': {
yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
yield exports.mkdir(fsPath);
return;
}
default: {
let stats;
try {
stats = yield exports.stat(fsPath);
}
catch (err2) {
throw err;
}
if (!stats.isDirectory())
throw err;
}
}
}
});
}
exports.mkdirP = mkdirP;
/**
* Best effort attempt to determine whether a file exists and is executable.
* @param filePath file path to check
* @param extensions additional file extensions to try
* @return if file exists and is executable, returns the file path. otherwise empty string.
*/
function tryGetExecutablePath(filePath, extensions) {
return __awaiter(this, void 0, void 0, function* () {
let stats = undefined;
try {
// test file exists
stats = yield exports.stat(filePath);
}
catch (err) {
if (err.code !== 'ENOENT') {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
}
}
if (stats && stats.isFile()) {
if (exports.IS_WINDOWS) {
// on Windows, test for valid extension
const upperExt = path.extname(filePath).toUpperCase();
if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
return filePath;
}
}
else {
if (isUnixExecutable(stats)) {
return filePath;
}
}
}
// try each extension
const originalFilePath = filePath;
for (const extension of extensions) {
filePath = originalFilePath + extension;
stats = undefined;
try {
stats = yield exports.stat(filePath);
}
catch (err) {
if (err.code !== 'ENOENT') {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
}
}
if (stats && stats.isFile()) {
if (exports.IS_WINDOWS) {
// preserve the case of the actual file (since an extension was appended)
try {
const directory = path.dirname(filePath);
const upperName = path.basename(filePath).toUpperCase();
for (const actualName of yield exports.readdir(directory)) {
if (upperName === actualName.toUpperCase()) {
filePath = path.join(directory, actualName);
break;
}
}
}
catch (err) {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
}
return filePath;
}
else {
if (isUnixExecutable(stats)) {
return filePath;
}
}
}
}
return '';
});
}
exports.tryGetExecutablePath = tryGetExecutablePath;
function normalizeSeparators(p) {
p = p || '';
if (exports.IS_WINDOWS) {
// convert slashes on Windows
p = p.replace(/\//g, '\\');
// remove redundant slashes
return p.replace(/\\\\+/g, '\\');
}
// remove redundant slashes
return p.replace(/\/\/+/g, '/');
}
// on Mac/Linux, test the execute bit
// R W X R W X R W X
// 256 128 64 32 16 8 4 2 1
function isUnixExecutable(stats) {
return ((stats.mode & 1) > 0 ||
((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
((stats.mode & 64) > 0 && stats.uid === process.getuid()));
}
//# sourceMappingURL=io-util.js.map
/***/ }),
/***/ 747:
@ -1619,6 +2198,9 @@ function addExtensionDarwin(extension_csv, version) {
case '5.6xdebug':
install_command = 'sudo pecl install xdebug-2.5.5 >/dev/null 2>&1';
break;
case '5.6redis':
install_command = 'sudo pecl install redis-2.2.8 >/dev/null 2>&1';
break;
default:
install_command = 'sudo pecl install ' + extension + ' >/dev/null 2>&1';
break;
@ -1649,7 +2231,14 @@ function addExtensionWindows(extension_csv, version) {
yield utils.asyncForEach(extensions, function (extension) {
return __awaiter(this, void 0, void 0, function* () {
// add script to enable extension is already installed along with php
script += '\nAdd-Extension ' + extension;
switch (version + extension) {
case '7.4redis':
script += '\nAdd-Extension ' + extension + ' beta';
break;
default:
script += '\nAdd-Extension ' + extension;
break;
}
});
});
return script;
@ -1672,12 +2261,16 @@ function addExtensionLinux(extension_csv, version) {
// add script to enable extension is already installed along with php
let install_command = '';
switch (version + extension) {
case '7.4redis':
install_command =
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-igbinary php7.4-redis >/dev/null 2>&1';
break;
case '7.2phalcon3':
case '7.3phalcon3':
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') +
' master ' +
' 3.4.x ' +
version +
' >/dev/null 2>&1';
break;
@ -1687,7 +2280,19 @@ function addExtensionLinux(extension_csv, version) {
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') +
' 4.0.x ' +
' master ' +
version +
' >/dev/null 2>&1';
break;
case '7.0gearman':
case '7.1gearman':
case '7.2gearman':
case '7.3gearman':
case '7.4gearman':
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/gearman.sh') +
' ' +
version +
' >/dev/null 2>&1';
break;

View File

@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
- name: Get composer cache directory

View File

@ -6,16 +6,16 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.2', '7.3']
php-versions: ['7.2', '7.3', '7.4']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, intl, curl, dom
extensions: mbstring, intl, curl, dom
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -36,10 +36,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, dom, fileinfo, mysql
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -38,10 +38,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, dom, fileinfo, pgsql
extensions: mbstring, dom, fileinfo, pgsql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -9,15 +9,15 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.2', '7.3']
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, dom, fileinfo
extensions: mbstring, dom, fileinfo
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -31,15 +31,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3']
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, dom, fileinfo, mysql
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -33,15 +33,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3']
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, dom, fileinfo, pgsql
extensions: mbstring, dom, fileinfo, pgsql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -9,15 +9,15 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.2', '7.3']
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, dom, fileinfo, mysql
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -34,10 +34,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, dom, zip, phalcon4, mysql #use phalcon3 for the phalcon 3.x.
extensions: mbstring, dom, zip, phalcon4, mysql #use phalcon3 for the phalcon 3.x.
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -35,10 +35,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, dom, zip, phalcon4, pgsql #use phalcon3 for the phalcon 3.x
extensions: mbstring, dom, zip, phalcon4, pgsql #use phalcon3 for the phalcon 3.x
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -14,14 +14,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@master
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-versions }}
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring
extensions: mbstring
- name: Check node versions
run: node -v
- name: Get yarn cache

View File

@ -6,16 +6,16 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.2', '7.3']
php-versions: ['7.2', '7.3', '7.4']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, simplexml, dom
extensions: mbstring, simplexml, dom
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -18,15 +18,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.3']
php-versions: ['7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, xml, ctype, iconv, mysql
extensions: mbstring, xml, ctype, iconv, mysql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -18,15 +18,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.3']
php-versions: ['7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, xml, ctype, iconv, pgsql
extensions: mbstring, xml, ctype, iconv, pgsql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -9,15 +9,15 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.3']
php-versions: ['7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, xml, ctype, iconv
extensions: mbstring, xml, ctype, iconv
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -29,14 +29,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Set Node.js 10.x
uses: actions/setup-node@master
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, intl, gd, imagick, zip, dom, mysql
extensions: mbstring, intl, gd, imagick, zip, dom, mysql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -29,14 +29,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Set Node.js 10.x
uses: actions/setup-node@master
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, intl, gd, imagick, zip, dom, pgsql
extensions: mbstring, intl, gd, imagick, zip, dom, pgsql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

View File

@ -6,16 +6,16 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.2', '7.3']
php-versions: ['7.2', '7.3', '7.4']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, bcmath, curl, intl
extensions: mbstring, bcmath, curl, intl
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache

365
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "setup-php",
"version": "1.5.5",
"version": "1.6.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -10,9 +10,17 @@
"integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw=="
},
"@actions/exec": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.2.tgz",
"integrity": "sha512-Yo/wfcFuxbVjAaAfvx3aGLhMEuonOahas2jf8BwyA52IkXTAmLi7YVZTpGAQG/lTxuGoNLg9slTWQD4rr7rMDQ==",
"requires": {
"@actions/io": "^1.0.1"
}
},
"@actions/io": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.1.tgz",
"integrity": "sha512-nvFkxwiicvpzNiCBF4wFBDfnBvi7xp/as7LE1hBxBxKG2L29+gkIPBiLKMVORL+Hg3JNf07AKRfl0V5djoypjQ=="
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz",
"integrity": "sha512-rhq+tfZukbtaus7xyUtwKfuiCRXd1hWSfmJNEpFgBQJ4woqPEpsBw04awicjwz9tyG2/MVhAEMfVn664Cri5zA=="
},
"@babel/code-frame": {
"version": "7.5.5",
@ -24,15 +32,15 @@
}
},
"@babel/core": {
"version": "7.7.4",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.4.tgz",
"integrity": "sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ==",
"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.4",
"@babel/parser": "^7.7.7",
"@babel/template": "^7.7.4",
"@babel/traverse": "^7.7.4",
"@babel/types": "^7.7.4",
@ -60,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",
@ -137,9 +145,9 @@
}
},
"@babel/parser": {
"version": "7.7.4",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.4.tgz",
"integrity": "sha512-jIwvLO0zCL+O/LmEJQjWA75MQTWwx3c3u2JOTDK5D3/9egrWRRA0/0hk9XXywYnXZVVpzrBYeIQTmhwUaePI9g==",
"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": {
@ -436,9 +444,9 @@
}
},
"@types/babel__generator": {
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.0.tgz",
"integrity": "sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw==",
"version": "7.6.1",
"resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.1.tgz",
"integrity": "sha512-bBKm+2VPJcMRVwNhxKu8W+5/zT7pwNEqeokFOmbvVSqGzFneNxYcEBro9Ac7/N9tlsaPYnZLK8J1LWKkMsLAew==",
"dev": true,
"requires": {
"@babel/types": "^7.0.0"
@ -495,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"
@ -510,9 +518,9 @@
"dev": true
},
"@types/node": {
"version": "12.12.14",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.14.tgz",
"integrity": "sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA==",
"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": {
@ -543,12 +551,12 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.9.0.tgz",
"integrity": "sha512-98rfOt3NYn5Gr9wekTB8TexxN6oM8ZRvYuphPs1Atfsy419SDLYCaE30aJkRiiTCwGEY98vOhFsEVm7Zs4toQQ==",
"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.9.0",
"@typescript-eslint/experimental-utils": "2.12.0",
"eslint-utils": "^1.4.3",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
@ -556,32 +564,32 @@
}
},
"@typescript-eslint/experimental-utils": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.9.0.tgz",
"integrity": "sha512-0lOLFdpdJsCMqMSZT7l7W2ta0+GX8A3iefG3FovJjrX+QR8y6htFlFdU7aOVPL6pDvt6XcsOb8fxk5sq+girTw==",
"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.9.0",
"@typescript-eslint/typescript-estree": "2.12.0",
"eslint-scope": "^5.0.0"
}
},
"@typescript-eslint/parser": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.9.0.tgz",
"integrity": "sha512-fJ+dNs3CCvEsJK2/Vg5c2ZjuQ860ySOAsodDPwBaVlrGvRN+iCNC8kUfLFL8cT49W4GSiLPa/bHiMjYXA7EhKQ==",
"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.9.0",
"@typescript-eslint/typescript-estree": "2.9.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.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.9.0.tgz",
"integrity": "sha512-v6btSPXEWCP594eZbM+JCXuFoXWXyF/z8kaSBSdCb83DF+Y7+xItW29SsKtSULgLemqJBT+LpT+0ZqdfH7QVmA==",
"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",
@ -721,13 +729,13 @@
"dev": true
},
"array-includes": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz",
"integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.0.tgz",
"integrity": "sha512-ONOEQoKrvXPKk7Su92Co0YMqYO32FfqJTzkKU9u2UpIXyYZIzLSvpdg4AwvSw4mSUW0czu6inK+zby6Oj6gDjQ==",
"dev": true,
"requires": {
"define-properties": "^1.1.2",
"es-abstract": "^1.7.0"
"define-properties": "^1.1.3",
"es-abstract": "^1.17.0-next.0"
}
},
"array-unique": {
@ -736,6 +744,16 @@
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
"dev": true
},
"array.prototype.flat": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz",
"integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.0-next.1"
}
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
@ -962,6 +980,16 @@
"tweetnacl": "^0.14.3"
}
},
"bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"dev": true,
"optional": true,
"requires": {
"file-uri-to-path": "1.0.0"
}
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@ -1558,9 +1586,9 @@
}
},
"es-abstract": {
"version": "1.16.2",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.2.tgz",
"integrity": "sha512-jYo/J8XU2emLXl3OLwfwtuFfuF2w6DYPs+xy9ZfVyPkDcrauu6LYrw/q2TyCtrbc/KUdCiC5e9UajRhgNkVopA==",
"version": "1.17.0-next.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz",
"integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
@ -1571,6 +1599,7 @@
"is-regex": "^1.0.4",
"object-inspect": "^1.7.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.0",
"string.prototype.trimleft": "^2.1.0",
"string.prototype.trimright": "^2.1.0"
}
@ -1614,9 +1643,9 @@
}
},
"eslint": {
"version": "6.7.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.7.1.tgz",
"integrity": "sha512-UWzBS79pNcsDSxgxbdjkmzn/B6BhsXMfUaOHnNwyE8nD+Q6pyT96ow2MccVayUTV4yMid4qLhMiQaywctRkBLA==",
"version": "6.7.2",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.7.2.tgz",
"integrity": "sha512-qMlSWJaCSxDFr8fBPvJM9kJwbazrhNcBU3+DszDW1OlEwKBBRWsJc7NJFelvwQpanHCR14cOLD41x8Eqvo3Nng==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
@ -1703,12 +1732,12 @@
}
},
"eslint-module-utils": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz",
"integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==",
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.5.0.tgz",
"integrity": "sha512-kCo8pZaNz2dsAW7nCUjuVoI11EBXXpIzfNxmaoLhXoRDOnqXLC4iSGVRdZPhOitfbdEfMEfKOiENaK6wDPZEGw==",
"dev": true,
"requires": {
"debug": "^2.6.8",
"debug": "^2.6.9",
"pkg-dir": "^2.0.0"
},
"dependencies": {
@ -1730,22 +1759,23 @@
}
},
"eslint-plugin-import": {
"version": "2.18.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz",
"integrity": "sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==",
"version": "2.19.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.19.1.tgz",
"integrity": "sha512-x68131aKoCZlCae7rDXKSAQmbT5DQuManyXo2sK6fJJ0aK5CWAkv6A6HJZGgqC8IhjQxYPgo6/IY4Oz8AFsbBw==",
"dev": true,
"requires": {
"array-includes": "^3.0.3",
"array.prototype.flat": "^1.2.1",
"contains-path": "^0.1.0",
"debug": "^2.6.9",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "^0.3.2",
"eslint-module-utils": "^2.4.0",
"eslint-module-utils": "^2.4.1",
"has": "^1.0.3",
"minimatch": "^3.0.4",
"object.values": "^1.1.0",
"read-pkg-up": "^2.0.0",
"resolve": "^1.11.0"
"resolve": "^1.12.0"
},
"dependencies": {
"debug": {
@ -1776,18 +1806,18 @@
}
},
"eslint-plugin-jest": {
"version": "23.0.5",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.0.5.tgz",
"integrity": "sha512-etxXrWsFWzxsrxKwJnFC38uppH/vlJ3oF7Wmp/cxedqxRIxVhXup8e5y5MmtVXelevgxrgA1QS1vo8j889iK5Q==",
"version": "23.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.1.1.tgz",
"integrity": "sha512-2oPxHKNh4j1zmJ6GaCBuGcb8FVZU7YjFUOJzGOPnl9ic7VA/MGAskArLJiRIlnFUmi1EUxY+UiATAy8dv8s5JA==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "^2.5.0"
}
},
"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"
@ -2078,9 +2108,9 @@
"dev": true
},
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true
},
"fast-levenshtein": {
@ -2090,12 +2120,12 @@
"dev": true
},
"fb-watchman": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz",
"integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz",
"integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==",
"dev": true,
"requires": {
"bser": "^2.0.0"
"bser": "2.1.1"
}
},
"figures": {
@ -2116,6 +2146,13 @@
"flat-cache": "^2.0.1"
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
"dev": true,
"optional": true
},
"fill-range": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
@ -2209,14 +2246,15 @@
"dev": true
},
"fsevents": {
"version": "1.2.9",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
"integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==",
"version": "1.2.11",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz",
"integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==",
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1",
"node-pre-gyp": "^0.12.0"
"node-pre-gyp": "*"
},
"dependencies": {
"abbrev": {
@ -2249,19 +2287,21 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"chownr": {
"version": "1.1.1",
"version": "1.1.3",
"bundled": true,
"dev": true,
"optional": true
@ -2269,17 +2309,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -2288,7 +2331,7 @@
"optional": true
},
"debug": {
"version": "4.1.1",
"version": "3.2.6",
"bundled": true,
"dev": true,
"optional": true,
@ -2315,12 +2358,12 @@
"optional": true
},
"fs-minipass": {
"version": "1.2.5",
"version": "1.2.7",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minipass": "^2.2.1"
"minipass": "^2.6.0"
}
},
"fs.realpath": {
@ -2346,7 +2389,7 @@
}
},
"glob": {
"version": "7.1.3",
"version": "7.1.6",
"bundled": true,
"dev": true,
"optional": true,
@ -2375,7 +2418,7 @@
}
},
"ignore-walk": {
"version": "3.0.1",
"version": "3.0.3",
"bundled": true,
"dev": true,
"optional": true,
@ -2394,9 +2437,10 @@
}
},
"inherits": {
"version": "2.0.3",
"version": "2.0.4",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -2408,6 +2452,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -2422,6 +2467,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -2429,53 +2475,56 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
}
},
"minizlib": {
"version": "1.2.1",
"version": "1.3.3",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minipass": "^2.2.1"
"minipass": "^2.9.0"
}
},
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
},
"ms": {
"version": "2.1.1",
"version": "2.1.2",
"bundled": true,
"dev": true,
"optional": true
},
"needle": {
"version": "2.3.0",
"version": "2.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"debug": "^4.1.0",
"debug": "^3.2.6",
"iconv-lite": "^0.4.4",
"sax": "^1.2.4"
}
},
"node-pre-gyp": {
"version": "0.12.0",
"version": "0.14.0",
"bundled": true,
"dev": true,
"optional": true,
@ -2489,7 +2538,7 @@
"rc": "^1.2.7",
"rimraf": "^2.6.1",
"semver": "^5.3.0",
"tar": "^4"
"tar": "^4.4.2"
}
},
"nopt": {
@ -2503,13 +2552,22 @@
}
},
"npm-bundled": {
"version": "1.0.6",
"version": "1.1.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"npm-normalize-package-bin": "^1.0.1"
}
},
"npm-normalize-package-bin": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"npm-packlist": {
"version": "1.4.1",
"version": "1.4.7",
"bundled": true,
"dev": true,
"optional": true,
@ -2533,7 +2591,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -2545,6 +2604,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -2578,7 +2638,7 @@
"optional": true
},
"process-nextick-args": {
"version": "2.0.0",
"version": "2.0.1",
"bundled": true,
"dev": true,
"optional": true
@ -2619,7 +2679,7 @@
}
},
"rimraf": {
"version": "2.6.3",
"version": "2.7.1",
"bundled": true,
"dev": true,
"optional": true,
@ -2645,7 +2705,7 @@
"optional": true
},
"semver": {
"version": "5.7.0",
"version": "5.7.1",
"bundled": true,
"dev": true,
"optional": true
@ -2666,6 +2726,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -2696,18 +2757,18 @@
"optional": true
},
"tar": {
"version": "4.4.8",
"version": "4.4.13",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"chownr": "^1.1.1",
"fs-minipass": "^1.2.5",
"minipass": "^2.3.4",
"minizlib": "^1.1.1",
"minipass": "^2.8.6",
"minizlib": "^1.2.1",
"mkdirp": "^0.5.0",
"safe-buffer": "^5.1.2",
"yallist": "^3.0.2"
"yallist": "^3.0.3"
}
},
"util-deprecate": {
@ -2731,7 +2792,7 @@
"dev": true
},
"yallist": {
"version": "3.0.3",
"version": "3.1.1",
"bundled": true,
"dev": true
}
@ -3163,9 +3224,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",
@ -3177,7 +3238,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"
@ -3260,9 +3321,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": {
@ -3359,12 +3420,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": {
@ -4525,14 +4586,26 @@
"isobject": "^3.0.0"
}
},
"object.getownpropertydescriptors": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
"integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
"object.assign": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
"integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
"dev": true,
"requires": {
"define-properties": "^1.1.2",
"es-abstract": "^1.5.1"
"function-bind": "^1.1.1",
"has-symbols": "^1.0.0",
"object-keys": "^1.0.11"
}
},
"object.getownpropertydescriptors": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz",
"integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.0-next.1"
}
},
"object.pick": {
@ -4545,13 +4618,13 @@
}
},
"object.values": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz",
"integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz",
"integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"es-abstract": "^1.12.0",
"es-abstract": "^1.17.0-next.1",
"function-bind": "^1.1.1",
"has": "^1.0.3"
}
@ -4819,9 +4892,9 @@
}
},
"psl": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz",
"integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==",
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.6.0.tgz",
"integrity": "sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA==",
"dev": true
},
"pump": {
@ -4995,9 +5068,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"
@ -5554,9 +5627,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",
@ -5564,9 +5637,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",
@ -5954,15 +6027,15 @@
"dev": true
},
"typescript": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz",
"integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==",
"version": "3.7.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz",
"integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==",
"dev": true
},
"uglify-js": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.0.tgz",
"integrity": "sha512-PC/ee458NEMITe1OufAjal65i6lB58R1HWMRcxwvdz1UopW0DYqlRL3xdu3IcTvTXsB02CRHykidkTRL+A3hQA==",
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.2.tgz",
"integrity": "sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA==",
"dev": true,
"optional": true,
"requires": {

View File

@ -1,13 +1,13 @@
{
"name": "setup-php",
"version": "1.5.5",
"version": "1.6.2",
"private": false,
"description": "Setup PHP for use with GitHub Actions",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"lint": "eslint **/*.ts --cache",
"format": "prettier --write **/*.ts",
"format": "prettier --write **/*.ts && git add .",
"format-check": "prettier --check **/*.ts",
"release": "ncc build src/install.ts -o dist && git add -f dist/",
"test": "jest"
@ -25,18 +25,19 @@
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.1",
"@actions/exec": "^1.0.2",
"@actions/io": "^1.0.1",
"fs": "0.0.1-security"
},
"devDependencies": {
"@types/jest": "^24.0.21",
"@types/node": "^12.12.0",
"@typescript-eslint/eslint-plugin": "^2.7.0",
"@typescript-eslint/parser": "^2.7.0",
"@types/node": "^12.12.16",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"@zeit/ncc": "^0.20.5",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-jest": "^23.0.3",
"eslint-plugin-prettier": "^3.1.1",
"husky": "^3.0.9",
@ -44,7 +45,7 @@
"jest-circus": "^24.9.0",
"prettier": "^1.17.1",
"ts-jest": "^24.1.0",
"typescript": "^3.6.4"
"typescript": "^3.7.3"
},
"husky": {
"skipCI": true,

24
src/configs/phpunit.json Normal file
View File

@ -0,0 +1,24 @@
{
"problemMatcher": [
{
"owner": "phpunit",
"pattern": [
{
"regexp": "^\\d+\\)\\s.*$"
},
{
"regexp": "^(.*)$",
"message": 1
},
{
"regexp": "^\\s*$"
},
{
"regexp": "^(.*):(\\d+)$",
"file": 1,
"line": 2
}
]
}
]
}

View File

@ -12,17 +12,31 @@ export async function addCoverageXdebug(
version: string,
os_version: string
): Promise<string> {
return (
(await extensions.addExtension('xdebug', version, os_version, true)) +
(await utils.suppressOutput(os_version)) +
'\n' +
(await utils.addLog(
'$tick',
'xdebug',
'Xdebug enabled as coverage driver',
os_version
))
);
switch (version) {
case '8.0':
return (
'\n' +
(await utils.addLog(
'$cross',
'xdebug',
'Xdebug currently only supports PHP 7.4 or lower',
os_version
))
);
case '7.4':
default:
return (
(await extensions.addExtension('xdebug', version, os_version, true)) +
(await utils.suppressOutput(os_version)) +
'\n' +
(await utils.addLog(
'$tick',
'xdebug',
'Xdebug enabled as coverage driver',
os_version
))
);
}
}
/**
@ -54,14 +68,26 @@ export async function addCoveragePCOV(
'/mods-available/xdebug.ini ]; then sudo phpdismod -v ' +
version +
' xdebug; fi\n';
script += 'sudo sed -i "/xdebug/d" $ini_file\n';
script += 'sudo sed -i "/xdebug/d" "$ini_file"\n';
script +=
'sudo DEBIAN_FRONTEND=noninteractive apt-fast remove php-xdebug -y ' +
(await utils.suppressOutput('linux')) +
'\n';
break;
case 'darwin':
script += 'sudo sed -i \'\' "/xdebug/d" $ini_file\n';
script += 'sudo sed -i \'\' "/xdebug/d" "$ini_file"\n';
script +=
'sudo rm -rf "$ext_dir"/xdebug.so ' +
(await utils.suppressOutput('darwin')) +
'\n';
break;
case 'win32':
script +=
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug C:\\tools\\php }\n';
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug $php_dir }\n';
script +=
'if (Test-Path $ext_dir\\php_xdebug.dll) { Remove-Item $ext_dir\\php_xdebug.dll }' +
(await utils.suppressOutput('win32')) +
'\n';
break;
}
@ -113,18 +139,38 @@ export async function disableCoverage(
'/mods-available/pcov.ini ]; then sudo phpdismod -v ' +
version +
' pcov; fi\n';
script += 'sudo sed -i "/xdebug/d" $ini_file\n';
script += 'sudo sed -i "/pcov/d" $ini_file\n';
script += 'sudo sed -i "/xdebug/d" "$ini_file"\n';
script += 'sudo sed -i "/pcov/d" "$ini_file"\n';
script +=
'sudo DEBIAN_FRONTEND=noninteractive apt-fast remove php-xdebug php-pcov -y ' +
(await utils.suppressOutput('linux')) +
'\n';
break;
case 'darwin':
script += 'sudo sed -i \'\' "/xdebug/d" $ini_file\n';
script += 'sudo sed -i \'\' "/pcov/d" $ini_file\n';
script += 'sudo sed -i \'\' "/xdebug/d" "$ini_file"\n';
script += 'sudo sed -i \'\' "/pcov/d" "$ini_file"\n';
script +=
'sudo rm -rf "$ext_dir"/xdebug.so ' +
(await utils.suppressOutput('darwin')) +
'\n';
script +=
'sudo rm -rf "$ext_dir"/pcov.so ' +
(await utils.suppressOutput('darwin')) +
'\n';
break;
case 'win32':
script +=
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug C:\\tools\\php }\n';
'if(php -m | findstr -i xdebug) { Disable-PhpExtension xdebug $php_dir }\n';
script +=
'if(php -m | findstr -i pcov) { Disable-PhpExtension pcov C:\\tools\\php }\n';
'if(php -m | findstr -i pcov) { Disable-PhpExtension pcov $php_dir }\n';
script +=
'if (Test-Path $ext_dir\\php_xdebug.dll) { Remove-Item $ext_dir\\php_xdebug.dll }' +
(await utils.suppressOutput('win32')) +
'\n';
script +=
'if (Test-Path $ext_dir\\php_pcov.dll) { Remove-Item $ext_dir\\php_pcov.dll }' +
(await utils.suppressOutput('win32')) +
'\n';
break;
}
script += await utils.addLog(

Binary file not shown.

View File

@ -21,6 +21,9 @@ export async function addExtensionDarwin(
case '5.6xdebug':
install_command = 'sudo pecl install xdebug-2.5.5 >/dev/null 2>&1';
break;
case '5.6redis':
install_command = 'sudo pecl install redis-2.2.8 >/dev/null 2>&1';
break;
default:
install_command = 'sudo pecl install ' + extension + ' >/dev/null 2>&1';
break;
@ -50,7 +53,14 @@ export async function addExtensionWindows(
let script = '\n';
await utils.asyncForEach(extensions, async function(extension: string) {
// add script to enable extension is already installed along with php
script += '\nAdd-Extension ' + extension;
switch (version + extension) {
case '7.4redis':
script += '\nAdd-Extension ' + extension + ' beta';
break;
default:
script += '\nAdd-Extension ' + extension;
break;
}
});
return script;
}
@ -73,12 +83,16 @@ export async function addExtensionLinux(
let install_command = '';
switch (version + extension) {
case '7.4redis':
install_command =
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-igbinary php7.4-redis >/dev/null 2>&1';
break;
case '7.2phalcon3':
case '7.3phalcon3':
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') +
' master ' +
' 3.4.x ' +
version +
' >/dev/null 2>&1';
break;
@ -88,7 +102,19 @@ export async function addExtensionLinux(
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') +
' 4.0.x ' +
' master ' +
version +
' >/dev/null 2>&1';
break;
case '7.0gearman':
case '7.1gearman':
case '7.2gearman':
case '7.3gearman':
case '7.4gearman':
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/gearman.sh') +
' ' +
version +
' >/dev/null 2>&1';
break;

View File

@ -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 * as matchers from './matchers';
/**
* Build the script
@ -18,9 +19,14 @@ export async function build(
os_version: string
): Promise<string> {
// taking inputs
const extension_csv: string = await utils.getInput('extension-csv', false);
const ini_values_csv: string = await utils.getInput('ini-values-csv', false);
const extension_csv: string =
(await utils.getInput('extensions', false)) ||
(await utils.getInput('extension-csv', false));
const ini_values_csv: string =
(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) {
@ -42,7 +48,8 @@ export async function build(
export async function run(): Promise<void> {
try {
const os_version: string = process.platform;
const version: string = await utils.getVersion();
let version: string = await utils.getInput('php-version', true);
version = version.length > 1 ? version : version + '.0';
// check the os version and run the respective script
let script_path = '';
switch (os_version) {
@ -63,6 +70,7 @@ export async function run(): Promise<void> {
);
break;
}
await matchers.addMatchers();
} catch (error) {
core.setFailed(error.message);
}

18
src/matchers.ts Normal file
View File

@ -0,0 +1,18 @@
import * as path from 'path';
import * as utils from './utils';
import * as io from '@actions/io';
/**
* Cache json files for problem matchers
*/
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);
}

View File

@ -16,7 +16,7 @@ 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
}
version='7.4.0RC6'
version='7.4.0'
step_log "Setup dependencies"
for package in pkg-config autoconf bison re2c openssl@1.1 krb5 enchant libffi freetype intltool icu4c libiconv t1lib gd libzip gmp tidyp libxml2 libxslt postgresql curl;
do
@ -78,13 +78,14 @@ source ~/.bash_profile >/dev/null 2>&1
source ~/.bashrc >/dev/null 2>&1
step_log "Setup PHP and Composer"
phpbrew install -j 6 $version +dev >/dev/null 2>&1
phpbrew install -j 6 github:php/php-src@PHP-$version as php-$version +dev >/dev/null 2>&1
phpbrew switch $version
sudo ln -sf /opt/phpbrew/php/php-$version/bin/* /usr/local/bin/
sudo ln -sf /opt/phpbrew/php/php-$version/etc/php.ini /etc/php.ini
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ext_dir=$(php -i | grep "extension_dir => /opt" | sed -e "s|.*=> s*||")
pecl config-set php_ini "$ini_file" >/dev/null 2>&1
pear config-set php_ini "$ini_file" >/dev/null 2>&1
sudo chmod 777 "$ini_file"
brew install composer >/dev/null 2>&1

View File

@ -17,13 +17,25 @@ add_log() {
fi
}
version=$1
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
if [ "$1" = "5.6" ] || [ "$1" = "7.0" ]; then
brew tap exolnet/homebrew-deprecated >/dev/null 2>&1
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"
brew install php@"$1" composer >/dev/null 2>&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
brew link --force --overwrite php@"$1" >/dev/null 2>&1
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
echo "date.timezone=UTC" >> "$ini_file"
@ -31,27 +43,29 @@ ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
sudo chmod 777 "$ini_file"
mkdir -p "$(pecl config-get ext_dir)"
composer global require hirak/prestissimo >/dev/null 2>&1
add_log "$tick" "PHP" "Installed PHP$version"
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
add_log "$tick" "PHP" "Installed PHP $semver"
add_log "$tick" "Composer" "Installed"
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
(
eval "$install_command" && \
add_log "$tick" "$extension" "Installed and enabled"
) || add_log "$cross" "$extension" "Could not install $extension on PHP$version"
) || add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
else
if ! php -m | grep -i -q "$extension"; then
add_log "$cross" "$extension" "Could not find $extension for PHP$version on PECL"
if ! php -m | grep -i -q "$extension_regex"; then
add_log "$cross" "$extension" "Could not find $extension for PHP $semver on PECL"
fi
fi
fi

9
src/scripts/gearman.sh Normal file
View File

@ -0,0 +1,9 @@
release_version=$(lsb_release -s -r)
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/pkg-gearman -y
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
if [ "$release_version" = "18.04" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y libgearman-dev php"$1"-gearman
elif [ "$release_version" = "16.04" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1"-gearman
fi

View File

@ -16,28 +16,66 @@ 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)
version=$1
status="Switched to PHP$version"
semver=$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')
step_log "Setup PHP and Composer"
sudo mkdir -p /var/run
sudo mkdir -p /run/php
find /etc/apt/sources.list.d -type f -name 'ondrej-ubuntu-php*.list' -exec sudo DEBIAN_FRONTEND=noninteractive apt-fast update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1
if [ "$existing_version" != "$1" ]; then
if [ ! -e "/usr/bin/php$1" ]; then
if [ "$1" != "7.4" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1" curl php"$1"-curl >/dev/null 2>&1
if [ "$1" = "7.4" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1" php"$1"-phpdbg php"$1"-xml curl php"$1"-curl >/dev/null 2>&1
elif [ "$1" = "8.0" ]; then
tar_file=php_"$1"%2Bubuntu"$(lsb_release -r -s)".tar.xz
install_dir=~/php/"$1"
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install libicu-dev >/dev/null 2>&1
curl -o "$tar_file" -L https://bintray.com/shivammathur/php/download_file?file_path="$tar_file" >/dev/null 2>&1
sudo mkdir -m 777 -p ~/php
sudo tar xf "$tar_file" -C ~/php >/dev/null 2>&1 && rm -rf "$tar_file"
sudo ln -sf -S "$1" "$install_dir"/bin/* /usr/bin/ && sudo ln -sf "$install_dir"/etc/php.ini /etc/php.ini
else
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1" php"$1"-dev php"$1"-xml curl php"$1"-curl >/dev/null 2>&1
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1" curl php"$1"-curl >/dev/null 2>&1
fi
status="Installed PHP$version"
status="installed"
else
status="switched"
fi
for tool in php phar phar.phar php-cgi php-config phpize; do
for tool in pear pecl php phar phar.phar php-cgi php-config phpize phpdbg; do
if [ -e "/usr/bin/$tool$1" ]; then
sudo update-alternatives --set $tool /usr/bin/"$tool$1" >/dev/null 2>&1
fi
done
semver=$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')
if [ "$1" = "8.0" ]; then
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
fi
if [ "$status" != "switched" ]; then
status="Installed PHP $semver"
else
status="Switched to PHP $semver"
fi
else
status="PHP $semver Found"
fi
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
@ -45,14 +83,14 @@ ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
sudo chmod 777 "$ini_file"
add_log "$tick" "PHP" "$status"
if [ "$2" = "true" ]; then
if [ "$1" != "7.4" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1"-dev php"$1"-xml >/dev/null 2>&1
fi
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1"-dev php"$1"-xml >/dev/null 2>&1
sudo update-alternatives --set php-config /usr/bin/php-config"$1" >/dev/null 2>&1
sudo update-alternatives --set phpize /usr/bin/phpize"$1" >/dev/null 2>&1
wget https://github.com/pear/pearweb_phars/raw/master/install-pear-nozlib.phar >/dev/null 2>&1
sudo php install-pear-nozlib.phar >/dev/null 2>&1
sudo pear config-set php_ini "$ini_file" >/dev/null 2>&1
sudo pear config-set auto_discover 1
sudo pear channel-update pear.php.net
add_log "$tick" "PECL" "Installed"
fi
@ -74,14 +112,15 @@ 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"
) || add_log "$cross" "$extension" "Could not install $extension on php$version"
) || add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
fi
}

View File

@ -1,8 +1,10 @@
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ini_dir=$(php --ini | grep in: | sed -e "s|.*:s*||" | sed "s/ //g")
if [ ! "$(apt-cache search php"$2"-psr)" ]; then
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1
fi
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev php"$2"-psr
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-psr
for tool in php-config phpize; do
if [ -e "/usr/bin/$tool$2" ]; then
sudo update-alternatives --set $tool /usr/bin/"$tool$2"
@ -17,10 +19,6 @@ if [ ! "$(apt-cache search php"$2"-psr)" ]; then
echo "extension=psr.so" >> "$ini_file"
fi
if [ "$1" = "master" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-phalcon
else
cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1"
cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2"
echo "extension=phalcon.so" >> "$ini_file"
fi
cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1"
cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2"
echo "extension=phalcon.so" | sudo tee "$ini_dir/50-phalcon.ini"

View File

@ -1,11 +1,14 @@
param (
[Parameter(Mandatory = $true)][string]$version = "7.3",
[Parameter(Mandatory = $true)][string]$dir
[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
@ -30,39 +33,35 @@ 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'
}
if ($version -eq '7.4') {
$version = '7.4RC'
if ($version -eq $master_version) {
$version = 'master'
}
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)"
}
else {
$status = "Switched to PHP $($installed.FullVersion)"
$status = "PHP $($installed.FullVersion) Found"
}
Set-PhpIniKey -Key 'date.timezone' -Value 'UTC' -Path $php_dir
Enable-PhpExtension -Extension openssl, curl -Path $php_dir
try {
Update-PhpCAInfo -Path $php_dir -Source CurrentUser
}
catch {
try {
Update-PhpCAInfo -Path $php_dir -Source Curl
} catch {
Update-PhpCAInfo -Path $php_dir -Source Curl -SkipChecksumCheck
}
}
if ([Version]$installed.Version -ge '7.4') {
Copy-Item "$dir\..\src\ext\php_pcov.dll" -Destination "$($installed.ExtensionsPath)\php_pcov.dll"
}
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 (
@ -99,6 +98,6 @@ Function Add-Extension {
}
}
catch {
Add-Log $cross $extension "Could not enable"
Add-Log $cross $extension "Could not install $extension on PHP $($installed.FullVersion)"
}
}

View File

@ -22,24 +22,6 @@ export async function getInput(
}
}
/**
* Function to read the PHP version.
*/
export async function getVersion(): Promise<string> {
const version: string = await getInput('php-version', true);
switch (version) {
case '8.0':
case '8.0-dev':
case '7.4':
case '7.4snapshot':
case '7.4nightly':
case 'nightly':
return '7.4';
default:
return version;
}
}
/**
* Async foreach loop
*
@ -173,32 +155,10 @@ export async function readScript(
version: string,
os_version: string
): Promise<string> {
switch (os_version) {
case 'darwin':
switch (version) {
case '7.4':
return fs.readFileSync(
path.join(__dirname, '../src/scripts/7.4.sh'),
'utf8'
);
}
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
case 'linux':
case 'win32':
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
default:
return await log(
'Platform ' + os_version + ' is not supported',
os_version,
'error'
);
}
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
}
/**