Compare commits

...

189 Commits

Author SHA1 Message Date
Shivam Mathur bc71c880ee Release v1-verbose 2022-04-10 03:10:28 +05:30
Shivam Mathur 28c92ba4ee Bump version to 1.11.7
Update Node.js dependencies
2022-04-09 20:24:57 +05:30
Shivam Mathur ffd019edc6 Refactor updating dependencies on macOS 2022-04-09 20:24:56 +05:30
Shivam Mathur 0e506b34ac Fix composer setup for Composer 2.3 changes 2022-04-09 20:18:31 +05:30
Shivam Mathur aa0ecfbc6f Add support for mcrypt using shivammathur/extensions tap on macOS 2022-04-09 19:53:51 +05:30
Shivam Mathur f29cd24dbf Update README 2022-04-09 19:53:36 +05:30
Shivam Mathur 2a41b9d1ba Fix patching brew 2022-04-09 19:48:47 +05:30
Shivam Mathur 2a0c477416 Update Node.js dependencies 2022-02-08 18:10:43 +05:30
Shivam Mathur 61aa0dc2f9 Fix manifest URL for v1 2022-02-07 13:10:17 +05:30
Shivam Mathur f4e1b8d33e Bump version to 1.11.6 2022-02-02 14:19:38 +05:30
Shivam Mathur e3a498a6a5 Add CodeQL workflow
Update README

Update Node.js workflow

Fix tests
2022-02-02 14:16:09 +05:30
Shivam Mathur fbdd58c5bc Bump version to 1.11.5
Replace husky with simple-git-hooks

Update Node.js dependencies
2021-09-28 01:51:40 +05:30
Shivam Mathur 2c5cb7a75e Make all extension variables local 2021-09-28 01:42:44 +05:30
Shivam Mathur ab12e42197 Add support for expect and ssh2 using shivammathur/extensions on macOS
Add config to brew extensions and refactor add_brew_extension in darwin.sh to use it
2021-09-28 01:38:12 +05:30
Shivam Mathur 5588437714 Update sponsors section 2021-09-28 01:28:53 +05:30
Shivam Mathur d7eb9ade23 Update SECURITY.md 2021-09-11 04:42:32 +05:30
Shivam Mathur 938988b211 Bump version to 1.11.4
Update Node.js dependencies

Fix build error in install.ts

Add config to generate types

Add bugs, directories, files and types entries in package.json
2021-09-11 04:41:35 +05:30
Shivam Mathur e030852d0e Use PhpManager for all PHP versions on v1 2021-09-09 02:53:01 +05:30
Shivam Mathur 3aa870b0fe Fix unsupported PHP versions warning on v1 2021-09-09 02:49:04 +05:30
Shivam Mathur 1229133602 Use shivammathur/extensions tap to install vips on macOS 2021-09-09 02:40:49 +05:30
Shivam Mathur b1b8d8367c Run New-Item with -Force in Win32.ps1 2021-09-09 02:34:37 +05:30
Shivam Mathur 60ff55130a Update sponsors info 2021-09-09 02:30:03 +05:30
Shivam Mathur e5690a9659 Add windows-2022 to the README 2021-09-09 02:27:14 +05:30
Shivam Mathur 7958a5ccff Bump version 1.11.3
Sync tsconfig.json with v2

Update dependencies
2021-08-23 12:54:39 +05:30
Shivam Mathur 113a31fceb Stop doing shallow clones on macOS self-hosted 2021-08-23 12:49:33 +05:30
Shivam Mathur c9aea8708f Set HOMEBREW_DEVELOPER=1 in macOS 2021-08-23 12:48:34 +05:30
Shivam Mathur 7435bb8e4a Use --no-install-recommends with APT on Linux 2021-08-23 12:47:56 +05:30
Shivam Mathur 5227e2cd5c Fix to make utils.readEnv more resilient to user input 2021-08-23 12:42:17 +05:30
Shivam Mathur 906893d397 Use shivammathur/extensions tap on macOS for mongodb and yaml 2021-08-23 12:41:33 +05:30
Shivam Mathur f1b6b2bbe0 Rename macos-11.0 to macos-11 2021-08-23 12:39:55 +05:30
Shivam Mathur e59c938e82 Update Phive configuration 2021-08-23 12:38:05 +05:30
Shivam Mathur 506357cdb9 Sunset support for Ubuntu 16.04 2021-08-02 22:55:00 +05:30
Shivam Mathur b57416e44d Fix composer permissions on unix 2021-07-21 18:58:36 +05:30
Shivam Mathur 9d1fe69816 Revert PCRE2 Patch 2021-07-16 15:52:34 +05:30
Shivam Mathur fec64d1788 Bump version to 1.11.2
Update Node.js dependencies

Fix replacing v prefix in tool version

Use shivammathur/extensions tap for rdkafka on macOS

Update Ubuntu 16.04 warning in install.ts

Add patch for PCRE2
2021-07-13 15:13:18 +05:30
Shivam Mathur 32c1436247 Update dependencies
Update to Jest 27

Set sourceMap to true in tsconfig.json
2021-05-31 04:07:20 +05:30
Shivam Mathur baab28a534 Fix extension setup 2021-05-31 04:07:07 +05:30
Shivam Mathur d58b967b58 Force overwrite updated dependencies on macOS 2021-05-27 21:00:30 +05:30
Shivam Mathur 17f3c38947 Deprecate Ubuntu 16.04 2021-05-04 23:53:49 +05:30
Shivam Mathur 988f48930d Switch to setup-php.com short URLs in install.ts 2021-05-04 22:11:06 +05:30
Shivam Mathur ea50e73b1f Fix to not use system PHP on macOS 2021-05-04 21:32:36 +05:30
Shivam Mathur bc906f7414 Use mirror for ppa:ondrej/php on Ubuntu 16.04 2021-05-01 16:34:21 +05:30
Shivam Mathur 8bed24ebe1 Add ppa:ondrej/php for all Ubuntu versions 2021-05-01 16:31:03 +05:30
Shivam Mathur 698464efea Fix phalcon3 on windows 2021-04-21 07:38:39 +05:30
Shivam Mathur 45082e25a9 Bump version to 1.11.1
Update Node.js dependencies

Cleanup tsconfig.json

Set moduleResolution to node
2021-04-19 07:11:40 +05:30
Shivam Mathur f0338c8922 Update SECURITY.md 2021-04-19 07:11:39 +05:30
Shivam Mathur 49311db00a Update Node version to 15.x 2021-04-19 07:11:38 +05:30
Shivam Mathur 7d9584bd3f Add fallback to Install-PSPackage in win32.ps1 2021-04-19 07:11:38 +05:30
Shivam Mathur 45df3b1713 Use lcov.info for coverage 2021-04-19 07:11:37 +05:30
Shivam Mathur 70cd53866f Fix gearman setup 2021-04-19 07:11:32 +05:30
Shivam Mathur 12d6e834b7 Add parameters to ppa/lists functions in linux.sh 2021-04-19 00:58:27 +05:30
Shivam Mathur 9fdc82bced Use shivammathur/extensions for phalcon and psr 2021-04-19 00:54:25 +05:30
Shivam Mathur c485e8b283 Fix warning in install.ts 2021-04-19 00:48:26 +05:30
Shivam Mathur 7a90166ec2 Cleanup cleanup_lists in linux.sh 2021-04-19 00:46:18 +05:30
Shivam Mathur 8f96f50dcd Make sure global composer.json directory exists 2021-04-19 00:38:14 +05:30
Shivam Mathur c470f034d0 Fix warning in darwin.sh when linking old libs 2021-04-19 00:36:09 +05:30
Shivam Mathur e2ad91ce1c Remove pcov patch 2021-04-19 00:32:13 +05:30
Shivam Mathur cb746892c2 Use packages from shivammathur/php-ubuntu 2021-03-11 03:44:33 +05:30
Shivam Mathur 8f542eae1a Fix linking old_libraries in macOS 2021-03-08 19:46:30 +05:30
Shivam Mathur 0769672a24 Link libs of updated PHP dependencies on macOS 2021-02-28 19:08:35 +05:30
Shivam Mathur c20693a6ca Bump version to 1.11.0
Update dependencies

