Merge pull request #82 from shivammathur/develop

Improve workflows and documentation
This commit is contained in:
Shivam Mathur 2019-11-22 01:59:30 +05:30 committed by GitHub
commit 2b938d931a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 163 deletions

View File

@ -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');")

View File

@ -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');")

View File

@ -1,4 +1,4 @@
name: Ubuntu workflow name: Main workflow
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
run: run:
@ -6,9 +6,8 @@ jobs:
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 15
matrix: 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'] php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
steps: steps:
- name: Checkout - name: Checkout

View File

@ -46,9 +46,7 @@ Setup PHP with required extensions, php.ini configuration and composer in [GitHu
|7.1|`Stable`|`Security fixes only`| |7.1|`Stable`|`Security fixes only`|
|7.2|`Stable`|`Active`| |7.2|`Stable`|`Active`|
|7.3|`Stable`|`Active`| |7.3|`Stable`|`Active`|
|7.4|`RC4`/`RC6`|`Active`| |7.4|`RC6`|`Active`|
**Note:** PHP 7.4 is currently in development, do not use in production/release branches.
## :cloud: OS/Platform Support ## :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`| |macOS X Catalina 10.15|`macOS-latest` or `macOS-10.15`|
## :wrench: PHP Extension Support ## :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 `windows` extensions which have `windows` binary on `PECL` can be installed.
- On `macOS` extensions which are 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. - 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: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@master uses: actions/checkout@master
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@master uses: shivammathur/setup-php@master
with: with:
php-version: '7.3' 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 ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
coverage: xdebug #optional, setup coverage driver coverage: xdebug #optional, setup coverage driver
pecl: true #optional, setup PECL pecl: false #optional, setup PECL
- name: Check PHP Version - name: Check PHP Version
run: php -v run: php -v
- name: Check Composer Version - name: Check Composer Version
run: composer -V run: composer -V
- name: Check PHP Extensions - name: Check PHP Extensions
run: php -m run: php -m
``` ```
@ -152,8 +154,7 @@ steps:
jobs: jobs:
run: run:
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}
strategy: strategy:
max-parallel: 15
matrix: matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest] 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']
@ -161,25 +162,29 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@master uses: actions/checkout@master
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@master uses: shivammathur/setup-php@master
with: with:
php-version: ${{ matrix.php-versions }} 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 ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
coverage: xdebug #optional, setup coverage driver coverage: xdebug #optional, setup coverage driver
pecl: true #optional, setup PECL pecl: false #optional, setup PECL
- name: Check PHP Version - name: Check PHP Version
run: php -v run: php -v
- name: Check Composer Version - name: Check Composer Version
run: composer -V run: composer -V
- name: Check PHP Extensions - name: Check PHP Extensions
run: php -m run: php -m
``` ```
### Cache dependencies ### 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. **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 ## :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 ## :+1: Contributions

46
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "1.5.2", "version": "1.5.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -467,9 +467,9 @@
} }
}, },
"@types/babel__traverse": { "@types/babel__traverse": {
"version": "7.0.7", "version": "7.0.8",
"resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.7.tgz", "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.8.tgz",
"integrity": "sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw==", "integrity": "sha512-yGeB2dHEdvxjP0y4UbRtQaSkXJ9649fYCmIdRoul5kfAoGCwxuCbMhag0k3RPfnuh9kPGm8x89btcfDEXdVWGw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/types": "^7.3.0" "@babel/types": "^7.3.0"
@ -510,9 +510,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "12.12.7", "version": "12.12.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.11.tgz",
"integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==", "integrity": "sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ==",
"dev": true "dev": true
}, },
"@types/normalize-package-data": { "@types/normalize-package-data": {
@ -2336,9 +2336,9 @@
"dev": true "dev": true
}, },
"handlebars": { "handlebars": {
"version": "4.5.2", "version": "4.5.3",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.2.tgz", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
"integrity": "sha512-29Zxv/cynYB7mkT1rVWQnV7mGX6v7H/miQ6dbEpYTKq5eJBN7PsRB+ViYJlcT6JINTSu4dVB9kOqEun78h6Exg==", "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==",
"dev": true, "dev": true,
"requires": { "requires": {
"neo-async": "^2.6.0", "neo-async": "^2.6.0",
@ -2379,9 +2379,9 @@
"dev": true "dev": true
}, },
"has-symbols": { "has-symbols": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
"integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==",
"dev": true "dev": true
}, },
"has-value": { "has-value": {
@ -2443,9 +2443,9 @@
} }
}, },
"husky": { "husky": {
"version": "3.0.9", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/husky/-/husky-3.0.9.tgz", "resolved": "https://registry.npmjs.org/husky/-/husky-3.1.0.tgz",
"integrity": "sha512-Yolhupm7le2/MqC1VYLk/cNmYxsSsqKkTyBhzQHhPK1jFnC89mmmNVuGtLNabjDI6Aj8UNIr0KpRNuBkiC4+sg==", "integrity": "sha512-FJkPoHHB+6s4a+jwPqBudBDvYZsoQW5/HBuMSehC8qDiCe50kpcxeqFoDSlow+9I6wg47YxBoT3WxaURlrDIIQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.4.2", "chalk": "^2.4.2",
@ -2727,12 +2727,12 @@
"dev": true "dev": true
}, },
"is-symbol": { "is-symbol": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
"integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"has-symbols": "^1.0.0" "has-symbols": "^1.0.1"
} }
}, },
"is-typedarray": { "is-typedarray": {
@ -4134,9 +4134,9 @@
"dev": true "dev": true
}, },
"react-is": { "react-is": {
"version": "16.11.0", "version": "16.12.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.11.0.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz",
"integrity": "sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw==", "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==",
"dev": true "dev": true
}, },
"read-pkg": { "read-pkg": {

View File

@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "1.5.2", "version": "1.5.3",
"private": false, "private": false,
"description": "Setup PHP for use with GitHub Actions", "description": "Setup PHP for use with GitHub Actions",
"main": "lib/setup-php.js", "main": "lib/setup-php.js",