mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
commit
3c0527bec1
2
.github/workflows/workflow.yml
vendored
2
.github/workflows/workflow.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-latest, macos-latest]
|
operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-latest, macos-latest]
|
||||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
|
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
|
||||||
env:
|
env:
|
||||||
extensions: xml, opcache, xdebug, pcov
|
extensions: xml, opcache, xdebug, pcov
|
||||||
key: cache-v3
|
key: cache-v3
|
||||||
|
121
README.md
121
README.md
@ -34,6 +34,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
|||||||
- [Disable Coverage](#disable-coverage)
|
- [Disable Coverage](#disable-coverage)
|
||||||
- [Usage](#memo-usage)
|
- [Usage](#memo-usage)
|
||||||
- [Inputs](#inputs)
|
- [Inputs](#inputs)
|
||||||
|
- [Flags](#flags)
|
||||||
- [Basic Setup](#basic-setup)
|
- [Basic Setup](#basic-setup)
|
||||||
- [Matrix Setup](#matrix-setup)
|
- [Matrix Setup](#matrix-setup)
|
||||||
- [Nightly Build Setup](#nightly-build-setup)
|
- [Nightly Build Setup](#nightly-build-setup)
|
||||||
@ -69,12 +70,14 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
|||||||
|`7.3`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|
|`7.3`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|
||||||
|`7.4`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|
|`7.4`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|
||||||
|`8.0`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`|
|
|`8.0`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|`8.1`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|
||||||
|
**Note:** Specifying `8.0` and `8.1` in `php-version` input installs a nightly build of `PHP 8.0.0-dev` and `PHP 8.1.0-dev` respectively. See [nightly build setup](#nightly-build-setup) for more information.
|
||||||
|
|
||||||
**Note:** Specifying `8.0` in `php-version` input installs a nightly build of `PHP 8.0.0-dev` with `PHP JIT`, `Union Types v2` and other [new features](https://wiki.php.net/rfc#php_80 "New features implemented in PHP 8"). See [nightly build setup](#nightly-build-setup) for more information.
|
|
||||||
|
|
||||||
## :cloud: OS/Platform Support
|
## :cloud: OS/Platform Support
|
||||||
|
|
||||||
Both `GitHub-hosted` runners and `self-hosted` runners are supported on the following operating systems.
|
The action supports both `GitHub-hosted` runners and `self-hosted` runners on the following operating systems.
|
||||||
|
|
||||||
### GitHub-Hosted Runners
|
### GitHub-Hosted Runners
|
||||||
|
|
||||||
@ -85,6 +88,7 @@ Both `GitHub-hosted` runners and `self-hosted` runners are supported on the foll
|
|||||||
|Ubuntu 20.04|`ubuntu-20.04`|`PHP 7.4`|
|
|Ubuntu 20.04|`ubuntu-20.04`|`PHP 7.4`|
|
||||||
|Windows Server 2019|`windows-latest` or `windows-2019`|`PHP 7.4`|
|
|Windows Server 2019|`windows-latest` or `windows-2019`|`PHP 7.4`|
|
||||||
|macOS Catalina 10.15|`macos-latest` or `macos-10.15`|`PHP 7.4`|
|
|macOS Catalina 10.15|`macos-latest` or `macos-10.15`|`PHP 7.4`|
|
||||||
|
|macOS Big Sur 11.0|`macos-11.0`|`PHP 7.4`|
|
||||||
|
|
||||||
### Self-Hosted Runners
|
### Self-Hosted Runners
|
||||||
|
|
||||||
@ -96,6 +100,7 @@ Both `GitHub-hosted` runners and `self-hosted` runners are supported on the foll
|
|||||||
|Windows 7 and newer|`self-hosted` or `Windows`|
|
|Windows 7 and newer|`self-hosted` or `Windows`|
|
||||||
|Windows Server 2012 R2 and newer|`self-hosted` or `Windows`|
|
|Windows Server 2012 R2 and newer|`self-hosted` or `Windows`|
|
||||||
|macOS Catalina 10.15|`self-hosted` or `macOS`|
|
|macOS Catalina 10.15|`self-hosted` or `macOS`|
|
||||||
|
|macOS Big Sur 11.0|`self-hosted` or `macOS`|
|
||||||
|
|
||||||
- Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
|
- Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
|
||||||
|
|
||||||
@ -160,10 +165,20 @@ Both `GitHub-hosted` runners and `self-hosted` runners are supported on the foll
|
|||||||
extensions: intl-67.1
|
extensions: intl-67.1
|
||||||
```
|
```
|
||||||
|
|
||||||
- Extensions which cannot be added or removed gracefully leave an error message in the logs, the action is not interrupted.
|
|
||||||
|
|
||||||
- These extensions have custom support - `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`, and `blackfire`, `ioncube`, `oci8`, `pdo_oci`, `phalcon3` and `phalcon4` on all supported OS.
|
- These extensions have custom support - `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`, and `blackfire`, `ioncube`, `oci8`, `pdo_oci`, `phalcon3` and `phalcon4` on all supported OS.
|
||||||
|
|
||||||
|
- By default, extensions which cannot be added or removed gracefully leave an error message in the logs, the action is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with fail-fast
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
extensions: oci8
|
||||||
|
env:
|
||||||
|
fail-fast: true
|
||||||
|
```
|
||||||
|
|
||||||
## :wrench: Tools Support
|
## :wrench: Tools Support
|
||||||
|
|
||||||
These tools can be setup globally using the `tools` input.
|
These tools can be setup globally using the `tools` input.
|
||||||
@ -178,8 +193,7 @@ These tools can be setup globally using the `tools` input.
|
|||||||
tools: php-cs-fixer, phpunit
|
tools: php-cs-fixer, phpunit
|
||||||
```
|
```
|
||||||
|
|
||||||
To setup a particular version of a tool, specify it in the form `tool:version`.
|
- To set up a particular version of a tool, specify it in the form `tool:version`. The latest stable version of `composer` is set up by default. You can set up the required version by specifying `v1`, `v2`, `snapshot` or `preview` as version.
|
||||||
Latest stable version of `composer` is setup by default. You can setup the required version by specifying `v1`, `v2`, `snapshot` or `preview` as version.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP with composer v2
|
- name: Setup PHP with composer v2
|
||||||
@ -189,11 +203,9 @@ Latest stable version of `composer` is setup by default. You can setup the requi
|
|||||||
tools: composer:v2
|
tools: composer:v2
|
||||||
```
|
```
|
||||||
|
|
||||||
Latest versions of both agent `blackfire-agent` and client `blackfire` are setup when `blackfire` is specified in tools input. Please refer to the [official documentation](https://blackfire.io/docs/integrations/ci/github-actions "Blackfire.io documentation for GitHub Actions") for using `blackfire` with GitHub Actions.
|
- The latest versions of both agent `blackfire-agent` and client `blackfire` are setup when `blackfire` is specified in tools input. Please refer to the [official documentation](https://blackfire.io/docs/integrations/ci/github-actions "Blackfire.io documentation for GitHub Actions") for using `blackfire` with GitHub Actions.
|
||||||
|
|
||||||
Version for other tools should be in `semver` format and a valid release of the tool.
|
- Version for other tools should be in `semver` format and a valid release of the tool. This is useful for installing tools for older versions of PHP. For example to set up `PHPUnit` on `PHP 7.2`.
|
||||||
This is useful for installing tools for older versions of PHP.
|
|
||||||
For example to setup `PHPUnit` on `PHP 7.2`.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP with tools
|
- name: Setup PHP with tools
|
||||||
@ -203,10 +215,22 @@ For example to setup `PHPUnit` on `PHP 7.2`.
|
|||||||
tools: phpunit:8.5.8
|
tools: phpunit:8.5.8
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- By default, tools which cannot be set up gracefully leave an error message in the logs, the action is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with fail-fast
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
tools: deployer
|
||||||
|
env:
|
||||||
|
fail-fast: true
|
||||||
|
```
|
||||||
|
|
||||||
**Notes**
|
**Notes**
|
||||||
- This is useful to set up tools which you only use in GitHub Actions, thus keeping your `composer.json` tidy.
|
- Input `tools` is useful to set up tools which you only use in GitHub Actions, thus keeping your `composer.json` tidy.
|
||||||
- If you have a tool in your `composer.json`, do not setup it globally using this action as the two instances of the tool might conflict.
|
- If you do not want to use all your dev-dependencies in GitHub Actions workflow, you can run composer with `--no-dev` and install required tools using `tools` input to speed up your workflow.
|
||||||
- Tools which cannot be setup gracefully leave an error message in the logs, the action is not interrupted.
|
- If you have a tool in your `composer.json`, do not setup it with `tools` input as the two instances of the tool might conflict.
|
||||||
|
|
||||||
## :signal_strength: Coverage Support
|
## :signal_strength: Coverage Support
|
||||||
|
|
||||||
@ -272,6 +296,8 @@ Consider disabling the coverage using this PHP action for these reasons.
|
|||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
|
> Specify using `with` keyword
|
||||||
|
|
||||||
#### `php-version` (required)
|
#### `php-version` (required)
|
||||||
|
|
||||||
- Specify the PHP version you want to set up.
|
- Specify the PHP version you want to set up.
|
||||||
@ -300,9 +326,34 @@ Consider disabling the coverage using this PHP action for these reasons.
|
|||||||
#### `tools` (optional)
|
#### `tools` (optional)
|
||||||
|
|
||||||
- Specify the tools you want to set up.
|
- Specify the tools you want to set up.
|
||||||
- Accepts a `string` in csv-format. For example `phpunit, phpcs`
|
- Accepts a `string` in csv-format. For example: `phpunit, phpcs`
|
||||||
- See [tools Support](#wrench-tools-support) for tools supported.
|
- See [tools Support](#wrench-tools-support) for tools supported.
|
||||||
|
|
||||||
|
### Flags
|
||||||
|
|
||||||
|
> Specify using `env` keyword
|
||||||
|
|
||||||
|
#### `fail-fast` (optional)
|
||||||
|
|
||||||
|
- Specify to mark the workflow as failed if an extension or tool fails to set up.
|
||||||
|
- This changes the default mode from graceful warnings to fail-fast.
|
||||||
|
- By default, it is set to `false`.
|
||||||
|
- Accepts `true` and `false`.
|
||||||
|
|
||||||
|
#### `phpts` (optional)
|
||||||
|
|
||||||
|
- Specify to set up thread-safe version of PHP on windows.
|
||||||
|
- Accepts `ts` and `nts`.
|
||||||
|
- By default, it is set to `nts`.
|
||||||
|
- See [thread safe setup](#thread-safe-setup) for more info.
|
||||||
|
|
||||||
|
#### `update` (optional)
|
||||||
|
|
||||||
|
- Specify to update PHP on the runner to the latest patch version.
|
||||||
|
- Accepts `true` and `false`.
|
||||||
|
- By default, it is set to `false`.
|
||||||
|
- See [force update](#force-update) for more info.
|
||||||
|
|
||||||
See below for more info.
|
See below for more info.
|
||||||
|
|
||||||
### Basic Setup
|
### Basic Setup
|
||||||
@ -353,13 +404,13 @@ jobs:
|
|||||||
|
|
||||||
### Nightly Build Setup
|
### Nightly Build Setup
|
||||||
|
|
||||||
> Setup a nightly build of `PHP 8.0.0-dev` from the [master branch](https://github.com/php/php-src/tree/master "Master branch on PHP source repository") of PHP.
|
> Setup a nightly build of `PHP 8.0` or `PHP 8.1`.
|
||||||
|
|
||||||
- This version is currently in development.
|
- These versions are currently in development.
|
||||||
- `PECL` is installed by default with this version on `ubuntu` and `macOS`.
|
- `PECL` is installed by default with these versions on `ubuntu` and `macOS`.
|
||||||
- Some user space extensions might not support this version currently.
|
- Some user space extensions might not support these versions currently.
|
||||||
- Refer to this [RFC](https://wiki.php.net/rfc/jit "PHP JIT RFC configuration") for configuring `PHP JIT` on this version.
|
- Refer to this [RFC](https://wiki.php.net/rfc/jit "PHP JIT RFC configuration") for configuring `PHP JIT` on these versions.
|
||||||
- Refer to this [list of RFCs](https://wiki.php.net/rfc#php_80 "List of RFCs implemented in PHP8") implemented in this version.
|
- Refer to this [list of RFCs](https://wiki.php.net/rfc#php_80 "List of RFCs implemented in PHP8") for features implemented in `PHP 8.0`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
@ -369,7 +420,7 @@ steps:
|
|||||||
- name: Setup nightly PHP
|
- name: Setup nightly PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.0'
|
php-version: '8.1'
|
||||||
extensions: mbstring
|
extensions: mbstring
|
||||||
ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1
|
ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1
|
||||||
coverage: pcov
|
coverage: pcov
|
||||||
@ -407,7 +458,7 @@ jobs:
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Notes**
|
**Notes**
|
||||||
- Do not setup multiple self-hosted runners on the a single server instance as parallel workflow will conflict with each other.
|
- Do not setup multiple self-hosted runners on a single server instance as parallel workflow will conflict with each other.
|
||||||
- Do not setup self-hosted runners on the side on your development environment or your production server.
|
- Do not setup self-hosted runners on the side on your development environment or your production server.
|
||||||
|
|
||||||
### Local Testing Setup
|
### Local Testing Setup
|
||||||
@ -447,7 +498,7 @@ act -P ubuntu-16.04=shivammathur/node:xenial
|
|||||||
|
|
||||||
### Thread Safe Setup
|
### Thread Safe Setup
|
||||||
|
|
||||||
> Setup both `TS` and `NTS` PHP on `Windows`.
|
> Setup `TS` or `NTS` PHP on `Windows`.
|
||||||
|
|
||||||
- `NTS` versions are setup by default.
|
- `NTS` versions are setup by default.
|
||||||
- On `Ubuntu` and `macOS` only `NTS` versions are supported.
|
- On `Ubuntu` and `macOS` only `NTS` versions are supported.
|
||||||
@ -472,7 +523,7 @@ jobs:
|
|||||||
|
|
||||||
### Force Update
|
### Force Update
|
||||||
|
|
||||||
> Update to latest patch of PHP versions.
|
> Update to the latest patch of PHP versions.
|
||||||
|
|
||||||
- Pre-installed PHP versions on the GitHub Actions runner are not updated to their latest patch release by default.
|
- Pre-installed PHP versions on the GitHub Actions runner are not updated to their latest patch release by default.
|
||||||
- You can specify the `update` environment variable to `true` to force update to the latest release.
|
- You can specify the `update` environment variable to `true` to force update to the latest release.
|
||||||
@ -506,7 +557,7 @@ Refer to [`shivammathur/cache-extensions`](https://github.com/shivammathur/cache
|
|||||||
|
|
||||||
### Cache Composer Dependencies
|
### Cache Composer Dependencies
|
||||||
|
|
||||||
If your project uses composer, you can persist composer's internal cache directory. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time.
|
If your project uses composer, you can persist the composer's internal cache directory. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
@ -525,7 +576,7 @@ If your project uses composer, you can persist composer's internal cache directo
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Notes**
|
**Notes**
|
||||||
- Please do not cache `vendor` directory using `action/cache` as that will have side-effects.
|
- Please do not cache `vendor` directory using `action/cache` as that will have side effects.
|
||||||
- In the above example, if you support a range of `composer` dependencies and do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
|
- In the above example, if you support a range of `composer` dependencies and do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@ -534,7 +585,7 @@ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
|||||||
|
|
||||||
### Cache Node.js Dependencies
|
### Cache Node.js Dependencies
|
||||||
|
|
||||||
If your project has node.js dependencies, you can persist npm's or yarn's cache directory. The cached files are available across check-runs and will reduce the workflow execution time.
|
If your project has node.js dependencies, you can persist NPM or yarn cache directory. The cached files are available across check-runs and will reduce the workflow execution time.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Get node.js cache directory
|
- name: Get node.js cache directory
|
||||||
@ -549,7 +600,7 @@ If your project has node.js dependencies, you can persist npm's or yarn's cache
|
|||||||
restore-keys: ${{ runner.os }}-node-
|
restore-keys: ${{ runner.os }}-node-
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** Please do not cache `node_modules` directory as that will have side-effects.
|
**Note:** Please do not cache `node_modules` directory as that will have side effects.
|
||||||
|
|
||||||
### Composer GitHub OAuth
|
### Composer GitHub OAuth
|
||||||
|
|
||||||
@ -566,7 +617,7 @@ If you have a number of workflows which setup multiple tools or have many compos
|
|||||||
|
|
||||||
### Problem Matchers
|
### Problem Matchers
|
||||||
|
|
||||||
Problem matchers are `json` configurations which identify errors and warnings in your logs and surface that information prominently in the GitHub Actions UI by highlighting them and creating code annotations.
|
Problem matchers are `json` configurations which identify errors and warnings in your logs and surface them prominently in the GitHub Actions UI by highlighting them and creating code annotations.
|
||||||
|
|
||||||
#### PHP
|
#### PHP
|
||||||
|
|
||||||
@ -588,7 +639,7 @@ Setup problem matchers for your `PHPUnit` output by adding this step after the `
|
|||||||
|
|
||||||
#### PHPStan
|
#### PHPStan
|
||||||
|
|
||||||
PHPStan supports error reporting in GitHub Actions, so no problem matchers are required.
|
PHPStan supports error reporting in GitHub Actions, so it does not require problem matchers.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
@ -666,15 +717,15 @@ Examples of using `setup-php` with various PHP Frameworks and Packages.
|
|||||||
|
|
||||||
## :bookmark: Versioning
|
## :bookmark: Versioning
|
||||||
|
|
||||||
- It is highly recommended to use the `v2` tag as `setup-php` version. It is a rolling tag and is synced with latest minor and patch releases. With `v2` you automatically get the bug fixes, new features and support for latest PHP releases. For debugging any issues `verbose` tag can be used temporarily. It outputs all the logs and is also synced with the latest releases.
|
- Use the `v2` tag as `setup-php` version. It is a rolling tag and is synced with the latest minor and patch releases. With `v2` you automatically get the bug fixes, new features and support for latest PHP releases. For debugging any issues `verbose` tag can be used temporarily. It outputs all the logs and is also synced with the latest releases.
|
||||||
- Semantic release versions can also be used. It is recommended to [use dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot "Setup Dependabot with GitHub Actions") with semantic versioning to keep the actions in your workflows up to date.
|
- Semantic release versions can also be used. It is recommended to [use dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot "Setup Dependabot with GitHub Actions") with semantic versioning to keep the actions in your workflows up to date.
|
||||||
- Commit SHA can also be used, but are not recommended. They have to be updated with every release manually, without which you will not get any bug fixes or new features.
|
- Commit SHA can also be used, but are not recommended. They have to be updated with every release manually, without which you will not get any bug fixes or new features.
|
||||||
- Using the `master` branch as version is highly discouraged, it might break your workflow after major releases as they have breaking changes.
|
- It is highly discouraged to use the `master` branch as version, it might break your workflow after major releases as they have breaking changes.
|
||||||
- If you are using the `v1` tag or a `1.x.y` version, it is recommended that you [switch to v2](https://github.com/shivammathur/setup-php/wiki/Switch-to-v2 "Guide for switching from setup-php v1 to v2") as `v1` only gets critical bug fixes. Maintenance support for `v1` will be dropped with the last `PHP 8.0` release.
|
- If you are using the `v1` tag or a `1.x.y` version, you should [switch to v2](https://github.com/shivammathur/setup-php/wiki/Switch-to-v2 "Guide for switching from setup-php v1 to v2") as `v1` only gets critical bug fixes. Maintenance support for `v1` will be dropped with the last `PHP 8.0` release.
|
||||||
|
|
||||||
## :scroll: License
|
## :scroll: License
|
||||||
|
|
||||||
- The scripts and documentation in this project are released under the [MIT License](LICENSE "License for shivammathur/setup-php").
|
- The scripts and documentation in this project are under the [MIT License](LICENSE "License for shivammathur/setup-php").
|
||||||
- This project has multiple [dependencies](#package-dependencies "Dependencies for this PHP Action"). Their licenses can be found in their respective repositories.
|
- This project has multiple [dependencies](#package-dependencies "Dependencies for this PHP Action"). Their licenses can be found in their respective repositories.
|
||||||
- The logo for `setup-php` is a derivative work of [php.net logo](https://www.php.net/download-logos.php) and is licensed under the [CC BY-SA 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/ "Creative Commons License").
|
- The logo for `setup-php` is a derivative work of [php.net logo](https://www.php.net/download-logos.php) and is licensed under the [CC BY-SA 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/ "Creative Commons License").
|
||||||
|
|
||||||
@ -689,7 +740,7 @@ Examples of using `setup-php` with various PHP Frameworks and Packages.
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/shivammathur/setup-php/graphs/contributors">
|
<a href="https://github.com/shivammathur/setup-php/graphs/contributors">
|
||||||
<img src="https://opencollective.com/setup-php/contributors.svg?width=1024&button=false" alt="setup-php contributers" width="100%">
|
<img src="https://opencollective.com/setup-php/contributors.svg?width=1024&button=false" alt="setup-php contributors" width="100%">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -53,6 +53,18 @@ describe('Config tests', () => {
|
|||||||
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with Xdebug3 on linux', async () => {
|
||||||
|
const linux: string = await coverage.addCoverage('xdebug3', '8.1', 'linux');
|
||||||
|
expect(linux).toContain('add_extension xdebug');
|
||||||
|
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with Xdebug on linux', async () => {
|
||||||
|
const linux: string = await coverage.addCoverage('xdebug', '8.1', 'linux');
|
||||||
|
expect(linux).toContain('add_extension xdebug');
|
||||||
|
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
||||||
|
});
|
||||||
|
|
||||||
it('checking addCoverage with Xdebug on darwin', async () => {
|
it('checking addCoverage with Xdebug on darwin', async () => {
|
||||||
const darwin: string = await coverage.addCoverage(
|
const darwin: string = await coverage.addCoverage(
|
||||||
'xdebug',
|
'xdebug',
|
||||||
|
@ -70,7 +70,7 @@ describe('Extension tests', () => {
|
|||||||
'sudo $debconf_fix apt-get install -y php7.4-sqlite3'
|
'sudo $debconf_fix apt-get install -y php7.4-sqlite3'
|
||||||
);
|
);
|
||||||
expect(linux).toContain('remove_extension intl');
|
expect(linux).toContain('remove_extension intl');
|
||||||
expect(linux).toContain('sudo $debconf_fix apt-get install -y php-ast');
|
expect(linux).toContain('sudo $debconf_fix apt-get install -y php7.4-ast');
|
||||||
expect(linux).toContain('sudo $debconf_fix apt-get install -y php-uopz');
|
expect(linux).toContain('sudo $debconf_fix apt-get install -y php-uopz');
|
||||||
expect(linux).toContain('add_unstable_extension ast beta extension');
|
expect(linux).toContain('add_unstable_extension ast beta extension');
|
||||||
expect(linux).toContain('add_pdo_extension mysql');
|
expect(linux).toContain('add_pdo_extension mysql');
|
||||||
@ -129,13 +129,15 @@ describe('Extension tests', () => {
|
|||||||
|
|
||||||
it('checking addExtensionOnDarwin', async () => {
|
it('checking addExtensionOnDarwin', async () => {
|
||||||
let darwin: string = await extensions.addExtension(
|
let darwin: string = await extensions.addExtension(
|
||||||
'Xdebug, pcov, grpc, protobuf, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
|
'Xdebug, pcov, grpc, igbinary, imagick, protobuf, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
|
||||||
'7.2',
|
'7.2',
|
||||||
'darwin'
|
'darwin'
|
||||||
);
|
);
|
||||||
expect(darwin).toContain('add_brew_extension xdebug');
|
expect(darwin).toContain('add_brew_extension xdebug');
|
||||||
expect(darwin).toContain('add_brew_extension pcov');
|
expect(darwin).toContain('add_brew_extension pcov');
|
||||||
expect(darwin).toContain('add_brew_extension grpc');
|
expect(darwin).toContain('add_brew_extension grpc');
|
||||||
|
expect(darwin).toContain('add_brew_extension igbinary');
|
||||||
|
expect(darwin).toContain('add_brew_extension imagick');
|
||||||
expect(darwin).toContain('add_brew_extension protobuf');
|
expect(darwin).toContain('add_brew_extension protobuf');
|
||||||
expect(darwin).toContain('add_brew_extension swoole');
|
expect(darwin).toContain('add_brew_extension swoole');
|
||||||
expect(darwin).toContain('pecl_install sqlite3');
|
expect(darwin).toContain('pecl_install sqlite3');
|
||||||
@ -179,11 +181,7 @@ describe('Extension tests', () => {
|
|||||||
darwin = await extensions.addExtension('redis', '7.2', 'darwin');
|
darwin = await extensions.addExtension('redis', '7.2', 'darwin');
|
||||||
expect(darwin).toContain('pecl_install redis');
|
expect(darwin).toContain('pecl_install redis');
|
||||||
|
|
||||||
darwin = await extensions.addExtension('imagick', '5.6', 'darwin');
|
darwin = await extensions.addExtension('imagick', '5.5', 'darwin');
|
||||||
expect(darwin).toContain('brew install pkg-config imagemagick');
|
|
||||||
expect(darwin).toContain('pecl_install imagick');
|
|
||||||
|
|
||||||
darwin = await extensions.addExtension('imagick', '7.4', 'darwin');
|
|
||||||
expect(darwin).toContain('brew install pkg-config imagemagick');
|
expect(darwin).toContain('brew install pkg-config imagemagick');
|
||||||
expect(darwin).toContain('pecl_install imagick');
|
expect(darwin).toContain('pecl_install imagick');
|
||||||
|
|
||||||
|
@ -165,5 +165,11 @@ describe('Install', () => {
|
|||||||
script = '' + (await install.run());
|
script = '' + (await install.run());
|
||||||
expect(script).toContain('initial script');
|
expect(script).toContain('initial script');
|
||||||
expect(script).toContain('bash darwin.sh 8.0 ' + __dirname);
|
expect(script).toContain('bash darwin.sh 8.0 ' + __dirname);
|
||||||
|
|
||||||
|
setEnv(8.1, 'darwin', '', '', '', '');
|
||||||
|
|
||||||
|
script = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('bash darwin.sh 8.1 ' + __dirname);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -349,12 +349,12 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
script = await tools.addDevTools('phpize', 'win32');
|
script = await tools.addDevTools('phpize', 'win32');
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'Add-Log "$cross" "phpize" "phpize is not a windows tool"'
|
'Add-Log "$tick" "phpize" "phpize is not a windows tool"'
|
||||||
);
|
);
|
||||||
|
|
||||||
script = await tools.addDevTools('php-config', 'win32');
|
script = await tools.addDevTools('php-config', 'win32');
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'Add-Log "$cross" "php-config" "php-config is not a windows tool"'
|
'Add-Log "$tick" "php-config" "php-config is not a windows tool"'
|
||||||
);
|
);
|
||||||
|
|
||||||
script = await tools.addDevTools('tool', 'openbsd');
|
script = await tools.addDevTools('tool', 'openbsd');
|
||||||
|
39
dist/index.js
vendored
39
dist/index.js
vendored
@ -2084,7 +2084,7 @@ async function addDevTools(tool, os_version) {
|
|||||||
case 'darwin':
|
case 'darwin':
|
||||||
return 'add_devtools ' + tool;
|
return 'add_devtools ' + tool;
|
||||||
case 'win32':
|
case 'win32':
|
||||||
return await utils.addLog('$cross', tool, tool + ' is not a windows tool', 'win32');
|
return await utils.addLog('$tick', tool, tool + ' is not a windows tool', 'win32');
|
||||||
default:
|
default:
|
||||||
return await utils.log('Platform ' + os_version + ' is not supported', os_version, 'error');
|
return await utils.log('Platform ' + os_version + ' is not supported', os_version, 'error');
|
||||||
}
|
}
|
||||||
@ -2314,7 +2314,7 @@ async function addCoverageXdebug(extension, version, os_version, pipe) {
|
|||||||
const log = await utils.addLog('$tick', extension, 'Xdebug enabled as coverage driver', os_version);
|
const log = await utils.addLog('$tick', extension, 'Xdebug enabled as coverage driver', os_version);
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^xdebug3$/.test(extension):
|
case /^xdebug3$/.test(extension):
|
||||||
case /^8\.0$/.test(version):
|
case /^8\.\d$/.test(version):
|
||||||
return '\n' + xdebug + '\n' + ini + '\n' + log;
|
return '\n' + xdebug + '\n' + ini + '\n' + log;
|
||||||
case /^xdebug$/.test(extension):
|
case /^xdebug$/.test(extension):
|
||||||
default:
|
default:
|
||||||
@ -2583,7 +2583,8 @@ async function run() {
|
|||||||
const tool = await utils.scriptTool(os_version);
|
const tool = await utils.scriptTool(os_version);
|
||||||
const script = os_version + (await utils.scriptExtension(os_version));
|
const script = os_version + (await utils.scriptExtension(os_version));
|
||||||
const location = await getScript(script, version, os_version);
|
const location = await getScript(script, version, os_version);
|
||||||
await exec_1.exec(await utils.joins(tool, location, version, __dirname));
|
const fail_fast = await utils.readEnv('fail-fast');
|
||||||
|
await exec_1.exec(await utils.joins(tool, location, version, __dirname, fail_fast));
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
@ -2862,7 +2863,7 @@ async function addExtensionDarwin(extension_csv, version, pipe) {
|
|||||||
remove_script += '\nremove_extension ' + ext_name.slice(1);
|
remove_script += '\nremove_extension ' + ext_name.slice(1);
|
||||||
return;
|
return;
|
||||||
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
||||||
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
|
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
|
||||||
// match pdo_oci and oci8
|
// match pdo_oci and oci8
|
||||||
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||||
@ -2884,11 +2885,11 @@ async function addExtensionDarwin(extension_csv, version, pipe) {
|
|||||||
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
|
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
|
||||||
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
|
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
|
||||||
return;
|
return;
|
||||||
// match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole
|
// match 5.6xdebug to 8.9xdebug, 5.6igbinary to 8.9igbinary
|
||||||
// match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf
|
// match 5.6grpc to 7.4grpc, 5.6imagick to 7.4imagick, 5.6protobuf to 7.4protobuf, 5.6swoole to 7.4swoole
|
||||||
// match 7.1pcov to 8.0pcov
|
// match 7.1pcov to 8.9pcov
|
||||||
case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension):
|
case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|igbinary)/.test(version_extension):
|
||||||
case /(5\.6|7\.[0-4])(grpc|protobuf|swoole)/.test(version_extension):
|
case /(5\.6|7\.[0-4])(grpc|imagick|protobuf|swoole)/.test(version_extension):
|
||||||
case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension):
|
case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension):
|
||||||
command = 'add_brew_extension ' + ext_name;
|
command = 'add_brew_extension ' + ext_name;
|
||||||
break;
|
break;
|
||||||
@ -2896,8 +2897,8 @@ async function addExtensionDarwin(extension_csv, version, pipe) {
|
|||||||
case /5\.6redis/.test(version_extension):
|
case /5\.6redis/.test(version_extension):
|
||||||
command = command_prefix + 'redis-2.2.8';
|
command = command_prefix + 'redis-2.2.8';
|
||||||
break;
|
break;
|
||||||
// match imagick
|
// match 5.4imagick and 5.5imagick
|
||||||
case /^imagick$/.test(extension):
|
case /^5\.[4-5]imagick$/.test(version_extension):
|
||||||
command = await utils.joins('brew install pkg-config imagemagick' + pipe, '&& ' + command_prefix + 'imagick' + pipe);
|
command = await utils.joins('brew install pkg-config imagemagick' + pipe, '&& ' + command_prefix + 'imagick' + pipe);
|
||||||
break;
|
break;
|
||||||
// match sqlite
|
// match sqlite
|
||||||
@ -2934,7 +2935,7 @@ async function addExtensionWindows(extension_csv, version) {
|
|||||||
remove_script += '\nRemove-Extension ' + ext_name.slice(1);
|
remove_script += '\nRemove-Extension ' + ext_name.slice(1);
|
||||||
break;
|
break;
|
||||||
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
||||||
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
|
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
|
||||||
// match pdo_oci and oci8
|
// match pdo_oci and oci8
|
||||||
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||||
@ -2968,9 +2969,9 @@ async function addExtensionWindows(extension_csv, version) {
|
|||||||
add_script +=
|
add_script +=
|
||||||
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
||||||
break;
|
break;
|
||||||
// match 7.0mysql..8.0mysql
|
// match 7.0mysql..8.9mysql
|
||||||
// match 7.0mysqli..8.0mysqli
|
// match 7.0mysqli..8.9mysqli
|
||||||
// match 7.0mysqlnd..8.0mysqlnd
|
// match 7.0mysqlnd..8.9mysqlnd
|
||||||
case /[7-8]\.\d(mysql|mysqli|mysqlnd)$/.test(version_extension):
|
case /[7-8]\.\d(mysql|mysqli|mysqlnd)$/.test(version_extension):
|
||||||
add_script += '\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
add_script += '\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
||||||
break;
|
break;
|
||||||
@ -3010,7 +3011,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
|
|||||||
remove_script += '\nremove_extension ' + ext_name.slice(1);
|
remove_script += '\nremove_extension ' + ext_name.slice(1);
|
||||||
return;
|
return;
|
||||||
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
||||||
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
|
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
|
||||||
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
||||||
// match pdo_oci and oci8
|
// match pdo_oci and oci8
|
||||||
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
||||||
@ -3042,7 +3043,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
|
|||||||
add_script +=
|
add_script +=
|
||||||
'\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension';
|
'\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension';
|
||||||
return;
|
return;
|
||||||
// match 8.0xdebug3
|
// match 8.0xdebug3...8.9xdebug3
|
||||||
case /^8\.[0-9]xdebug3$/.test(version_extension):
|
case /^8\.[0-9]xdebug3$/.test(version_extension):
|
||||||
extension = 'xdebug';
|
extension = 'xdebug';
|
||||||
command = command_prefix + version + '-' + extension + pipe;
|
command = command_prefix + version + '-' + extension + pipe;
|
||||||
@ -3052,8 +3053,8 @@ async function addExtensionLinux(extension_csv, version, pipe) {
|
|||||||
extension = extension.replace(/pdo[_-]|3/, '');
|
extension = extension.replace(/pdo[_-]|3/, '');
|
||||||
add_script += '\nadd_pdo_extension ' + extension;
|
add_script += '\nadd_pdo_extension ' + extension;
|
||||||
return;
|
return;
|
||||||
// match ast and uopz
|
// match uopz
|
||||||
case /^(ast|uopz)$/.test(extension):
|
case /^(uopz)$/.test(extension):
|
||||||
command = command_prefix + '-' + extension + pipe;
|
command = command_prefix + '-' + extension + pipe;
|
||||||
break;
|
break;
|
||||||
// match sqlite
|
// match sqlite
|
||||||
|
1290
package-lock.json
generated
1290
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-php",
|
"name": "setup-php",
|
||||||
"version": "2.6.0",
|
"version": "2.7.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Setup PHP for use with GitHub Actions",
|
"description": "Setup PHP for use with GitHub Actions",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -31,18 +31,18 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^26.0.14",
|
"@types/jest": "^26.0.14",
|
||||||
"@types/node": "^14.11.2",
|
"@types/node": "^14.11.10",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.3.0",
|
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||||
"@typescript-eslint/parser": "^4.3.0",
|
"@typescript-eslint/parser": "^4.4.1",
|
||||||
"@zeit/ncc": "^0.22.3",
|
"@zeit/ncc": "^0.22.3",
|
||||||
"eslint": "^7.10.0",
|
"eslint": "^7.11.0",
|
||||||
"eslint-config-prettier": "^6.12.0",
|
"eslint-config-prettier": "^6.13.0",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
"eslint-plugin-jest": "^24.0.2",
|
"eslint-plugin-jest": "^24.1.0",
|
||||||
"eslint-plugin-prettier": "^3.1.4",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"husky": "^4.3.0",
|
"husky": "^4.3.0",
|
||||||
"jest": "^26.4.2",
|
"jest": "^26.6.0",
|
||||||
"jest-circus": "^26.4.2",
|
"jest-circus": "^26.6.0",
|
||||||
"prettier": "^2.1.2",
|
"prettier": "^2.1.2",
|
||||||
"ts-jest": "^26.4.1",
|
"ts-jest": "^26.4.1",
|
||||||
"typescript": "^4.0.3"
|
"typescript": "^4.0.3"
|
||||||
|
@ -32,7 +32,7 @@ export async function addCoverageXdebug(
|
|||||||
);
|
);
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^xdebug3$/.test(extension):
|
case /^xdebug3$/.test(extension):
|
||||||
case /^8\.0$/.test(version):
|
case /^8\.\d$/.test(version):
|
||||||
return '\n' + xdebug + '\n' + ini + '\n' + log;
|
return '\n' + xdebug + '\n' + ini + '\n' + log;
|
||||||
case /^xdebug$/.test(extension):
|
case /^xdebug$/.test(extension):
|
||||||
default:
|
default:
|
||||||
|
@ -27,7 +27,7 @@ export async function addExtensionDarwin(
|
|||||||
remove_script += '\nremove_extension ' + ext_name.slice(1);
|
remove_script += '\nremove_extension ' + ext_name.slice(1);
|
||||||
return;
|
return;
|
||||||
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
||||||
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
|
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
|
||||||
// match pdo_oci and oci8
|
// match pdo_oci and oci8
|
||||||
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||||
@ -66,11 +66,13 @@ export async function addExtensionDarwin(
|
|||||||
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
|
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
|
||||||
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
|
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
|
||||||
return;
|
return;
|
||||||
// match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole
|
// match 5.6xdebug to 8.9xdebug, 5.6igbinary to 8.9igbinary
|
||||||
// match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf
|
// match 5.6grpc to 7.4grpc, 5.6imagick to 7.4imagick, 5.6protobuf to 7.4protobuf, 5.6swoole to 7.4swoole
|
||||||
// match 7.1pcov to 8.0pcov
|
// match 7.1pcov to 8.9pcov
|
||||||
case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension):
|
case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|igbinary)/.test(version_extension):
|
||||||
case /(5\.6|7\.[0-4])(grpc|protobuf|swoole)/.test(version_extension):
|
case /(5\.6|7\.[0-4])(grpc|imagick|protobuf|swoole)/.test(
|
||||||
|
version_extension
|
||||||
|
):
|
||||||
case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension):
|
case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension):
|
||||||
command = 'add_brew_extension ' + ext_name;
|
command = 'add_brew_extension ' + ext_name;
|
||||||
break;
|
break;
|
||||||
@ -78,8 +80,8 @@ export async function addExtensionDarwin(
|
|||||||
case /5\.6redis/.test(version_extension):
|
case /5\.6redis/.test(version_extension):
|
||||||
command = command_prefix + 'redis-2.2.8';
|
command = command_prefix + 'redis-2.2.8';
|
||||||
break;
|
break;
|
||||||
// match imagick
|
// match 5.4imagick and 5.5imagick
|
||||||
case /^imagick$/.test(extension):
|
case /^5\.[4-5]imagick$/.test(version_extension):
|
||||||
command = await utils.joins(
|
command = await utils.joins(
|
||||||
'brew install pkg-config imagemagick' + pipe,
|
'brew install pkg-config imagemagick' + pipe,
|
||||||
'&& ' + command_prefix + 'imagick' + pipe
|
'&& ' + command_prefix + 'imagick' + pipe
|
||||||
@ -127,7 +129,7 @@ export async function addExtensionWindows(
|
|||||||
remove_script += '\nRemove-Extension ' + ext_name.slice(1);
|
remove_script += '\nRemove-Extension ' + ext_name.slice(1);
|
||||||
break;
|
break;
|
||||||
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
||||||
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
|
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
|
||||||
// match pdo_oci and oci8
|
// match pdo_oci and oci8
|
||||||
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||||
@ -186,9 +188,9 @@ export async function addExtensionWindows(
|
|||||||
add_script +=
|
add_script +=
|
||||||
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
||||||
break;
|
break;
|
||||||
// match 7.0mysql..8.0mysql
|
// match 7.0mysql..8.9mysql
|
||||||
// match 7.0mysqli..8.0mysqli
|
// match 7.0mysqli..8.9mysqli
|
||||||
// match 7.0mysqlnd..8.0mysqlnd
|
// match 7.0mysqlnd..8.9mysqlnd
|
||||||
case /[7-8]\.\d(mysql|mysqli|mysqlnd)$/.test(version_extension):
|
case /[7-8]\.\d(mysql|mysqli|mysqlnd)$/.test(version_extension):
|
||||||
add_script += '\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
add_script += '\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
||||||
break;
|
break;
|
||||||
@ -232,7 +234,7 @@ export async function addExtensionLinux(
|
|||||||
remove_script += '\nremove_extension ' + ext_name.slice(1);
|
remove_script += '\nremove_extension ' + ext_name.slice(1);
|
||||||
return;
|
return;
|
||||||
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
|
||||||
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
|
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
|
||||||
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
||||||
// match pdo_oci and oci8
|
// match pdo_oci and oci8
|
||||||
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
|
||||||
@ -285,7 +287,7 @@ export async function addExtensionLinux(
|
|||||||
add_script +=
|
add_script +=
|
||||||
'\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension';
|
'\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension';
|
||||||
return;
|
return;
|
||||||
// match 8.0xdebug3
|
// match 8.0xdebug3...8.9xdebug3
|
||||||
case /^8\.[0-9]xdebug3$/.test(version_extension):
|
case /^8\.[0-9]xdebug3$/.test(version_extension):
|
||||||
extension = 'xdebug';
|
extension = 'xdebug';
|
||||||
command = command_prefix + version + '-' + extension + pipe;
|
command = command_prefix + version + '-' + extension + pipe;
|
||||||
@ -295,8 +297,8 @@ export async function addExtensionLinux(
|
|||||||
extension = extension.replace(/pdo[_-]|3/, '');
|
extension = extension.replace(/pdo[_-]|3/, '');
|
||||||
add_script += '\nadd_pdo_extension ' + extension;
|
add_script += '\nadd_pdo_extension ' + extension;
|
||||||
return;
|
return;
|
||||||
// match ast and uopz
|
// match uopz
|
||||||
case /^(ast|uopz)$/.test(extension):
|
case /^(uopz)$/.test(extension):
|
||||||
command = command_prefix + '-' + extension + pipe;
|
command = command_prefix + '-' + extension + pipe;
|
||||||
break;
|
break;
|
||||||
// match sqlite
|
// match sqlite
|
||||||
|
@ -60,7 +60,10 @@ export async function run(): Promise<void> {
|
|||||||
const tool = await utils.scriptTool(os_version);
|
const tool = await utils.scriptTool(os_version);
|
||||||
const script = os_version + (await utils.scriptExtension(os_version));
|
const script = os_version + (await utils.scriptExtension(os_version));
|
||||||
const location = await getScript(script, version, os_version);
|
const location = await getScript(script, version, os_version);
|
||||||
await exec(await utils.joins(tool, location, version, __dirname));
|
const fail_fast = await utils.readEnv('fail-fast');
|
||||||
|
await exec(
|
||||||
|
await utils.joins(tool, location, version, __dirname, fail_fast)
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ add_log() {
|
|||||||
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
|
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
|
||||||
else
|
else
|
||||||
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
|
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
|
||||||
|
[ "$fail_fast" = "true" ] && exit 1;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +68,7 @@ check_extension() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fuction to get the PECL version.
|
# Function to get the PECL version.
|
||||||
get_pecl_version() {
|
get_pecl_version() {
|
||||||
extension=$1
|
extension=$1
|
||||||
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot)")"
|
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot)")"
|
||||||
@ -224,7 +225,7 @@ add_composertool() {
|
|||||||
prefix=$3
|
prefix=$3
|
||||||
(
|
(
|
||||||
composer global require "$prefix$release" >/dev/null 2>&1 &&
|
composer global require "$prefix$release" >/dev/null 2>&1 &&
|
||||||
json=$(grep "$prefix$tool" /Users/$USER/.composer/composer.json) &&
|
json=$(grep "$prefix$tool" /Users/"$USER"/.composer/composer.json) &&
|
||||||
tool_version=$(get_tool_version 'echo' "$json") &&
|
tool_version=$(get_tool_version 'echo' "$json") &&
|
||||||
add_log "$tick" "$tool" "Added $tool $tool_version"
|
add_log "$tick" "$tool" "Added $tool $tool_version"
|
||||||
) || add_log "$cross" "$tool" "Could not setup $tool"
|
) || add_log "$cross" "$tool" "Could not setup $tool"
|
||||||
@ -268,6 +269,7 @@ tick="✓"
|
|||||||
cross="✗"
|
cross="✗"
|
||||||
version=$1
|
version=$1
|
||||||
dist=$2
|
dist=$2
|
||||||
|
fail_fast=$3
|
||||||
nodot_version=${1/./}
|
nodot_version=${1/./}
|
||||||
old_versions="5.[3-5]"
|
old_versions="5.[3-5]"
|
||||||
tool_path_dir="/usr/local/bin"
|
tool_path_dir="/usr/local/bin"
|
||||||
@ -306,5 +308,5 @@ scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
|||||||
sudo mkdir -p "$ext_dir"
|
sudo mkdir -p "$ext_dir"
|
||||||
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
|
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
|
||||||
if [[ ! "$version" =~ $old_versions ]]; then configure_pecl >/dev/null 2>&1; fi
|
if [[ ! "$version" =~ $old_versions ]]; then configure_pecl >/dev/null 2>&1; fi
|
||||||
sudo mv "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
|
sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
|
||||||
add_log "$tick" "PHP" "$status PHP $semver"
|
add_log "$tick" "PHP" "$status PHP $semver"
|
||||||
|
@ -9,10 +9,11 @@ add_license_log() {
|
|||||||
|
|
||||||
# Function to get the tag for a php version.
|
# Function to get the tag for a php version.
|
||||||
get_tag() {
|
get_tag() {
|
||||||
master_version='8.0'
|
|
||||||
tag='master'
|
tag='master'
|
||||||
if [ ! "${version:?}" = "$master_version" ]; then
|
if ! [[ ${version:?} =~ $nightly_versions ]]; then
|
||||||
tag="php-$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')"
|
tag="php-$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')"
|
||||||
|
elif [ "${version:?}" = '8.0' ]; then
|
||||||
|
tag="PHP-8.0"
|
||||||
fi
|
fi
|
||||||
echo "$tag"
|
echo "$tag"
|
||||||
}
|
}
|
||||||
@ -72,18 +73,23 @@ restore_phpize() {
|
|||||||
|
|
||||||
# Function to patch pdo_oci.
|
# Function to patch pdo_oci.
|
||||||
patch_pdo_oci_config() {
|
patch_pdo_oci_config() {
|
||||||
curl -O "${curl_opts[@]}" https://raw.githubusercontent.com/php/php-src/master/ext/pdo_oci/config.m4
|
curl -O "${curl_opts[@]}" https://raw.githubusercontent.com/php/php-src/PHP-8.0/ext/pdo_oci/config.m4
|
||||||
sudo sed -i '' "/PHP_CHECK_PDO_INCLUDES/d" config.m4 || sudo sed -i "/PHP_CHECK_PDO_INCLUDES/d" config.m4
|
if [[ ${version:?} =~ 5.[3-6] ]]; then
|
||||||
|
sudo sed -i '' "/PHP_CHECK_PDO_INCLUDES/d" config.m4 2>/dev/null || sudo sed -i "/PHP_CHECK_PDO_INCLUDES/d" config.m4
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to install the dependencies.
|
# Function to install the dependencies.
|
||||||
add_dependencies() {
|
add_dependencies() {
|
||||||
if [ "$os" = 'Linux' ]; then
|
if [ "$os" = 'Linux' ]; then
|
||||||
if [ "${runner:?}" = "self-hosted" ]; then
|
if [ "${runner:?}" = "self-hosted" ]; then
|
||||||
${apt_install:?} autoconf automake libaio-dev gcc g++ php"$version"-dev
|
if ! [[ ${version:?} =~ $nightly_versions ]]; then
|
||||||
|
${apt_install:?} --no-upgrade --no-install-recommends autoconf automake libaio-dev gcc g++ php"$version"-dev
|
||||||
else
|
else
|
||||||
update_lists
|
${apt_install:?} --no-upgrade --no-install-recommends autoconf automake libaio-dev gcc g++
|
||||||
${apt_install:?} php"$version"-dev
|
fi
|
||||||
|
else
|
||||||
|
! [[ ${version:?} =~ $nightly_versions ]] && update_lists && ${apt_install:?} --no-upgrade --no-install-recommends php"$version"-dev
|
||||||
fi
|
fi
|
||||||
sudo update-alternatives --set php-config /usr/bin/php-config"$version"
|
sudo update-alternatives --set php-config /usr/bin/php-config"$version"
|
||||||
sudo update-alternatives --set phpize /usr/bin/phpize"$version"
|
sudo update-alternatives --set phpize /usr/bin/phpize"$version"
|
||||||
@ -117,6 +123,7 @@ add_oci() {
|
|||||||
oracle_home='/opt/oracle'
|
oracle_home='/opt/oracle'
|
||||||
oracle_client=$oracle_home/instantclient
|
oracle_client=$oracle_home/instantclient
|
||||||
os=$(uname -s)
|
os=$(uname -s)
|
||||||
|
nightly_versions='8.[0-1]'
|
||||||
add_client >/dev/null 2>&1
|
add_client >/dev/null 2>&1
|
||||||
add_dependencies >/dev/null 2>&1
|
add_dependencies >/dev/null 2>&1
|
||||||
add_oci_helper >/dev/null 2>&1
|
add_oci_helper >/dev/null 2>&1
|
||||||
|
@ -3,7 +3,11 @@ add_phalcon_helper() {
|
|||||||
status='Installed and enabled'
|
status='Installed and enabled'
|
||||||
if [ "$os_name" = "Linux" ]; then
|
if [ "$os_name" = "Linux" ]; then
|
||||||
update_lists
|
update_lists
|
||||||
|
if [ "$extension" = "phalcon4" ]; then
|
||||||
|
${apt_install:?} "php${version:?}-psr" "php${version:?}-$extension"
|
||||||
|
else
|
||||||
${apt_install:?} "php${version:?}-$extension"
|
${apt_install:?} "php${version:?}-$extension"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
phalcon_ini_file=${ini_file:?}
|
phalcon_ini_file=${ini_file:?}
|
||||||
sed -i '' '/extension.*psr/d' "${ini_file:?}"
|
sed -i '' '/extension.*psr/d' "${ini_file:?}"
|
||||||
|
@ -13,6 +13,7 @@ add_log() {
|
|||||||
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
|
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
|
||||||
else
|
else
|
||||||
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
|
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
|
||||||
|
[ "$fail_fast" = "true" ] && exit 1;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ cleanup_lists() {
|
|||||||
sudo mkdir /etc/apt/sources.list.d
|
sudo mkdir /etc/apt/sources.list.d
|
||||||
sudo mv /etc/apt/sources.list.d.save/*ondrej*.list /etc/apt/sources.list.d/
|
sudo mv /etc/apt/sources.list.d.save/*ondrej*.list /etc/apt/sources.list.d/
|
||||||
sudo mv /etc/apt/sources.list.d.save/*dotdeb*.list /etc/apt/sources.list.d/ 2>/dev/null || true
|
sudo mv /etc/apt/sources.list.d.save/*dotdeb*.list /etc/apt/sources.list.d/ 2>/dev/null || true
|
||||||
trap "sudo mv /etc/apt/sources.list.d.save/*.list /etc/apt/sources.list.d/" exit
|
trap "sudo mv /etc/apt/sources.list.d.save/*.list /etc/apt/sources.list.d/ 2>/dev/null" exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +70,6 @@ update_lists() {
|
|||||||
|
|
||||||
# Function to setup environment for self-hosted runners.
|
# Function to setup environment for self-hosted runners.
|
||||||
self_hosted_setup() {
|
self_hosted_setup() {
|
||||||
echo "Set disable_coredump false" | sudo tee -a /etc/sudo.conf
|
|
||||||
if ! command -v apt-fast >/dev/null; then
|
if ! command -v apt-fast >/dev/null; then
|
||||||
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
||||||
fi
|
fi
|
||||||
@ -89,7 +89,7 @@ configure_pecl() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fuction to get the PECL version of an extension.
|
# Function to get the PECL version of an extension.
|
||||||
get_pecl_version() {
|
get_pecl_version() {
|
||||||
extension=$1
|
extension=$1
|
||||||
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot)")"
|
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot)")"
|
||||||
@ -153,7 +153,7 @@ enable_extension() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Funcion to add PDO extension.
|
# Function to add PDO extension.
|
||||||
add_pdo_extension() {
|
add_pdo_extension() {
|
||||||
pdo_ext="pdo_$1"
|
pdo_ext="pdo_$1"
|
||||||
if check_extension "$pdo_ext"; then
|
if check_extension "$pdo_ext"; then
|
||||||
@ -322,7 +322,7 @@ add_composertool() {
|
|||||||
prefix=$3
|
prefix=$3
|
||||||
(
|
(
|
||||||
composer global require "$prefix$release" >/dev/null 2>&1 &&
|
composer global require "$prefix$release" >/dev/null 2>&1 &&
|
||||||
json=$(grep "$prefix$tool" /home/$USER/.composer/composer.json) &&
|
json=$(grep "$prefix$tool" /home/"$USER"/.composer/composer.json) &&
|
||||||
tool_version=$(get_tool_version 'echo' "$json") &&
|
tool_version=$(get_tool_version 'echo' "$json") &&
|
||||||
add_log "$tick" "$tool" "Added $tool $tool_version"
|
add_log "$tick" "$tool" "Added $tool $tool_version"
|
||||||
) || add_log "$cross" "$tool" "Could not setup $tool"
|
) || add_log "$cross" "$tool" "Could not setup $tool"
|
||||||
@ -340,9 +340,9 @@ add_devtools() {
|
|||||||
add_log "$tick" "$tool" "Added $tool $semver"
|
add_log "$tick" "$tool" "Added $tool $semver"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup the nightly build from master branch.
|
# Function to setup the nightly build from shivammathur/php-builder
|
||||||
setup_master() {
|
setup_nightly() {
|
||||||
curl "${curl_opts[@]}" "$github"/php-builder/releases/latest/download/install.sh | bash -s "$runner"
|
curl "${curl_opts[@]}" "$github"/php-builder/releases/latest/download/install.sh | bash -s "$runner" "$version"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
||||||
@ -374,7 +374,7 @@ switch_version() {
|
|||||||
|
|
||||||
# Function to get PHP version in semver format.
|
# Function to get PHP version in semver format.
|
||||||
php_semver() {
|
php_semver() {
|
||||||
if [ ! "$version" = "$master_version" ]; then
|
if ! [[ "$version" =~ $nightly_versions ]]; then
|
||||||
php"$version" -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-'
|
php"$version" -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-'
|
||||||
else
|
else
|
||||||
php -v | head -n 1 | cut -f 2 -d ' '
|
php -v | head -n 1 | cut -f 2 -d ' '
|
||||||
@ -407,8 +407,8 @@ update_php() {
|
|||||||
|
|
||||||
# Function to install PHP.
|
# Function to install PHP.
|
||||||
add_php() {
|
add_php() {
|
||||||
if [ "$version" = "$master_version" ]; then
|
if [[ "$version" =~ $nightly_versions ]]; then
|
||||||
setup_master
|
setup_nightly
|
||||||
elif [[ "$version" =~ $old_versions ]]; then
|
elif [[ "$version" =~ $old_versions ]]; then
|
||||||
setup_old_versions
|
setup_old_versions
|
||||||
else
|
else
|
||||||
@ -423,12 +423,13 @@ cross="✗"
|
|||||||
pecl_config="false"
|
pecl_config="false"
|
||||||
version=$1
|
version=$1
|
||||||
dist=$2
|
dist=$2
|
||||||
master_version="8.0"
|
fail_fast=$3
|
||||||
|
nightly_versions="8.[0-1]"
|
||||||
old_versions="5.[3-5]"
|
old_versions="5.[3-5]"
|
||||||
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
||||||
github="https://github.com/shivammathur"
|
github="https://github.com/shivammathur"
|
||||||
apt_install="sudo $debconf_fix apt-fast install -y"
|
apt_install="sudo $debconf_fix apt-get install -y"
|
||||||
apt_remove="sudo $debconf_fix apt-fast remove -y"
|
apt_remove="sudo $debconf_fix apt-get remove -y"
|
||||||
tool_path_dir="/usr/local/bin"
|
tool_path_dir="/usr/local/bin"
|
||||||
curl_opts=(-sL)
|
curl_opts=(-sL)
|
||||||
existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
|
existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
|
||||||
@ -464,7 +465,7 @@ else
|
|||||||
update_php >/dev/null 2>&1
|
update_php >/dev/null 2>&1
|
||||||
else
|
else
|
||||||
status="Found"
|
status="Found"
|
||||||
if [ "$version" = "$master_version" ]; then
|
if [[ "$version" =~ $nightly_versions ]]; then
|
||||||
switch_version >/dev/null 2>&1
|
switch_version >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -478,5 +479,5 @@ pecl_file="$scan_dir"/99-pecl.ini
|
|||||||
echo '' | sudo tee "$pecl_file" >/dev/null 2>&1
|
echo '' | sudo tee "$pecl_file" >/dev/null 2>&1
|
||||||
sudo rm -rf /usr/local/bin/phpunit >/dev/null 2>&1
|
sudo rm -rf /usr/local/bin/phpunit >/dev/null 2>&1
|
||||||
sudo chmod 777 "$ini_file" "$pecl_file" "$tool_path_dir"
|
sudo chmod 777 "$ini_file" "$pecl_file" "$tool_path_dir"
|
||||||
sudo mv "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
|
sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
|
||||||
add_log "$tick" "PHP" "$status PHP $semver"
|
add_log "$tick" "PHP" "$status PHP $semver"
|
||||||
|
@ -8,7 +8,10 @@ param (
|
|||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateLength(1, [int]::MaxValue)]
|
[ValidateLength(1, [int]::MaxValue)]
|
||||||
[string]
|
[string]
|
||||||
$dist
|
$dist,
|
||||||
|
[Parameter(Position = 2, Mandatory = $false)]
|
||||||
|
[string]
|
||||||
|
$fail_fast = 'false'
|
||||||
)
|
)
|
||||||
|
|
||||||
# Function to log start of a operation.
|
# Function to log start of a operation.
|
||||||
@ -18,8 +21,14 @@ Function Step-Log($message) {
|
|||||||
|
|
||||||
# Function to log result of a operation.
|
# Function to log result of a operation.
|
||||||
Function Add-Log($mark, $subject, $message) {
|
Function Add-Log($mark, $subject, $message) {
|
||||||
$code = if ($mark -eq $cross) { "31" } else { "32" }
|
if ($mark -eq $tick) {
|
||||||
printf "\033[%s;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $code $mark $subject $message
|
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
|
||||||
|
} else {
|
||||||
|
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
|
||||||
|
if($fail_fast -eq 'true') {
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to add a line to a powershell profile safely.
|
# Function to add a line to a powershell profile safely.
|
||||||
@ -91,9 +100,8 @@ Function Get-CleanPSProfile {
|
|||||||
Function Install-PhpManager() {
|
Function Install-PhpManager() {
|
||||||
$module_path = "$bin_dir\PhpManager\PhpManager.psm1"
|
$module_path = "$bin_dir\PhpManager\PhpManager.psm1"
|
||||||
if(-not (Test-Path $module_path -PathType Leaf)) {
|
if(-not (Test-Path $module_path -PathType Leaf)) {
|
||||||
$release = Invoke-RestMethod https://api.github.com/repos/mlocati/powershell-phpmanager/releases/latest
|
|
||||||
$zip_file = "$bin_dir\PhpManager.zip"
|
$zip_file = "$bin_dir\PhpManager.zip"
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri $release.assets[0].browser_download_url -OutFile $zip_file
|
Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/mlocati/powershell-phpmanager/releases/latest/download/PhpManager.zip' -OutFile $zip_file
|
||||||
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force
|
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force
|
||||||
}
|
}
|
||||||
Import-Module $module_path
|
Import-Module $module_path
|
||||||
@ -310,7 +318,7 @@ $ext_dir = "$php_dir\ext"
|
|||||||
$bin_dir = $php_dir
|
$bin_dir = $php_dir
|
||||||
$current_profile = "$env:TEMP\setup-php.ps1"
|
$current_profile = "$env:TEMP\setup-php.ps1"
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
$master_version = '8.0'
|
$nightly_version = '8.[0-9]'
|
||||||
$cert_source='CurrentUser'
|
$cert_source='CurrentUser'
|
||||||
|
|
||||||
$arch = 'x64'
|
$arch = 'x64'
|
||||||
@ -365,10 +373,9 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
|
|||||||
if ($version -lt '7.0' -and (Get-InstalledModule).Name -notcontains 'VcRedist') {
|
if ($version -lt '7.0' -and (Get-InstalledModule).Name -notcontains 'VcRedist') {
|
||||||
Install-Module -Name VcRedist -Force
|
Install-Module -Name VcRedist -Force
|
||||||
}
|
}
|
||||||
if ($version -eq $master_version) {
|
if ($version -match $nightly_version) {
|
||||||
$version = 'master'
|
Invoke-WebRequest -UseBasicParsing -Uri https://dl.bintray.com/shivammathur/php/Install-PhpNightly.ps1 -OutFile $php_dir\Install-PhpNightly.ps1 > $null 2>&1
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri https://dl.bintray.com/shivammathur/php/Install-PhpMaster.ps1 -OutFile $php_dir\Install-PhpMaster.ps1 > $null 2>&1
|
& $php_dir\Install-PhpNightly.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir -Version $version > $null 2>&1
|
||||||
& $php_dir\Install-PhpMaster.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir
|
|
||||||
} else {
|
} else {
|
||||||
Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force > $null 2>&1
|
Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force > $null 2>&1
|
||||||
}
|
}
|
||||||
@ -393,5 +400,5 @@ if($version -lt "5.5") {
|
|||||||
Enable-PhpExtension -Extension openssl, curl, opcache, mbstring -Path $php_dir
|
Enable-PhpExtension -Extension openssl, curl, opcache, mbstring -Path $php_dir
|
||||||
}
|
}
|
||||||
Update-PhpCAInfo -Path $php_dir -Source $cert_source
|
Update-PhpCAInfo -Path $php_dir -Source $cert_source
|
||||||
Move-Item -path $dist\..\src\configs\*.json -Destination $env:RUNNER_TOOL_CACHE
|
Copy-Item -Path $dist\..\src\configs\*.json -Destination $env:RUNNER_TOOL_CACHE
|
||||||
Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)"
|
Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)"
|
||||||
|
@ -378,7 +378,7 @@ export async function addDevTools(
|
|||||||
return 'add_devtools ' + tool;
|
return 'add_devtools ' + tool;
|
||||||
case 'win32':
|
case 'win32':
|
||||||
return await utils.addLog(
|
return await utils.addLog(
|
||||||
'$cross',
|
'$tick',
|
||||||
tool,
|
tool,
|
||||||
tool + ' is not a windows tool',
|
tool + ' is not a windows tool',
|
||||||
'win32'
|
'win32'
|
||||||
|
Loading…
Reference in New Issue
Block a user