Update prettier plugin in .eslintrc.json
2021-02-22 15:37:37 +05:30
Shivam Mathur 0c0ae39775 Assorted fixes 2021-02-22 15:37:36 +05:30
Shivam Mathur d27996462b Set up codeception using composer
Add fixes for global composer tools
2021-02-22 12:01:59 +05:30
Shivam Mathur 0a5e543af7 Improve regexes in extensions.ts 2021-02-22 11:49:32 +05:30
Shivam Mathur 0cc14f65a2 Do not quote ini values with error constants 2021-02-22 11:48:35 +05:30
Shivam Mathur 1ecc5fdca3 Fix composer config syntax 2021-02-22 11:48:34 +05:30
Shivam Mathur 5520fdb61a Add support to specify version in \d.x notation 2021-02-22 11:48:28 +05:30
Shivam Mathur d0f1a91dfd Add support for quoted csv in ini-values 2021-02-22 11:04:31 +05:30
Shivam Mathur 276480411d Change Node.js version in the workflow 2021-02-22 11:02:09 +05:30
Shivam Mathur 827b051fea Sync brew params from v2
Add check for image constants
2021-02-22 10:58:46 +05:30
Shivam Mathur fdaf1f0003 Sync symfony examples from v2 2021-02-22 10:55:37 +05:30
Shivam Mathur 030f4839d4 Update Pre-installed PHP in README 2021-02-22 10:55:36 +05:30
Shivam Mathur 1bb08cc017 Improve pecl support 2021-02-22 10:55:35 +05:30
Shivam Mathur 678ad243bf Exit on failing to setup PHP 2021-02-22 10:55:29 +05:30
Shivam Mathur 20b87bc786 Fetch homebrew taps manually 2021-02-22 10:33:58 +05:30
Shivam Mathur 288f9953ef Add sponsor logos 2021-02-22 10:30:18 +05:30
Shivam Mathur 77ac7d57f1 Improve support for phive 2021-02-22 10:09:52 +05:30
Shivam Mathur 8983fb3ae2 Remove bintray from win32.ps1 2021-02-22 09:59:07 +05:30
Shivam Mathur 87a933f720 Improve extension support
Add support for xdebug2 coverage
2021-02-22 09:19:08 +05:30
Shivam Mathur 847ea65468 Fix php 8 on macos 2020-11-28 15:05:48 +05:30
Shivam Mathur c52ce057af Bump version to 1.10.1 2020-11-26 23:55:29 +05:30
Shivam Mathur 46b357b6c2 Setup Xdebug 2.9.8 on PHP 7.2 2020-11-26 23:50:49 +05:30
Shivam Mathur 2fc508f43d Fix shellcheck warning in add_tool 2020-11-26 11:30:29 +05:30
Shivam Mathur d8de30560b Fix fetching extension version from PECL on macOS 2020-11-26 11:06:55 +05:30
Shivam Mathur 02db83ef5f Fix deleting extensions 2020-11-26 11:05:02 +05:30
Shivam Mathur 6728eaf2ad Change description in actions.yml 2020-11-26 11:02:13 +05:30
Shivam Mathur ca291eadaf Sync dependencies from tap in add_brew_extension 2020-11-26 11:00:53 +05:30
Shivam Mathur 8185c8186b Fix tool setup on windows 2020-11-26 07:32:04 +05:30
Shivam Mathur 44cf056ba8 Bump version to 1.10.0 2020-11-16 03:26:49 +05:30
Shivam Mathur 9bfde13f48 Update README 2020-11-16 03:26:46 +05:30
Shivam Mathur e38eccad04 Fetch release with tool when latest one does not 2020-11-16 03:01:31 +05:30
Shivam Mathur fa211a9d07 Improve regexes for pre-release extensions 2020-11-16 02:55:14 +05:30
Shivam Mathur 5865982519 Fix contribution docs 2020-11-16 02:46:39 +05:30
Shivam Mathur e201830bdd Refactor composer setup 2020-11-16 02:43:59 +05:30
Michele Locati 5c4074b01a Adjust filtered composer version 2020-11-16 02:40:00 +05:30
Michele Locati 48f537d6d0 Allow installing a specific Composer version 2020-11-16 02:37:19 +05:30
Shivam Mathur bc40a61480 Install VcRedist from GitHub 2020-11-16 02:32:09 +05:30
Shivam Mathur 3d5fae7917 Use PECL directly for nightly versions 2020-11-16 02:23:20 +05:30
Shivam Mathur d0591e6d7c Fix composer version for prestissimo & composer-prefetcher to v1 2020-11-16 02:20:15 +05:30
Shivam Mathur b108a66489 Fix version change if composer is a dependency 2020-11-16 02:09:15 +05:30
Shivam Mathur f0a05b4f6e Revert "Switch to apt-get"
This reverts commit 1d1c0f2595.
2020-11-16 01:56:09 +05:30
Shivam Mathur 5070ebd871 Revert "Remove dashes from step ids"
This reverts commit b9ef39c812.
2020-11-16 01:55:15 +05:30
Shivam Mathur bea4065e11 Update dependencies as per runner on macOS 2020-10-23 07:17:55 +05:30
Shivam Mathur c3875408ad Bump version to 1.9.8 2020-10-19 15:14:40 +05:30
Shivam Mathur 1d1c0f2595 Switch to apt-get 2020-10-19 15:14:39 +05:30
Shivam Mathur 1ac189066e Add warnings to v1 2020-10-19 15:14:32 +05:30
Shivam Mathur 74cdfb97c1 Add support for imagick and igbinary on macOS using shivammathur/homebrew-extensions 2020-10-19 15:05:09 +05:30
Shivam Mathur ee05ca54f6 Fix matchers setup when action is called twice 2020-10-19 14:58:36 +05:30
Michele Locati 12b1061a6b Perform only one URL call to download latest PhpManager.zip asset 2020-10-19 14:58:24 +05:30
Shivam Mathur 1c6058bc18 Update Node.js dependencies 2020-10-15 14:26:38 +05:30
Shivam Mathur 2f8045c593 Minor fixes in scripts 2020-10-15 14:26:37 +05:30
Shivam Mathur 6597a6a15b Fix dependency mess in phalcon4 setup on ubuntu 2020-10-15 14:26:36 +05:30
Shivam Mathur 1cc85eb670 Bump version to 1.9.7 2020-10-15 14:26:36 +05:30
Shivam Mathur 6cba0a914f Move matchers setup to scripts 2020-10-15 14:26:35 +05:30
Shivam Mathur c43f842cf3 Prioritize with over env for inputs 2020-10-15 14:26:34 +05:30
Shivam Mathur 11e062bf23 Switch to environment files. Apply GHSA-mfwh-5m23-j46w (CVE-2020-15228) 2020-10-15 14:26:34 +05:30
Shivam Mathur dee3cfee50 Improve problem matchers section in README 2020-10-15 14:26:33 +05:30
Shivam Mathur 26b0fcc6cd Bump version to 1.9.6 2020-10-15 14:26:32 +05:30
Shivam Mathur ab62fff526 Make sure printf is in PATH in Windows 2020-10-15 14:26:32 +05:30
Michele Locati 446bccb14d Download release assets for PowerShell PhpManager
Downloading such assets is preferable since:
- they contain updated metadata (useful for debugging)
- they contain only the production files
- they are pre-built: GitHub doesn't have to create a ZIP from a tag
2020-09-07 02:31:33 +05:30
Michele Locati 29d99c6866 Use releases instead of tags to download PowerShell PhpManager
I just started to publish PhpManager to GitHub Releases too
2020-09-07 02:20:16 +05:30
Shivam Mathur 1444e002ab Replace fedora with valid platform name 2020-09-07 02:16:49 +05:30
Shivam Mathur 03b97e24e9 Remove unnecessary parameter version from addArchive 2020-09-07 02:14:46 +05:30
Shivam Mathur f7fb800623 Bump version to 1.9.5
Switch to fixed getcomposer.org links

