mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Merge pull request #82 from shivammathur/develop
Improve workflows and documentation
This commit is contained in:
commit
2b938d931a
62
.github/workflows/darwin.yml
vendored
62
.github/workflows/darwin.yml
vendored
@ -1,62 +0,0 @@
|
||||
name: Darwin workflow
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
run:
|
||||
name: Run
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 15
|
||||
matrix:
|
||||
operating-system: [macOS-latest]
|
||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup Node.js 12.x
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@preview
|
||||
id: cache
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Installing NPM packages
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: npm install
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Send Coverage
|
||||
continue-on-error: true
|
||||
timeout-minutes: 2
|
||||
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 lib/install.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
|
||||
|
||||
- name: Testing PHP version
|
||||
run: php -v
|
||||
- name: Testing Composer version
|
||||
run: composer -V
|
||||
- name: Testing Extensions
|
||||
run: php -m
|
||||
- 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');")
|
62
.github/workflows/windows.yml
vendored
62
.github/workflows/windows.yml
vendored
@ -1,62 +0,0 @@
|
||||
name: Windows workflow
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
run:
|
||||
name: Run
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 15
|
||||
matrix:
|
||||
operating-system: [windows-latest]
|
||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup Node.js 12.x
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@preview
|
||||
id: cache
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**\package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Installing NPM packages
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: npm install
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Send Coverage
|
||||
continue-on-error: true
|
||||
timeout-minutes: 2
|
||||
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 lib/install.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
|
||||
|
||||
- name: Testing PHP version
|
||||
run: php -v
|
||||
- name: Testing Composer version
|
||||
run: composer -V
|
||||
- name: Testing Extensions
|
||||
run: php -m
|
||||
- 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');")
|
@ -1,4 +1,4 @@
|
||||
name: Ubuntu workflow
|
||||
name: Main workflow
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
run:
|
||||
@ -6,9 +6,8 @@ jobs:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 15
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest]
|
||||
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
|
||||
steps:
|
||||
- name: Checkout
|
29
README.md
29
README.md
@ -46,9 +46,7 @@ Setup PHP with required extensions, php.ini configuration and composer in [GitHu
|
||||
|7.1|`Stable`|`Security fixes only`|
|
||||
|7.2|`Stable`|`Active`|
|
||||
|7.3|`Stable`|`Active`|
|
||||
|7.4|`RC4`/`RC6`|`Active`|
|
||||
|
||||
**Note:** PHP 7.4 is currently in development, do not use in production/release branches.
|
||||
|7.4|`RC6`|`Active`|
|
||||
|
||||
## :cloud: OS/Platform Support
|
||||
|
||||
@ -60,7 +58,7 @@ Setup PHP with required extensions, php.ini configuration and composer in [GitHu
|
||||
|macOS X Catalina 10.15|`macOS-latest` or `macOS-10.15`|
|
||||
|
||||
## :wrench: PHP Extension Support
|
||||
- On `ubuntu` extensions which have the package in `APT` are installed. If extension is not in `APT`, you can use `PECL` to install the extension as fallback by specifying `pecl: true`.
|
||||
- On `ubuntu` by default extensions which are available as a package can be installed. If the extension is not available as a package but it is on `PECL`, it can be installed by specifying `pecl: true`.
|
||||
- On `windows` extensions which have `windows` binary on `PECL` can be installed.
|
||||
- On `macOS` extensions which are on `PECL` can be installed.
|
||||
- Extensions which are installed along with PHP if specified are enabled.
|
||||
@ -130,18 +128,22 @@ See [action.yml](action.yml "Metadata for this GitHub Action") and usage below f
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@master
|
||||
with:
|
||||
php-version: '7.3'
|
||||
extension-csv: mbstring, xdebug #optional, setup extensions
|
||||
extension-csv: mbstring, intl #optional, setup extensions
|
||||
ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
|
||||
coverage: xdebug #optional, setup coverage driver
|
||||
pecl: true #optional, setup PECL
|
||||
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
|
||||
```
|
||||
@ -152,8 +154,7 @@ steps:
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
max-parallel: 15
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
|
||||
@ -161,25 +162,29 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@master
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extension-csv: mbstring, xdebug #optional, setup extensions
|
||||
extension-csv: mbstring, intl #optional, setup extensions
|
||||
ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
|
||||
coverage: xdebug #optional, setup coverage driver
|
||||
pecl: true #optional, setup PECL
|
||||
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
|
||||
```
|
||||
|
||||
### Cache dependencies
|
||||
|
||||
You can persist composer's internal cache directory using the [`action/cache`](https://github.com/actions/cache) GitHub Action. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time.
|
||||
You can persist composer's internal cache directory using the [`action/cache`](https://github.com/actions/cache "GitHub Action to cache files") GitHub Action. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time.
|
||||
|
||||
**Note:** Please do not cache `vendor` directory using `action/cache` as that will have side-effects.
|
||||
|
||||
@ -223,7 +228,7 @@ Examples for setting up this GitHub Action with different PHP Frameworks/Package
|
||||
|
||||
## :scroll: License
|
||||
|
||||
The scripts and documentation in this project are released under the [MIT License](LICENSE "License for shivammathur/setup-php"). This project has multiple [dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Dependencies for this PHP Action") and their licenses can be found in their respective repositories.
|
||||
The scripts and documentation in this project are released under the [MIT License](LICENSE "License for shivammathur/setup-php"). This project has multiple [dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Dependencies for this PHP Action") and uses [various works](#bookmark-this-action-uses-the-following-works "Tools used by this action"). Their licenses can be found in their respective repositories.
|
||||
|
||||
## :+1: Contributions
|
||||
|
||||
|
46
package-lock.json
generated
46
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-php",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -467,9 +467,9 @@
|
||||
}
|
||||
},
|
||||
"@types/babel__traverse": {
|
||||
"version": "7.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.7.tgz",
|
||||
"integrity": "sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw==",
|
||||
"version": "7.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.8.tgz",
|
||||
"integrity": "sha512-yGeB2dHEdvxjP0y4UbRtQaSkXJ9649fYCmIdRoul5kfAoGCwxuCbMhag0k3RPfnuh9kPGm8x89btcfDEXdVWGw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.3.0"
|
||||
@ -510,9 +510,9 @@
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "12.12.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz",
|
||||
"integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==",
|
||||
"version": "12.12.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.11.tgz",
|
||||
"integrity": "sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/normalize-package-data": {
|
||||
@ -2336,9 +2336,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"handlebars": {
|
||||
"version": "4.5.2",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.2.tgz",
|
||||
"integrity": "sha512-29Zxv/cynYB7mkT1rVWQnV7mGX6v7H/miQ6dbEpYTKq5eJBN7PsRB+ViYJlcT6JINTSu4dVB9kOqEun78h6Exg==",
|
||||
"version": "4.5.3",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
|
||||
"integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"neo-async": "^2.6.0",
|
||||
@ -2379,9 +2379,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"has-symbols": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
|
||||
"integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=",
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
|
||||
"integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==",
|
||||
"dev": true
|
||||
},
|
||||
"has-value": {
|
||||
@ -2443,9 +2443,9 @@
|
||||
}
|
||||
},
|
||||
"husky": {
|
||||
"version": "3.0.9",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-3.0.9.tgz",
|
||||
"integrity": "sha512-Yolhupm7le2/MqC1VYLk/cNmYxsSsqKkTyBhzQHhPK1jFnC89mmmNVuGtLNabjDI6Aj8UNIr0KpRNuBkiC4+sg==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-3.1.0.tgz",
|
||||
"integrity": "sha512-FJkPoHHB+6s4a+jwPqBudBDvYZsoQW5/HBuMSehC8qDiCe50kpcxeqFoDSlow+9I6wg47YxBoT3WxaURlrDIIQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^2.4.2",
|
||||
@ -2727,12 +2727,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"is-symbol": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
|
||||
"integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==",
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
|
||||
"integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-symbols": "^1.0.0"
|
||||
"has-symbols": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"is-typedarray": {
|
||||
@ -4134,9 +4134,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"react-is": {
|
||||
"version": "16.11.0",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.11.0.tgz",
|
||||
"integrity": "sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw==",
|
||||
"version": "16.12.0",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz",
|
||||
"integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==",
|
||||
"dev": true
|
||||
},
|
||||
"read-pkg": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-php",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"private": false,
|
||||
"description": "Setup PHP for use with GitHub Actions",
|
||||
"main": "lib/setup-php.js",
|
||||
|
Loading…
Reference in New Issue
Block a user