Add composer fallback
2020-08-16 07:26:49 +05:30
Shivam Mathur 5593bd4bd3 Remove old PHPUnit on linux 2020-08-16 02:51:32 +05:30
Shivam Mathur 3160874a27 Bump version to 1.9.4 2020-08-10 16:43:54 +05:30
Shivam Mathur db0bbd209b Change cURL opts 2020-08-10 16:43:54 +05:30
Shivam Mathur d920044a54 Limit swoole support to PHP 7.4 2020-08-10 16:43:53 +05:30
Shivam Mathur 818ca89f55 Accept PECL default parameters 2020-08-10 16:43:47 +05:30
Shivam Mathur 8876ac788f Use shivammathur/php-builder-windows for PHP 8 on Windows 2020-08-03 14:18:17 +05:30
Shivam Mathur 0390a48770 Remove obsolete pcov.sh 2020-08-03 14:09:32 +05:30
Shivam Mathur 274e348895 Use default packagist mirror for old PHP 2020-08-03 14:06:14 +05:30
Shivam Mathur 37d7b37f43 Remove update_extension from linux.sh 2020-08-03 14:05:42 +05:30
Shivam Mathur d058d52012 Bump supported version in SECURITY.md 2020-08-03 14:00:18 +05:30
Shivam Mathur 17983e66e5 Bump version to 1.9.3 2020-07-20 20:58:08 +05:30
Shivam Mathur 33a005dd90 Fix logs 2020-07-20 20:58:07 +05:30
Shivam Mathur 1870ffc08c Fix Typo 2020-07-20 17:32:29 +05:30
Shivam Mathur 70fd71ab48 Set memory_limit=-1 on Windows and macOS 2020-07-20 17:28:41 +05:30
Shivam Mathur 2f1900f7bc Fix support for pre-release extensions 2020-07-20 17:25:25 +05:30
Shivam Mathur 19497a0597 Improve updating lists 2020-07-20 17:20:16 +05:30
Shivam Mathur 5b2e081bc0 Install only cli on linux 2020-07-20 17:10:20 +05:30
Shivam Mathur 66fa82fbca Fix coverage 2020-07-20 17:10:19 +05:30
Graham Campbell 4aa42214b1 Update extensions.test.ts 2020-07-20 17:10:18 +05:30
Graham Campbell 1e2c96a4b4 Fixed xdebug version for PHP 5.6 and 7.0 2020-07-20 17:10:17 +05:30
Shivam Mathur 3e8d887b0d Set ini values after coverage setup 2020-07-20 17:10:16 +05:30
Shivam Mathur a3d5500a6a Improve composer setup 2020-07-20 17:10:09 +05:30
Shivam Mathur e763fddf01 Remove update_formulae in darwin.sh 2020-07-07 00:47:45 +05:30
Shivam Mathur 3cd5c7fd3a Bump version to 1.9.2 2020-07-03 17:46:15 +05:30
Shivam Mathur 988cef62da Add ondrej's PPA on focal 2020-07-03 15:18:11 +05:30
Shivam Mathur be3ee05178 Use shivammathur/extensions tap for grpc, swoole, protobuf on macos 2020-07-03 15:06:42 +05:30
Shivam Mathur a74c3369c5 Bump version to 1.9.1 2020-06-20 01:02:16 +05:30
Shivam Mathur b9ef39c812 Remove dashes from step ids 2020-06-20 01:02:16 +05:30
Shivam Mathur 782615d572 Remove --no-suggest flag in examples 2020-06-20 01:02:15 +05:30
Shivam Mathur 31411b0d4d Improve extension support 2020-06-20 01:02:10 +05:30
Shivam Mathur 6b93e48d83 Fix Xdebug coverage 2020-06-19 17:36:28 +05:30
Shivam Mathur fe504c5e23 Bump version to 1.9.0 2020-06-09 07:17:38 +05:30
Shivam Mathur 61d755bd59 Fix updating powershell profile 2020-06-08 03:02:40 +05:30
Shivam Mathur 3455b4ca37 Add support for updating composer 2020-06-08 02:15:24 +05:30
Shivam Mathur 35c24a7d2f Refactor linux.sh and fetch nightly script 2020-06-08 02:00:47 +05:30
Shivam Mathur da7361cc8f Use Invoke-RestMethod to get tag 2020-06-08 01:36:03 +05:30
Shivam Mathur 3f4c1842a0 Remove empty line in logs 2020-06-08 01:34:16 +05:30
Shivam Mathur 062567eeb1 Setup libwebp-dev with PHP8 on linux 2020-05-18 22:34:49 +05:30
Shivam Mathur 00b0d694d0 Update PPA before phalcon setup 2020-05-18 18:03:51 +05:30
Shivam Mathur 54afb29ef6 Update PPA in add_devtools in linux.sh 2020-05-18 17:43:52 +05:30
Shivam Mathur 41329810ef Bump version to 1.8.8 2020-05-17 03:25:48 +05:30
Shivam Mathur 90a6d88c24 Update README.md 2020-05-17 03:25:42 +05:30
Shivam Mathur 8e6968c49e Fix support for phalcon and gearman 2020-05-15 23:34:59 +05:30
Shivam Mathur 4ce413f558 Improve composer support 2020-05-15 23:34:58 +05:30
Shivam Mathur 533e0949a8 cleanup darwin.sh 2020-05-15 23:34:57 +05:30
Shivam Mathur 0ffe535b8e Refactor win32.ps1 2020-05-15 23:34:56 +05:30
Shivam Mathur 55fe8db60d Refactor linux.sh 2020-05-15 23:34:51 +05:30
Shivam Mathur 5af5f992ec Suppress php-config error 2020-05-13 20:36:57 +05:30
Shivam Mathur e9e024e600 Fix loading PECL extensions 2020-05-05 14:57:36 +05:30
Shivam Mathur a7ea0636d7 Fix icu4c version for PHP 5.6 and PHP 7.0 on darwin 2020-04-30 16:59:19 +05:30
Shivam Mathur c471c0a458 Fix libzip-dev error in PHP 8.0 on ubuntu 2020-04-30 07:36:55 +05:30
Shivam Mathur 277239149a Fetch formulae before setup 2020-04-23 16:16:33 +05:30
Shivam Mathur 9385896f2a Bump version to 1.8.7 2020-04-09 21:35:02 +05:30
Shivam Mathur 9cabd8564d Recompile PCOV for PHP8 2020-04-09 21:26:32 +05:30
Shivam Mathur fdfa901941 Update all lists 2020-03-20 19:04:24 +05:30
Shivam Mathur 527cd148c8 Bump version to 1.8.6 2020-03-18 16:15:06 +05:30
Shivam Mathur 59b6e2b54a Install PhpManager from GitHub repo 2020-03-18 16:15:01 +05:30
Shivam Mathur 5ad0888329 Fix db extensions 2020-03-16 08:04:49 +05:30
Shivam Mathur 3cfc409e14 Bump version to 1.8.5 2020-03-14 09:12:58 +05:30
Shivam Mathur ebc671081f Bump ECMAScript version 2020-03-14 07:56:11 +05:30
Shivam Mathur efae663c0f Change case in README 2020-03-14 07:54:36 +05:30
Shivam Mathur fa8a671e6f Improve code quality 2020-03-14 07:53:43 +05:30
Shivam Mathur 6a4159ba98 Improve extension support 2020-03-14 07:42:02 +05:30
Shivam Mathur 0da52b1327 v1 maintenance release - 1.8.4 2020-03-02 20:40:27 +05:30
Shivam Mathur 3579c7ef28 v1 maintenance release 2020-02-17 03:49:19 +05:30
73 changed files with 13497 additions and 7552 deletions
+3 -10
View File
@@ -1,7 +1,7 @@
{ {
"env": { "node": true, "jest": true }, "env": { "node": true, "jest": true },
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 2020, "sourceType": "module" }, "parserOptions": { "ecmaVersion": 2019, "sourceType": "module" },
"extends": [ "extends": [
"eslint:recommended", "eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/eslint-recommended",
@@ -10,14 +10,7 @@
"plugin:import/warnings", "plugin:import/warnings",
"plugin:import/typescript", "plugin:import/typescript",
"plugin:prettier/recommended", "plugin:prettier/recommended",
"prettier/@typescript-eslint" "prettier"
], ],
"plugins": ["@typescript-eslint", "jest"], "plugins": ["@typescript-eslint", "jest"]
"rules": {
"camelcase": "off",
"require-atomic-updates": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-unused-vars": "off"
}
} }
+13 -7
View File
@@ -17,13 +17,6 @@ Due to time constraints, you may not always get a quick response. Please do not
## Coding Guidelines ## Coding Guidelines
This project comes with `.prettierrc.json` and `eslintrc.json` configuration files. Please run the following commands to format the code before committing it.
```bash
$ npm run format
$ npm run lint
```
## Using setup-php from a Git checkout ## Using setup-php from a Git checkout
The following commands can be used to perform the initial checkout of setup-php: The following commands can be used to perform the initial checkout of setup-php:
@@ -40,6 +33,19 @@ Install setup-php dependencies using [npm](https://www.npmjs.com/):
$ npm install $ npm install
``` ```
If you are using `Windows` configure `git` to handle line endings.
```cmd
git config --local core.autocrlf true
```
This project comes with `.prettierrc.json` and `eslintrc.json` configuration files. Please run the following commands to fix and verify the code quality.
```bash
$ npm run format
$ npm run lint
```
## Running the test suite ## Running the test suite
After following the steps shown above, The `setup-php` tests in the `__tests__` directory can be run using this command: After following the steps shown above, The `setup-php` tests in the `__tests__` directory can be run using this command:
+1 -6
View File
@@ -1,8 +1,3 @@
# These are supported funding model platforms # These are supported funding model platforms
github: shivammathur github:shivammathur
community_bridge: setup-php
issuehunt: shivammathur
patreon: shivammathur
liberapay: shivammathur
custom: https://www.paypal.me/shivammathur
+6 -1
View File
@@ -26,7 +26,12 @@ This PR [briefly explain what it does]
- [ ] I have run `npm run format` before the commit. - [ ] I have run `npm run format` before the commit.
- [ ] I have run `npm run lint` before the commit. - [ ] I have run `npm run lint` before the commit.
- [ ] I have run `npm run release` before the commit. - [ ] I have run `npm run release` before the commit.
- [ ] `npm test` returns with no unit test errors. - [ ] `npm test` returns with no unit test errors and all code covered.
> In case this PR edits any scripts:
- [ ] I have checked the edited scripts for syntax.
- [ ] I have tested the changes in an integration test (If yes, provide workflow YAML and link).
<!-- <!--
- Please target the develop branch when submitting the pull request. - Please target the develop branch when submitting the pull request.
-33
View File
@@ -1,33 +0,0 @@
---
name: 🐞 Bug Fix
about: You have a fix for a bug?
labels: bug
---
## A Pull Request should be associated with an Issue.
> We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
> If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
> and potentially we'll be able to point development in a particular direction.
Related issue:
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
> Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR
### Description
This PR [briefly explain what it does]
> In case this PR introduced TypeScript/JavaScript code changes:
- [ ] I have written test cases for the changes in this pull request.
- [ ] I have run `npm run format` before the commit.
- [ ] I have run `npm run lint` before the commit.
- [ ] I have run `npm run release` before the commit.
- [ ] `npm test` returns with no unit test errors.
<!--
- Please target the develop branch when submitting the pull request.
-->
@@ -1,33 +0,0 @@
---
name: ⚙ Improvement
about: You have some improvement to make setup-php better?
labels: enhancement
---
## A Pull Request should be associated with an Issue.
> We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
> If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
> and potentially we'll be able to point development in a particular direction.
Related issue:
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
> Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR
### Description
This PR [briefly explain what it does]
> In case this PR introduced TypeScript/JavaScript code changes:
- [ ] I have written test cases for the changes in this pull request.
- [ ] I have run `npm run format` before the commit.
- [ ] I have run `npm run lint` before the commit.
- [ ] I have run `npm run release` before the commit.
- [ ] `npm test` returns with no unit test errors.
<!--
- Please target the develop branch when submitting the pull request.
-->
@@ -1,33 +0,0 @@
---
name: 🎉 New Feature
about: You have implemented some neat idea that you want to make part of setup-php?
labels: enhancement
---
## A Pull Request should be associated with an Issue.
> We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
> If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
> and potentially we'll be able to point development in a particular direction.
Related issue:
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
> Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR
### Description
This PR [briefly explain what it does]
> In case this PR introduced TypeScript/JavaScript code changes:
- [ ] I have written test cases for the changes in this pull request.
- [ ] I have run `npm run format` before the commit.
- [ ] I have run `npm run lint` before the commit.
- [ ] I have run `npm run release` before the commit.
- [ ] `npm test` returns with no unit test errors.
<!--
- Please target the develop branch when submitting the pull request.
-->
+30
View File
@@ -0,0 +1,30 @@
# Security Policy
## Supported Versions
The following versions of this project are supported for security updates.
| Version | Supported |
| ------- | ------------------ |
| 1.11.x | :white_check_mark: |
| 2.14.x | :white_check_mark: |
## Supported PHP Versions
This security policy only applies to the latest patches of the following PHP versions.
| Version | Supported |
| ------- | ------------------ |
| 7.3 | :white_check_mark: |
| 7.4 | :white_check_mark: |
| 8.0 | :white_check_mark: |
| 8.1 | :white_check_mark: |
## Reporting a Vulnerability
If you have found any issues that might have security implications in the versions supported, please send a report privately to [contact@shivammathur.com](mailto:contact@shivammathur.com).
Do not report security reports publicly.
## Tidelift
If you use this GitHub Action through a Tidelift subscription, please refer to [https://tidelift.com/security](https://tidelift.com/security).
+4
View File
@@ -0,0 +1,4 @@
name : CodeQL Configuration
paths:
- './src'
+25
View File
@@ -0,0 +1,25 @@
name: CodeQL Workflow
on:
workflow_dispatch:
schedule:
- cron: '0 15 * * 6'
jobs:
codeql:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
config-file: ./.github/codeql/codeql-configuration.yml
languages: javascript
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
@@ -1,92 +0,0 @@
name: Experimental workflow
on:
pull_request:
branches:
- nightly
- master
- develop
- verbose
paths-ignore:
- '**.md'
- 'examples/**'
push:
branches:
- nightly
- master
- develop
- verbose
paths-ignore:
- '**.md'
- 'examples/**'
jobs:
run:
name: Run
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['8.0']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: npm install
- name: Prettier Format Check
run: npm run format-check
- name: ESLint Check
run: npm run lint
- name: Run tests
run: npm test
- name: Send Coverage
continue-on-error: true
timeout-minutes: 1
run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }}
- name: Setup PHP with extensions and custom config
run: node dist/index.js
env:
php-version: ${{ matrix.php-versions }}
extensions: xml, opcache, xdebug, pcov #optional
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #optional
coverage: pcov
- name: Testing PHP version
run: |
php -v
php -r "if(strpos(phpversion(), '${{ matrix.php-versions }}') === false) {throw new Exception('Wrong PHP version Installed');}"
- name: Testing Composer version
run: |
composer -V
php -r "if(strpos(@exec('composer -V'), 'Composer version') === false) {throw new Exception('Composer not found');}"
- name: Testing Extensions
run: |
php -m
php -r "if(! extension_loaded('mbstring')) {throw new Exception('mbstring not found');}"
php -r "if(! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
- name: Testing ini values
run: |
php -r "if(ini_get('post_max_size')!='256M') {throw new Exception('post_max_size not added');}"
php -r "if(ini_get('short_open_tag')!=1) {throw new Exception('short_open_tag not added');}"
php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}"
- name: Test JIT
run: |
php -r "if(! extension_loaded('Zend OPcache')) {throw new Exception('Zend OPcache not found');}"
php -r "if(ini_get('opcache.jit_buffer_size')!='256M') {throw new Exception('opcache.jit_buffer_size not set');}"
php -r "if(ini_get('opcache.jit')!=1235) {throw new Exception('opcache.jit not set');}"
php -r "if(ini_get('pcre.jit')!=1) {throw new Exception('pcre.jit not set');}"
- name: Benchmark JIT
run: |
curl -o bench.php https://raw.githubusercontent.com/php/php-src/master/Zend/bench.php
php bench.php
@@ -1,18 +1,15 @@
name: Main workflow name: Main workflow
on: on:
workflow_dispatch:
pull_request: pull_request:
branches: branches:
- master - releases/v1
- develop
- verbose
paths-ignore: paths-ignore:
- '**.md' - '**.md'
- 'examples/**' - 'examples/**'
push: push:
branches: branches:
- master - releases/v1
- develop
- verbose
paths-ignore: paths-ignore:
- '**.md' - '**.md'
- 'examples/**' - 'examples/**'
@@ -23,34 +20,12 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest] operating-system: [ubuntu-20.04, ubuntu-18.04, windows-latest, macos-latest]
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: npm install
- name: Prettier Format Check
run: npm run format-check
- name: ESLint Check
run: npm run lint
- name: Run tests
run: npm test
- name: Send Coverage
continue-on-error: true
timeout-minutes: 1
run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }}
- name: Setup PHP with extensions and custom config - name: Setup PHP with extensions and custom config
run: node dist/index.js run: node dist/index.js
env: env:
@@ -75,6 +50,7 @@ jobs:
php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}" php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
- name: Testing ini values - name: Testing ini values
run: | run: |
php -r "if(ini_get('memory_limit')!='-1') {throw new Exception('memory_limit not disabled');}"
php -r "if(ini_get('post_max_size')!='256M') {throw new Exception('post_max_size not added');}" php -r "if(ini_get('post_max_size')!='256M') {throw new Exception('post_max_size not added');}"
php -r "if(ini_get('short_open_tag')!=1) {throw new Exception('short_open_tag not added');}" php -r "if(ini_get('short_open_tag')!=1) {throw new Exception('short_open_tag not added');}"
php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}" php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}"
+54
View File
@@ -0,0 +1,54 @@
name: Node workflow
on:
pull_request:
branches:
- releases/v1
paths-ignore:
- '**.md'
- 'examples/**'
push:
branches:
- releases/v1
paths-ignore:
- '**.md'
- 'examples/**'
jobs:
run:
name: Run
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install dependencies
run: npm install
- name: Prettier Format Check
run: npm run format-check
- name: ESLint Check
run: npm run lint
- name: Run tests
run: npm test
- name: Run npm audit
run: npm audit
- name: Send Coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
name: github-actions-codecov-${{ matrix.operating-system }}
fail_ci_if_error: false
verbose: true
+7 -6
View File
@@ -1,11 +1,12 @@
{ {
"arrowParens": "avoid",
"bracketSpacing": false,
"endOfLine": "auto",
"parser": "typescript",
"printWidth": 80, "printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true, "semi": true,
"singleQuote": true, "singleQuote": true,
"tabWidth": 2,
"trailingComma": "none", "trailingComma": "none",
"bracketSpacing": false, "useTabs": false
"arrowParens": "avoid", }
"parser": "typescript"
}
+182 -107
View File
@@ -8,7 +8,7 @@
<p align="center"> <p align="center">
<a href="https://github.com/shivammathur/setup-php" title="GitHub action to setup PHP"><img alt="GitHub Actions status" src="https://github.com/shivammathur/setup-php/workflows/Main%20workflow/badge.svg"></a> <a href="https://github.com/shivammathur/setup-php" title="GitHub action to setup PHP"><img alt="GitHub Actions status" src="https://github.com/shivammathur/setup-php/workflows/Main%20workflow/badge.svg"></a>
<a href="https://codecov.io/gh/shivammathur/setup-php" title="Code coverage"><img alt="Codecov Code Coverage" src="https://codecov.io/gh/shivammathur/setup-php/branch/master/graph/badge.svg"></a> <a href="https://codecov.io/gh/shivammathur/setup-php" title="Code coverage"><img alt="Codecov Code Coverage" src="https://img.shields.io/codecov/c/github/shivammathur/setup-php?logo=codecov"></a>
<a href="https://github.com/shivammathur/setup-php/blob/master/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg"></a> <a href="https://github.com/shivammathur/setup-php/blob/master/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg"></a>
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg"></a> <a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg"></a>
</p> </p>
@@ -18,49 +18,50 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
## Contents ## Contents
- [PHP Support](#tada-php-support) - [PHP Support](#tada-php-support)
- [OS/Platform Support](#cloud-osplatform-support) - [GitHub-Hosted Runner Support](#cloud-github-hosted-runner-support)
- [PHP Extension Support](#heavy_plus_sign-php-extension-support) - [PHP Extension Support](#heavy_plus_sign-php-extension-support)
- [Tools Support](#wrench-tools-support) - [Tools Support](#wrench-tools-support)
- [Coverage support](#signal_strength-coverage-support) - [Coverage Support](#signal_strength-coverage-support)
- [Xdebug](#xdebug) - [Xdebug](#xdebug)
- [PCOV](#pcov) - [PCOV](#pcov)
- [Disable coverage](#disable-coverage) - [Disable coverage](#disable-coverage)
- [Usage](#memo-usage) - [Usage](#memo-usage)
- [Basic Setup](#basic-setup) - [Basic Setup](#basic-setup)
- [Matrix Setup](#matrix-setup) - [Matrix Setup](#matrix-setup)
- [Experimental Setup](#experimental-setup)
- [Thread Safe Setup](#thread-safe-setup) - [Thread Safe Setup](#thread-safe-setup)
- [Cache dependencies](#cache-dependencies) - [Cache Dependencies](#cache-dependencies)
- [Composer GitHub OAuth](#composer-github-oauth)
- [Problem Matchers](#problem-matchers) - [Problem Matchers](#problem-matchers)
- [Examples](#examples) - [Examples](#examples)
- [License](#scroll-license) - [License](#scroll-license)
- [Contributions](#1-contributions) - [Contributions](#1-contributions)
- [Support this project](#sparkling_heart-support-this-project) - [Support This project](#sparkling_heart-support-this-project)
- [This action uses the following works](#bookmark-this-action-uses-the-following-works) - [Dependencies](#bookmark-dependencies)
- [Further Reading](#bookmark_tabs-further-reading) - [Further Reading](#bookmark_tabs-further-reading)
## :tada: PHP Support ## :tada: PHP Support
|PHP Version|Stability|Release Support| | PHP Version | Stability | Release Support |
|--- |--- |--- | |-------------|-----------|-----------------------|
|5.6|`Stable`|`End of life`| | 5.6 | `Stable` | `End of life` |
|7.0|`Stable`|`End of life`| | 7.0 | `Stable` | `End of life` |
|7.1|`Stable`|`End of life`| | 7.1 | `Stable` | `End of life` |
|7.2|`Stable`|`Security fixes only`| | 7.2 | `Stable` | `End of life` |
|7.3|`Stable`|`Active`| | 7.3 | `Stable` | `End of life` |
|7.4|`Stable`|`Active`| | 7.4 | `Stable` | `Security fixes only` |
|8.0|`Experimental`|`In development`| | 8.0 | `Stable` | `Active` |
**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 [experimental setup](#experimental-setup) for more information. ## :cloud: GitHub-Hosted Runner Support
## :cloud: OS/Platform Support | Virtual environment | YAML workflow label | Pre-installed PHP |
|----------------------|------------------------------------|------------------------|
|Virtual environment|matrix.operating-system| | Ubuntu 20.04 | `ubuntu-latest` or `ubuntu-20.04` | `PHP 7.4` to `PHP 8.1` |
|--- |--- | | Ubuntu 18.04 | `ubuntu-18.04` | `PHP 7.2` to `PHP 8.1` |
|Windows Server 2019|`windows-latest` or `windows-2019`| | Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.1` |
|Ubuntu 18.04|`ubuntu-latest` or `ubuntu-18.04`| | Windows Server 2019 | `windows-2019` | `PHP 8.1` |
|Ubuntu 16.04|`ubuntu-16.04`| | macOS Monterey 12.x | `macos-12` | `PHP 8.1` |
|macOS X Catalina 10.15|`macos-latest` or `macOS-10.15`| | macOS Big Sur 11.x | `macos-latest` or `macos-11` | `PHP 8.1` |
| macOS Catalina 10.15 | `macos-10.15` | `PHP 8.1` |
## :heavy_plus_sign: PHP Extension Support ## :heavy_plus_sign: PHP Extension Support
- 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` in the tools input. - 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` in the tools input.
@@ -83,28 +84,36 @@ with:
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`.
Version should be in semver format and a valid release of the tool.
The latest stable version of `composer` is set up by default. You can set up the required `composer` version by specifying `v1`, `v2`, `snapshot` or `preview` as versions or the exact version in semver format.
```yaml ```yaml
uses: shivammathur/setup-php@v1 uses: shivammathur/setup-php@v1
with: with:
php-version: '7.4' php-version: '7.4'
tools: php-cs-fixer:2.15.5, phpunit:8.5.1 tools: composer:v2
``` ```
**Note** If you have specified composer plugins `prestissimo` or `composer-prefetcher` in tools, the latest stable version of `composer v1` will be setup. Unless some of your packages require `composer v1`, it is recommended to drop `prestissimo` and use `composer v2`.
- `composer` is setup by default.
- Specifying version for `composer` and `pecl` has no effect, latest version of both tools will be setup.
- If the version specified for the tool is not in semver format, latest version of the tool will be setup.
- Tools which cannot be installed gracefully leave an error message in the logs, the action is not interrupted.
## :signal_strength: Coverage support Version for other tools should be in `semver` format and a valid release of the tool.
```yaml
uses: shivammathur/setup-php@v1
with:
php-version: '7.4'
tools: php-cs-fixer:2.16.2, phpunit:8.5.1
```
Tools which cannot be installed gracefully leave an error message in the logs, the action is not interrupted.
## :signal_strength: Coverage Support
### Xdebug ### Xdebug
Specify `coverage: xdebug` to use `Xdebug`. Specify `coverage: xdebug` to use `Xdebug`.
Runs on all [PHP versions supported](#tada-php-support "List of PHP versions supported on this GitHub Action") except `8.0`. Runs on all [PHP versions supported](#tada-php-support "List of PHP versions supported on this GitHub Action").
```yaml ```yaml
uses: shivammathur/setup-php@v1 uses: shivammathur/setup-php@v1
@@ -129,7 +138,7 @@ with:
coverage: pcov coverage: pcov
``` ```
### Disable coverage ### Disable Coverage
Specify `coverage: none` to disable both `Xdebug` and `PCOV`. Specify `coverage: none` to disable both `Xdebug` and `PCOV`.
Consider disabling the coverage using this PHP action for these reasons. Consider disabling the coverage using this PHP action for these reasons.
@@ -203,31 +212,6 @@ jobs:
tools: php-cs-fixer, phpunit #optional, setup tools globally tools: php-cs-fixer, phpunit #optional, setup tools globally
``` ```
### Experimental Setup
> Setup a nightly build of `PHP 8.0.0-dev` from the [master branch](https://github.com/php/php-src/tree/master "Master branch on PHP source repository") of PHP.
- This version is currently in development and is an experimental feature on this action.
- `PECL` is installed by default with this version on `ubuntu`.
- Some extensions might not support this version currently.
- Refer to this [RFC](https://wiki.php.net/rfc/jit "PHP JIT RFC configuration") for configuring `PHP JIT` on this version.
- Refer to this [list of RFCs](https://wiki.php.net/rfc#php_80 "List of RFCs implemented in PHP8") implemented in this version.
```yaml
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: '8.0'
extensions: mbstring #optional, setup extensions
ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1 #optional, setup php.ini configuration
coverage: pcov #optional, setup PCOV, Xdebug does not support this version yet.
tools: php-cs-fixer, phpunit #optional, setup tools globally
```
### Thread Safe Setup ### Thread Safe Setup
- `NTS` versions are setup by default. - `NTS` versions are setup by default.
@@ -248,10 +232,10 @@ jobs:
with: with:
php-version: '7.4' php-version: '7.4'
env: env:
PHPTS: ts # specify ts or nts phpts: ts # specify ts or nts
``` ```
### Cache dependencies ### Cache Dependencies
You can persist composer's internal cache directory using the [`action/cache`](https://github.com/actions/cache "GitHub Action to cache files") GitHub Action. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time. 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.
@@ -263,7 +247,7 @@ You can persist composer's internal cache directory using the [`action/cache`](h
run: echo "::set-output name=dir::$(composer config cache-files-dir)" run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v2
with: with:
path: ${{ steps.composer-cache.outputs.dir }} path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -273,92 +257,183 @@ You can persist composer's internal cache directory using the [`action/cache`](h
run: composer install --prefer-dist run: composer install --prefer-dist
``` ```
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. - If you do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
```yaml ```yaml
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
``` ```
- If you support a range of `composer` dependencies and use `prefer-lowest` and `prefer-stable` options, you can store them in your matrix add them to the keys.
```yaml
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.prefer }}-
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
```
### Composer GitHub OAuth
If you have a number of workflows which setup multiple tools or have many composer dependencies, you might hit the GitHub's rate limit for composer. To avoid that you can add a `OAuth` token to the composer's config by setting `COMPOSER_TOKEN` environment variable. You can use [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token "GITHUB_TOKEN documentation") secret for this purpose.
```yaml
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### 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.
#### PHP
Setup problem matchers for your `PHP` output by adding this step after the `setup-php` step.
```yaml
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
```
#### PHPUnit #### PHPUnit
You can setup problem matchers for your `PHPUnit` output by adding this step after the `setup-php` step. This will scan the logs for failing tests and surface that information prominently in the GitHub Actions UI by creating annotations and log file decorations. Setup problem matchers for your `PHPUnit` output by adding this step after the `setup-php` step.
```yaml ```yaml
- name: Setup Problem Matchers for PHPUnit - name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
``` ```
#### Other tools #### PHPStan
PHPStan supports error reporting in GitHub Actions, so no problem matchers are required.
```yaml
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: phpstan
- name: Run PHPStan
run: phpstan analyse src
```
#### Psalm
Psalm supports error reporting in GitHub Actions with an output format `github`.
```yaml
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: psalm
- name: Run Psalm
run: psalm --output-format=github
```
#### Tools with checkstyle support
For tools that support `checkstyle` reporting like `phpstan`, `psalm`, `php-cs-fixer` and `phpcs` you can use `cs2pr` to annotate your code. For tools that support `checkstyle` reporting like `phpstan`, `psalm`, `php-cs-fixer` and `phpcs` you can use `cs2pr` to annotate your code.
For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-pull-request-from-checkstyle). For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-pull-request-from-checkstyle).
> Here is an example with `phpstan`. > Here is an example with `phpcs`.
```yaml ```yaml
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v1 uses: shivammathur/setup-php@v2
with: with:
php-version: '7.4' php-version: '7.4'
tools: cs2pr, phpstan tools: cs2pr, phpcs
- name: PHPStan - name: Run phpcs
run: phpstan analyse src --error-format=checkstyle | cs2pr run: phpcs -q --report=checkstyle src | cs2pr
``` ```
### Examples ### Examples
Examples for setting up this GitHub Action with different PHP Frameworks/Packages. Examples for setting up this GitHub Action with different PHP Frameworks/Packages.
|Framework/Package|Runs on|Workflow| | Framework/Package | Runs on | Workflow |
|--- |--- |--- | |---------------------------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------|
|CakePHP with `MySQL` and `Redis`|`ubuntu`|[cakephp-mysql.yml](./examples/cakephp-mysql.yml "GitHub Action for CakePHP with MySQL and Redis")| | CakePHP with `MySQL` and `Redis` | `ubuntu` | [cakephp-mysql.yml](./examples/cakephp-mysql.yml "GitHub Action for CakePHP with MySQL and Redis") |
|CakePHP with `PostgreSQL` and `Redis`|`ubuntu`|[cakephp-postgres.yml](./examples/cakephp-postgres.yml "GitHub Action for CakePHP with Postgres and Redis")| | CakePHP with `PostgreSQL` and `Redis` | `ubuntu` | [cakephp-postgres.yml](./examples/cakephp-postgres.yml "GitHub Action for CakePHP with Postgres and Redis") |
|CakePHP without services|`macOS`, `ubuntu` and `windows`|[cakephp.yml](./examples/cakephp.yml "GitHub Action for CakePHP without services")| | CakePHP without services | `macOS`, `ubuntu` and `windows` | [cakephp.yml](./examples/cakephp.yml "GitHub Action for CakePHP without services") |
|CodeIgniter|`macOS`, `ubuntu` and `windows`|[codeigniter.yml](./examples/codeigniter.yml "GitHub Action for CodeIgniter")| | CodeIgniter | `macOS`, `ubuntu` and `windows` | [codeigniter.yml](./examples/codeigniter.yml "GitHub Action for CodeIgniter") |
|Laravel with `MySQL` and `Redis`|`ubuntu`|[laravel-mysql.yml](./examples/laravel-mysql.yml "GitHub Action for Laravel with MySQL and Redis")| | Laravel with `MySQL` and `Redis` | `ubuntu` | [laravel-mysql.yml](./examples/laravel-mysql.yml "GitHub Action for Laravel with MySQL and Redis") |
|Laravel with `PostgreSQL` and `Redis`|`ubuntu`|[laravel-postgres.yml](./examples/laravel-postgres.yml "GitHub Action for Laravel with PostgreSQL and Redis")| | Laravel with `PostgreSQL` and `Redis` | `ubuntu` | [laravel-postgres.yml](./examples/laravel-postgres.yml "GitHub Action for Laravel with PostgreSQL and Redis") |
|Laravel without services|`macOS`, `ubuntu` and `windows`|[laravel.yml](./examples/laravel.yml "GitHub Action for Laravel without services")| | Laravel without services | `macOS`, `ubuntu` and `windows` | [laravel.yml](./examples/laravel.yml "GitHub Action for Laravel without services") |
|Lumen with `MySQL` and `Redis`|`ubuntu`|[lumen-mysql.yml](./examples/lumen-mysql.yml "GitHub Action for Lumen with MySQL and Redis")| | Lumen with `MySQL` and `Redis` | `ubuntu` | [lumen-mysql.yml](./examples/lumen-mysql.yml "GitHub Action for Lumen with MySQL and Redis") |
|Lumen with `PostgreSQL` and `Redis`|`ubuntu`|[lumen-postgres.yml](./examples/lumen-postgres.yml "GitHub Action for Lumen with PostgreSQL and Redis")| | Lumen with `PostgreSQL` and `Redis` | `ubuntu` | [lumen-postgres.yml](./examples/lumen-postgres.yml "GitHub Action for Lumen with PostgreSQL and Redis") |
|Lumen without services|`macOS`, `ubuntu` and `windows`|[lumen.yml](./examples/lumen.yml "GitHub Action for Lumen without services")| | Lumen without services | `macOS`, `ubuntu` and `windows` | [lumen.yml](./examples/lumen.yml "GitHub Action for Lumen without services") |
|Phalcon with `MySQL`|`ubuntu`|[phalcon-mysql.yml](./examples/phalcon-mysql.yml "GitHub Action for Phalcon with MySQL")| | Phalcon with `MySQL` | `ubuntu` | [phalcon-mysql.yml](./examples/phalcon-mysql.yml "GitHub Action for Phalcon with MySQL") |
|Phalcon with `PostgreSQL`|`ubuntu`|[phalcon-postgres.yml](./examples/phalcon-postgres.yml "GitHub Action for Phalcon with PostgreSQL")| | Phalcon with `PostgreSQL` | `ubuntu` | [phalcon-postgres.yml](./examples/phalcon-postgres.yml "GitHub Action for Phalcon with PostgreSQL") |
|Roots/bedrock|`ubuntu`|[bedrock.yml](./examples/bedrock.yml "GitHub Action for Wordpress Development using @roots/bedrock")| | Roots/bedrock | `ubuntu` | [bedrock.yml](./examples/bedrock.yml "GitHub Action for Wordpress Development using @roots/bedrock") |
|Roots/sage|`ubuntu`|[sage.yml](./examples/sage.yml "GitHub Action for Wordpress Development using @roots/sage")| | Roots/sage | `ubuntu` | [sage.yml](./examples/sage.yml "GitHub Action for Wordpress Development using @roots/sage") |
|Slim Framework|`macOS`, `ubuntu` and `windows`|[slim-framework.yml](./examples/slim-framework.yml "GitHub Action for Slim Framework")| | Slim Framework | `macOS`, `ubuntu` and `windows` | [slim-framework.yml](./examples/slim-framework.yml "GitHub Action for Slim Framework") |
|Symfony with `MySQL`|`ubuntu`|[symfony-mysql.yml](./examples/symfony-mysql.yml "GitHub Action for Symfony with MySQL")| | Symfony with `MySQL` | `ubuntu` | [symfony-mysql.yml](./examples/symfony-mysql.yml "GitHub Action for Symfony with MySQL") |
|Symfony with `PostgreSQL`|`ubuntu`|[symfony-postgres.yml](./examples/symfony-postgres.yml "GitHub Action for Symfony with PostgreSQL")| | Symfony with `PostgreSQL` | `ubuntu` | [symfony-postgres.yml](./examples/symfony-postgres.yml "GitHub Action for Symfony with PostgreSQL") |
|Symfony without services|`macOS`, `ubuntu` and `windows`|[symfony.yml](./examples/symfony.yml "GitHub Action for Symfony without services")| | Symfony without services | `macOS`, `ubuntu` and `windows` | [symfony.yml](./examples/symfony.yml "GitHub Action for Symfony without services") |
|Yii2 Starter Kit with `MySQL`|`ubuntu`|[yii2-mysql.yml](./examples/yii2-mysql.yml "GitHub Action for Yii2 Starter Kit with MySQL")| | Yii2 Starter Kit with `MySQL` | `ubuntu` | [yii2-mysql.yml](./examples/yii2-mysql.yml "GitHub Action for Yii2 Starter Kit with MySQL") |
|Yii2 Starter Kit with `PostgreSQL`|`ubuntu`|[yii2-postgres.yml](./examples/yii2-postgres.yml "GitHub Action for Yii2 Starter Kit with PostgreSQL")| | Yii2 Starter Kit with `PostgreSQL` | `ubuntu` | [yii2-postgres.yml](./examples/yii2-postgres.yml "GitHub Action for Yii2 Starter Kit with PostgreSQL") |
|Zend Framework|`macOS`, `ubuntu` and `windows`|[zend-framework.yml](./examples/zend-framework.yml "GitHub Action for Zend Framework")| | Zend Framework | `macOS`, `ubuntu` and `windows` | [zend-framework.yml](./examples/zend-framework.yml "GitHub Action for Zend Framework") |
## :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 uses [various works](#bookmark-this-action-uses-the-following-works "Tools used by this action"). 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](#bookmark-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").
## :+1: Contributions ## :+1: Contributions
Contributions are welcome! See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/setup-php contribution guide"). If you face any issues while using this or want to suggest a feature/improvement, create an issue [here](https://github.com/shivammathur/setup-php/issues "Issues reported"). Contributions are welcome! See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/setup-php contribution guide"). If you face any issues while using this or want to suggest a feature/improvement, create an issue [here](https://github.com/shivammathur/setup-php/issues "Issues reported").
## :sparkling_heart: Support this project
If this action helped you. ## :sparkling_heart: Support This Project
- Please star the project and share it with the community. - Please star the project and share it. If you blog, please share your experience of using `setup-php`.
- If you blog, write about your experience while using this action. - Please [reach out](mailto:contact@setup-php.com) if you have any questions about sponsoring setup-php.
- I maintain this in my free time, please support me with a [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon") subscription or a one time contribution using [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal").
- If you need any help using this, please contact me using [Codementor](https://www.codementor.io/shivammathur "Shivam Mathur Codementor")
## :bookmark: This action uses the following works Many users and organisations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Pre-compiled ubuntu packages") <a href="https://github.com/sponsors/shivammathur"><img src="https://setup-php.com/sponsors.svg?" alt="Sponsor shivammathur"></a>
- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Pre-compiled nightly PHP builds")
These companies generously provide setup-php their products and services to aid in the development of this project.
<p>
<a href="https://www.jetbrains.com/?from=setup-php">
<img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="106" height="60">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://www.macstadium.com/opensource/members#gh-light-mode-only">
<img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="148" height="60">
</a>
<a href="https://www.macstadium.com/opensource/members#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="148" height="60">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://tidelift.com/subscription/pkg/npm-setup-php">
<img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="70" height="60">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://www.scaleway.com/en/about-us/open-source-program#gh-light-mode-only">
<img src="https://setup-php.com/sponsors/scaleway.png" alt="Scaleway" width="174" height="60">
</a>
<a href="https://www.scaleway.com/en/about-us/open-source-program#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/scaleway-white.png" alt="Scaleway" width="174" height="60">
</a>
</p>
## :bookmark: Dependencies
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
- [aaronparker/VcRedist](https://github.com/aaronparker/VcRedist "VcRedist PowerShell package")
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows") - [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages")
- [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds for MacOS") - [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds for MacOS")
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions for MacOS")
- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Nightly PHP package")
## :bookmark_tabs: Further Reading ## :bookmark_tabs: Further Reading
+6 -6
View File
@@ -12,9 +12,9 @@ describe('Config tests', () => {
win32 = await config.addINIValues( win32 = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata', 'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'fedora' 'openbsd'
); );
expect(win32).toContain('Platform fedora is not supported'); expect(win32).toContain('Platform openbsd is not supported');
}); });
it('checking addINIValuesOnLinux', async () => { it('checking addINIValuesOnLinux', async () => {
@@ -29,9 +29,9 @@ describe('Config tests', () => {
linux = await config.addINIValues( linux = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata', 'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'fedora' 'openbsd'
); );
expect(linux).toContain('Platform fedora is not supported'); expect(linux).toContain('Platform openbsd is not supported');
}); });
it('checking addINIValuesOnDarwin', async () => { it('checking addINIValuesOnDarwin', async () => {
@@ -45,8 +45,8 @@ describe('Config tests', () => {
darwin = await config.addINIValues( darwin = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata', 'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'fedora' 'openbsd'
); );
expect(darwin).toContain('Platform fedora is not supported'); expect(darwin).toContain('Platform openbsd is not supported');
}); });
}); });
+34 -21
View File
@@ -1,15 +1,9 @@
import * as coverage from '../src/coverage'; import * as coverage from '../src/coverage';
jest.mock('../src/extensions', () => ({
addExtension: jest.fn().mockImplementation(extension => {
return 'add_extension ' + extension + '\n';
})
}));
describe('Config tests', () => { describe('Config tests', () => {
it('checking addCoverage with PCOV on windows', async () => { it('checking addCoverage with PCOV on windows', async () => {
let win32: string = await coverage.addCoverage('PCOV', '7.4', 'win32'); let win32: string = await coverage.addCoverage('PCOV', '7.4', 'win32');
expect(win32).toContain('add_extension pcov'); expect(win32).toContain('Add-Extension pcov');
expect(win32).toContain('Remove-Extension xdebug'); expect(win32).toContain('Remove-Extension xdebug');
win32 = await coverage.addCoverage('pcov', '7.0', 'win32'); win32 = await coverage.addCoverage('pcov', '7.0', 'win32');
@@ -27,28 +21,38 @@ describe('Config tests', () => {
it('checking addCoverage with PCOV on darwin', async () => { it('checking addCoverage with PCOV on darwin', async () => {
const darwin: string = await coverage.addCoverage('pcov', '7.4', 'darwin'); const darwin: string = await coverage.addCoverage('pcov', '7.4', 'darwin');
expect(darwin).toContain('add_extension pcov'); expect(darwin).toContain('add_brew_extension pcov');
expect(darwin).toContain('remove_extension xdebug'); expect(darwin).toContain('remove_extension xdebug');
}); });
it('checking addCoverage with Xdebug on windows', async () => { it('checking addCoverage with Xdebug on windows', async () => {
const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32'); const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32');
expect(win32).toContain('add_extension xdebug'); expect(win32).toContain('Add-Extension xdebug');
}); });
it('checking addCoverage with Xdebug on windows', async () => { it('checking addCoverage with Xdebug3 on windows', async () => {
const win32: string = await coverage.addCoverage('xdebug', '8.0', 'win32'); const win32: string = await coverage.addCoverage('xdebug3', '7.4', 'win32');
expect(win32).toContain('Xdebug currently only supports PHP 7.4 or lower'); expect(win32).toContain('Add-Extension xdebug');
}); });
it('checking addCoverage with Xdebug on linux', async () => { it('checking addCoverage with Xdebug2 on windows', async () => {
const linux: string = await coverage.addCoverage('xdebug', '7.4', 'linux'); const win32: string = await coverage.addCoverage('xdebug2', '7.4', 'win32');
expect(linux).toContain('add_extension xdebug'); expect(win32).toContain('Add-Extension xdebug stable 2.9.8');
}); });
it('checking addCoverage with Xdebug on linux', async () => { it('checking addCoverage with Xdebug on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux'); const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
expect(linux).toContain('Xdebug currently only supports PHP 7.4 or lower'); expect(linux).toContain('add_extension xdebug');
});
it('checking addCoverage with Xdebug3 on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug3', '8.0', 'linux');
expect(linux).toContain('add_extension xdebug');
});
it('checking addCoverage with Xdebug2 on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug2', '7.4', 'linux');
expect(linux).toContain('add_pecl_extension xdebug 2.9.8 zend_extension');
}); });
it('checking addCoverage with Xdebug on darwin', async () => { it('checking addCoverage with Xdebug on darwin', async () => {
@@ -57,16 +61,25 @@ describe('Config tests', () => {
'7.4', '7.4',
'darwin' 'darwin'
); );
expect(darwin).toContain('add_extension xdebug'); expect(darwin).toContain('add_brew_extension xdebug');
}); });
it('checking addCoverage with Xdebug on darwin', async () => { it('checking addCoverage with Xdebug3 on darwin', async () => {
const darwin: string = await coverage.addCoverage( const darwin: string = await coverage.addCoverage(
'xdebug', 'xdebug3',
'8.0', '7.4',
'darwin' 'darwin'
); );
expect(darwin).toContain('Xdebug currently only supports PHP 7.4 or lower'); expect(darwin).toContain('add_brew_extension xdebug');
});
it('checking addCoverage with Xdebug2 on darwin', async () => {
const darwin: string = await coverage.addCoverage(
'xdebug2',
'7.4',
'darwin'
);
expect(darwin).toContain('add_brew_extension xdebug2');
}); });
it('checking disableCoverage windows', async () => { it('checking disableCoverage windows', async () => {