Compare commits

...

636 Commits
1.2.1 ... 2.9.0

Author SHA1 Message Date
b2f833f7d1 Fix extension setup 2021-06-04 21:23:57 +05:30
86e1ccdd8d Fix pdo setup 2021-02-19 13:30:02 +05:30
36ec0200a6 Fix cache support for cubrid and pdo_cubrid 2021-02-19 07:18:39 +05:30
1686147b24 Do not quote ini values with error constants 2021-02-04 13:01:05 +05:30
ecc8611061 Update README 2021-02-04 11:00:28 +05:30
abefdb50ee Fix composer config syntax 2021-02-04 11:00:27 +05:30
2ea6ca5b36 Update brew for all PHP versions until updated on images 2021-02-04 11:00:20 +05:30
a83d4379b1 Fix pcov on PHP 8.0 on Windows 2021-01-19 20:36:17 +05:30
fbc8407035 Add support to specify version in \d.x notation 2021-01-16 11:16:13 +05:30
6972aed899 Add support for quoted csv in ini-values 2021-01-15 13:52:18 +05:30
d2f58713aa Use GITHUB_ENV to append to PATH 2021-01-07 21:53:45 +05:30
068c794af7 Change Node.js version in the workflow 2021-01-07 00:14:26 +05:30
1e119b6d1a Fix add_pdo_extension in linux.sh 2021-01-07 00:13:05 +05:30
77721f6637 Make sure tool path is always in PATH 2020-12-26 01:25:36 +05:30
d731e56579 Add support for macOS ARM 2020-12-26 01:25:30 +05:30
e5b90e33c6 Add support for coverage: xdebug2 2020-12-24 18:20:42 +05:30
849315646a Add support for brewed extensions on PHP 8.0 and 8.1 on macOS 2020-12-24 15:48:35 +05:30
d891a81b7f Fix add_brew_tap in darwin.sh
Fix shellcheck in darwin.sh
2020-12-24 03:34:39 +05:30
5098017251 Update js dependencies 2020-12-21 22:51:36 +05:30
2da85f306f Add support for specifying ICU version on PHP 8.0 2020-12-19 18:47:19 +05:30
1f94ad201f Improve symfony example workflows 2020-12-19 18:41:33 +05:30
862f206cd2 Merge pull request #377 from smoqadam/master
issue #376 - Install phpunit dependencies before runs the tests
2020-12-19 04:36:39 -08:00
81964ae791 issue #376 - Install phpunit dependencies before runs the tests 2020-12-19 20:18:12 +08:00
b7d1d9c9a9 Adjust $nightly_versions on linux 2020-12-18 22:45:12 +05:30
c5e4d55c3b Add devtools on self-hosted workflows 2020-12-18 22:40:16 +05:30
d74064b67a Fix setting xdebug.mode 2020-12-17 21:08:00 +05:30
8862a73fdd Update Pre-installed PHP in README 2020-12-17 19:03:15 +05:30
7b44f7e007 Fix couchbase on PHP 7.2 2020-12-17 16:29:01 +05:30
ff5499165a Set JIT related ini values on PHP 8 2020-12-17 14:02:00 +05:30
b3cd6b4dab Improve pecl support 2020-12-17 12:54:01 +05:30
ce02569aea Exit on failing to setup PHP 2020-12-17 04:43:16 +05:30
f1c04eb1eb Update sponsor logos 2020-12-15 16:22:21 +05:30
77aeac1761 Fix logging in add_pdo_extension in linux.sh 2020-12-14 22:33:39 +05:30
569522d50d Fetch homebrew taps manually 2020-12-14 19:34:32 +05:30
ea8be20255 Improve support for phive 2020-12-14 15:43:12 +05:30
d6f700217a Fix comments in extensions.ts 2020-12-14 15:42:58 +05:30
1015b3659d Add support for blackfire on PHP 8 2020-12-14 14:53:27 +05:30
03359ef1ab Improve README 2020-12-14 14:53:26 +05:30
fd9aae59b0 Add support for geos on unix 2020-12-14 14:53:19 +05:30
9af1e7006f Use shivammathur/extensions tap for imap and amqp on macOS 2020-12-03 15:01:13 +05:30
5efdcae81a Use brew for grpc_php_plugin on macOS 2020-12-02 10:09:22 +05:30
f0fb8731a5 Update ini files for all available SAPI 2020-12-02 05:50:56 +05:30
5a15252e66 Fix docs workflow 2020-12-01 08:48:41 +05:30
c0c6e403b6 Merge pull request #347 from shivammathur/develop
2.9.0
2020-11-28 15:08:28 +05:30
d0677c93b9 Bump version to 2.9.0 2020-11-28 15:08:27 +05:30
466908db61 Set 8.0 as the latest version 2020-11-28 15:08:26 +05:30
8dbd6b7684 Improve PECL support 2020-11-28 02:13:43 +05:30
5a40a5875d Fix xdebug setup
Co-authored-by: Owen Voke <development@voke.dev>
Co-authored-by: Shivam Mathur <shivam_jpr@hotmail.com>
2020-11-28 02:13:42 +05:30
790a41a722 Fix getting grpc latest tag 2020-11-28 02:13:41 +05:30
62c7ba2bee Improve darwin.sh 2020-11-28 02:13:36 +05:30
41797e3af9 Prioritize bintray over GitHub releases for scripts 2020-11-25 11:12:07 +05:30
c6150c6a2b Fix fail-fast in Windows 2020-11-25 05:39:44 +05:30
19b09596c6 Fix fetching extension version from PECL on macOS 2020-11-25 05:32:15 +05:30
4ec398d39a Fix deleting extensions 2020-11-25 05:23:27 +05:30
6bbaac9c49 Change description in actions.yml 2020-11-24 16:28:41 +05:30
012f269570 Improve README 2020-11-24 11:03:03 +05:30
09222f42ae Skip prestissimo and composer-prefetcher unless composer:v1 is specified 2020-11-21 11:11:33 +05:30
403191b6b6 Sync dependencies from tap in add_brew_extension 2020-11-21 10:54:39 +05:30
02cba443ad Merge pull request #337 from shivammathur/develop
2.8.0
2020-11-20 08:39:42 +05:30
31fa0d7883 Bump version to 2.8.0 2020-11-20 08:39:41 +05:30
f9caa0457d Update README 2020-11-20 08:39:40 +05:30
248394635c Fix grpc_php_plugin setup 2020-11-20 08:39:39 +05:30
a094f682be Add support for couchbase 2020-11-20 08:39:39 +05:30
45213ad923 Fix extension setup on self-hosted linux 2020-11-20 08:39:38 +05:30
385e3b6e96 Revert "Remove dashes from step ids"
This reverts commit 4d5f03db8a.
2020-11-20 08:39:37 +05:30
5453c1f4f0 Revert "Switch to apt-get"
This reverts commit 1394617d60.
2020-11-20 08:39:36 +05:30
787c534f64 Improve web requests 2020-11-20 08:39:35 +05:30
d812e938ac Refactor to dry unix scripts 2020-11-20 08:39:34 +05:30
7de94e6400 Fetch release with tool when latest one does not 2020-11-20 08:39:29 +05:30
68fbd80105 Add workflow to add default extensions on wiki 2020-11-02 04:47:28 +05:30
02445f719d Improve regexes for pre-release extensions 2020-10-31 21:20:49 +05:30
215b040f0d Fix contribution docs 2020-10-31 14:55:27 +05:30
925ede2589 Refactor composer setup 2020-10-30 19:25:39 +05:30
d1510a82d5 Merge pull request #321 from mlocati/composer-specific-version
Allow installing a specific Composer version
2020-10-30 17:46:45 +05:30
808e74aed5 Adjust filtered composer version 2020-10-30 12:02:36 +01:00
f51d00d350 Allow installing a specific Composer version 2020-10-30 11:15:26 +01:00
c8111b053c Fix blackfire-player to v1.9.3 for PHP 5.5 to PHP 7.0 2020-10-30 11:40:25 +05:30
294f03454a Install VcRedist from GitHub 2020-10-30 11:40:24 +05:30
5d27b8f90e Use PECL directly for nightly versions 2020-10-28 22:21:08 +05:30
87e62cbb7f Fix composer version for prestissimo & composer-prefetcher to v1 2020-10-25 00:55:01 +05:30
2c29e8b9a1 Fix version change if composer is a dependency 2020-10-24 23:40:43 +05:30
04a9e3b562 Update dependencies as per runner on macOS 2020-10-23 07:22:04 +05:30
4adaa73d25 Merge pull request #315 from GrahamCampbell/patch-1
PHP 8.1 supported too
2020-10-22 02:45:09 +05:30
234594684c PHP 8.1 supported too 2020-10-21 22:08:40 +01:00
3c0527bec1 Merge pull request #313 from shivammathur/develop
2.7.0
2020-10-19 18:26:33 +05:30
c5d41cd3f1 Bump version to 2.7.0 2020-10-19 17:39:36 +05:30
601cabfd2a Update README 2020-10-19 17:06:48 +05:30
81c750c6d7 Add support for imagick for PHP 5.6+ on macOS using shivammathur/homebrew-extensions 2020-10-19 15:55:40 +05:30
0661130e18 Add support for igbinary on macOS using shivammathur/homebrew-extensions 2020-10-18 19:41:59 +05:30
4244b92ac6 Fix matchers setup when action is called twice 2020-10-18 19:41:58 +05:30
e9595da9ac Remove patch for RLIMIT_CORE bug in sudo, fixed upstream 2020-10-18 19:41:57 +05:30
b77ec78d01 Add support for fail-fast env variable 2020-10-18 19:41:56 +05:30
96d8c1e901 Add support for PHP 8.1 on par with PHP 8.0 2020-10-18 19:41:55 +05:30
8816b6ff48 Add PHP 8.1 to the main workflow 2020-10-18 19:41:54 +05:30
9205a596c9 Add support for PHP 8.1 on Windows 2020-10-18 19:41:53 +05:30
6fc20c9b7f Add support for PHP 8.1 on Ubuntu 2020-10-18 19:41:52 +05:30
eb07280d5c Perform only one URL call to download latest PhpManager.zip asset 2020-10-18 19:41:51 +05:30
eaaab1cec3 Fix oci8 and pdo_oci 2020-10-18 19:33:03 +05:30
853381d0bb Merge pull request #310 from shivammathur/develop
Switch to apt-get
2020-10-15 14:16:50 +05:30
1394617d60 Switch to apt-get 2020-10-15 14:16:50 +05:30
093498a0a1 Merge pull request #307 from shivammathur/develop
Specify PHP version when installing ast
2020-10-15 14:16:49 +05:30
d2241010ef Specify PHP version when installing ast 2020-10-15 14:16:48 +05:30
a0f02c17c0 Merge pull request #304 from shivammathur/develop
Hotfix
2020-10-15 14:16:47 +05:30
bb5257e07d Update Node.js dependencies 2020-10-15 14:16:47 +05:30
f687ff8f21 Fix dependency mess in phalcon4 setup on ubuntu 2020-10-15 14:16:46 +05:30
537c66b2ea Minor fixes in scripts 2020-10-15 14:16:22 +05:30
073c2e666b Merge pull request #300 from shivammathur/develop
2.6.0
2020-10-15 14:16:21 +05:30
465e63b28c Bump version to 2.6.0 2020-10-15 14:16:21 +05:30
b8f0b066dc Add support for behat and phpspec 2020-10-15 14:16:20 +05:30
9e663851ce Move matchers setup to scripts 2020-10-15 14:16:19 +05:30
ad196941ed Refactor install.test.ts 2020-10-15 14:16:19 +05:30
f8e867a9ff Refactor install.ts 2020-10-15 14:16:18 +05:30
8cb01730c7 Prioritize with over env for inputs 2020-10-15 14:16:17 +05:30
ebba1db2c3 Add alias latest 2020-10-15 14:16:17 +05:30
716331904e Switch to environment files. Apply GHSA-mfwh-5m23-j46w (CVE-2020-15228) 2020-10-15 14:16:16 +05:30
2ad63ddbd3 Merge pull request #294 from shivammathur/dependabot/npm_and_yarn/actions/core-1.2.6
Bump @actions/core from 1.2.5 to 1.2.6
2020-10-15 14:16:15 +05:30
c4606c9269 Log versions in tools setup 2020-10-15 14:16:15 +05:30
7dcb43c768 Improve problem matchers section in README 2020-10-15 14:16:14 +05:30
691c5309aa Bump @actions/core from 1.2.5 to 1.2.6
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 14:16:13 +05:30
84b222366a Merge pull request #292 from szepeviktor/patch-1
PHPStan is GH Actions-friendly
2020-10-15 14:16:13 +05:30
b98ed88402 PHPStan is GH Actions-friendly
no need for cs2pr
2020-10-15 14:16:12 +05:30
0ca827ae3b Merge pull request #283 from shivammathur/develop
2.5.0
2020-10-15 14:16:11 +05:30
16b0a25bf6 Bump version to 2.5.0 2020-10-15 14:16:10 +05:30
fa0af5c382 Update README 2020-10-15 14:16:09 +05:30
db36b200b1 Fix regex in protoc.sh 2020-10-15 14:16:06 +05:30
7cfd76cc1b Move $arch_name to tools/blackfire.ps1 2020-10-15 14:16:05 +05:30
682b1f5e44 Make sure printf is in PATH in Windows 2020-10-15 14:16:04 +05:30
7b56e4491e Improving removing extensions for Ubuntu SH runners 2020-09-07 09:36:56 +05:30
acc1fdb337 Add support to configure icu version 2020-09-07 09:36:51 +05:30
e3286d1234 Fix cleanup_lists in linux.sh for old PHP 2020-09-06 19:29:39 +05:30
83019fade2 Merge pull request #279 from mlocati/win32/use-powershell-phpmanager-release-assets
Download release assets for PowerShell PhpManager
2020-09-06 19:29:38 +05:30
83b3d4a8f9 Merge pull request #278 from mlocati/win32/use-powershell-phpmanager-releases
Use releases instead of tags to download PowerShell PhpManager
2020-09-06 19:29:37 +05:30
56273e234f 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-06 19:29:37 +05:30
48a00b4d3f Use releases instead of tags to download PowerShell PhpManager
I just started to publish PhpManager to GitHub Releases too
2020-09-06 19:29:36 +05:30
f641885a8d Add support for phing 2020-09-06 19:29:35 +05:30
9457ce6e2b Replace fedora with valid platform name 2020-09-06 19:29:34 +05:30
a31f8b1a2b Remove unnecessary parameter version from addArchive 2020-09-06 19:29:34 +05:30
ffded4a3e8 Fix support for pecl pdo extensions on Ubuntu 2020-08-21 23:58:53 +05:30
9e6b9d7d70 Merge pull request #274 from shivammathur/develop
2.4.3
2020-08-18 10:12:49 +05:30
7d45057bba Bump version to 2.4.3 2020-08-18 09:58:32 +05:30
c4fd8b0739 Update README 2020-08-18 09:58:25 +05:30
49088ede98 Fix composer fallback 2020-08-18 09:58:23 +05:30
3543ed1ef8 Switch to fixed getcomposer.org links 2020-08-18 09:58:23 +05:30
9bd0fdbc18 Remove old PHPUnit on linux 2020-08-18 09:58:22 +05:30
c5d29cf8e3 Fix removing extensions on Ubuntu SH runners. (#271) 2020-08-12 17:10:23 +05:30
c5e0997b44 Merge pull request #270 from shivammathur/develop
2.4.2
2020-08-10 19:30:25 +05:30
ee084d3176 Bump version to 2.4.2 2020-08-10 19:30:25 +05:30
c256f0c9cb Update README 2020-08-10 19:30:19 +05:30
d84365cd03 Add support for oci extensions in PHP 8 on Windows
Fix cache support for oci8 on Windows
2020-08-10 14:08:28 +05:30
3c52e818b1 Add support for cubrid and pdo_cubrid on Ubuntu 2020-08-10 14:08:27 +05:30
188598ef9d Dry custom tools and extension code 2020-08-10 14:08:27 +05:30
f8b8d766d5 Fix permissions in protoc setup 2020-08-10 14:08:26 +05:30
15a6402865 Change cURL opts 2020-08-10 14:08:20 +05:30
91bd6b26c2 Use cached composer builds 2020-08-04 21:15:25 +05:30
9dae796baf Merge pull request #263 from shivammathur/develop
2.4.1
2020-08-03 15:35:31 +05:30
6d9aef83a3 Bump version to 2.4.1 2020-08-03 14:49:44 +05:30
bd5a0d94b6 Update README 2020-08-03 11:47:11 +05:30
5405f14867 Move blackfire setup to separate scripts 2020-08-03 11:47:11 +05:30
cb25b9c13a Add support for protoc and grpc_php_plugin 2020-08-03 11:47:10 +05:30
e63d25d41f Use blackfire API to get versions 2020-08-03 11:47:09 +05:30
2a7ae24c8e Dry extension code 2020-08-03 11:47:00 +05:30
e68a74a71c Limit swoole support to PHP 7.4 2020-08-02 19:09:48 +05:30
67152eb712 Accept PECL default parameters 2020-08-02 19:09:47 +05:30
83bdf158fa Fix coverage message in node workflow 2020-08-02 19:09:46 +05:30
5e240ab99f Use shivammathur/php-builder-windows for PHP 8 on Windows (#261) 2020-08-02 19:09:45 +05:30
0fae072f07 Refactor extensions.ts 2020-08-02 19:09:45 +05:30
e0561697dc Fail fast PCOV on unsupported PHP versions 2020-08-02 19:09:44 +05:30
3aa0f17b55 Remove obsolete pcov.sh 2020-08-02 19:09:43 +05:30
8b218279a3 Improve cURL use 2020-08-02 19:09:29 +05:30
90b6355bf0 Fix updating lists in phalcon setup on Ubuntu 2020-07-24 10:31:35 +05:30
84f23853b7 Use default packagist mirror for old PHP 2020-07-24 10:31:35 +05:30
a4001afbd6 Remove update_extension from linux.sh 2020-07-24 10:31:34 +05:30
cfbb105cb6 Use cached packages to install PHP 2020-07-24 10:31:28 +05:30
c549015370 Fix warning in cleanup_lists on first run on ubuntu-20.04 2020-07-21 18:27:07 +05:30
9e22b87414 Bump supported version in SECURITY.md 2020-07-21 16:12:05 +05:30
7961bc11b1 Merge pull request #260 from shivammathur/develop
2.4.0
2020-07-21 12:17:40 +05:30
87f807365d Bump version to 2.4.0 2020-07-21 06:29:35 +05:30
25d9bbc737 Update README and licensing information 2020-07-21 06:29:25 +05:30
d2f865c91a Remove phpbrew config 2020-07-20 00:36:06 +05:30
a13373a271 Merge pull request #259 from localheinz/fix/sort
Fix: Keep extensions and options sorted
2020-07-20 00:33:31 +05:30
a764546381 Fix: Keep extensions and options sorted 2020-07-19 20:51:42 +02:00
380b68048b Merge pull request #258 from localheinz/fix/typo
Fix: Typo
2020-07-20 00:15:05 +05:30
4dcf9cd2ab Fix: Typo 2020-07-19 20:41:16 +02:00
f3641e0c33 Merge pull request #257 from localheinz/feature/composer-unused
Enhancement: Add composer-unused/composer-unused as tool
2020-07-19 17:32:23 +05:30
d35633ec7a Merge branch 'develop' into feature/composer-unused 2020-07-19 17:32:00 +05:30
7eea3d82f6 Merge pull request #256 from localheinz/fix/sort
Fix: Keep list of tools sorted
2020-07-19 17:25:22 +05:30
57ecdba082 Fix: Keep list of tools sorted 2020-07-19 13:32:31 +02:00
db03758c66 Enhancement: Add composer-unused/composer-unused as tool 2020-07-19 13:13:08 +02:00
82837572d4 Add ionCube Loader support 2020-07-19 13:53:35 +05:30
8efcf46b31 Add support for oci8 and pdo_oci 2020-07-19 13:53:28 +05:30
4391cf8a4c Fix warning in add_pdo_extension 2020-07-19 13:53:26 +05:30
87a69f94d9 Merge pull request #255 from localheinz/feature/composer-require-checker
Enhancement: Add maglnet/ComposerRequireChecker as tool
2020-07-19 01:26:18 +05:30
c12fad850b Enhancement: Add maglnet/ComposerRequireChecker as tool 2020-07-19 01:26:18 +05:30
47b8d68850 Enhancement: Add ergebnis/composer-normalize as tool 2020-07-18 21:44:21 +05:30
530929f741 Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-18 21:44:19 +05:30
a965723128 Set memory_limit=-1 on Windows and macOS 2020-07-18 06:01:48 +05:30
9845a63f5c Merge pull request #249 from lolautruche/fix-blackfire
Remove sudo for Blackfire config when it's not needed
2020-07-16 02:28:34 +05:30
4af7e96d03 Remove sudo for Blackfire config when it's not needed 2020-07-15 17:01:29 +02:00
13a3d9d0a9 Fix support for pre-release extensions 2020-07-15 06:24:45 +05:30
9d042b2683 Patch OpenSSL binaries for PHP 5.3 and 5.4 on Windows 2020-07-14 06:27:29 +05:30
7a59874419 Improve updating lists 2020-07-12 05:20:08 +05:30
8dee767b82 Install only cli on linux 2020-07-11 23:00:50 +05:30
5fc5a95363 Fix coverage 2020-07-11 18:35:28 +05:30
8ba779d78e Merge pull request #244 from GrahamCampbell/patch-1
Fixed Xdebug version for PHP 5.6 and 7.0
2020-07-11 18:28:59 +05:30
04376074d2 Update extensions.test.ts 2020-07-11 12:57:07 +01:00
262202d43f Fixed xdebug version for PHP 5.6 and 7.0 2020-07-11 12:43:32 +01:00
f64dddeeb4 Show xdebug.mode=coverage log for Xdebug 3.0 2020-07-08 08:01:26 +05:30
1d50c4a8cd Set ini values after coverage setup 2020-07-08 07:45:11 +05:30
d313593fee Bump cache key 2020-07-08 06:44:18 +05:30
5753a00ef5 Improve composer setup 2020-07-08 05:20:52 +05:30
38731c6386 Merge pull request #242 from shivammathur/develop
Remove update_formulae in darwin.sh
2020-07-07 01:05:02 +05:30
9f400a0dfd Update dependencies 2020-07-07 00:52:10 +05:30
ba020e3463 Remove update_formulae in darwin.sh 2020-07-07 00:33:30 +05:30
c0d425d939 Merge pull request #240 from shivammathur/develop
2.3.2
2020-07-04 02:49:52 +05:30
4752a51595 Bump version to 2.3.2 2020-07-04 00:31:45 +05:30
10608f5908 Add ondrej's PPA on focal (actions/virtual-environments#1104) 2020-07-02 21:29:52 +05:30
d01ec214f2 Use shivammathur/extensions tap for grpc, swoole, protobuf on macos 2020-07-01 13:56:05 +05:30
6158538131 Add support for phplint 2020-06-24 04:30:50 +05:30
dd27d4eb81 Merge pull request #235 from shivammathur/develop
2.3.1
2020-06-22 07:33:24 +05:30
248d04f73c Bump version to 2.3.1 2020-06-22 07:33:18 +05:30
c5e40d9067 Fix Xdebug coverage 2020-06-22 07:33:17 +05:30
e0ed1ad0ef Remove --no-suggest flag in examples 2020-06-22 07:33:16 +05:30
2907f8a584 Remove dashes from step ids 2020-06-22 07:33:15 +05:30
52691651dc Add support for Xdebug3 on stable PHP 2020-06-22 07:33:14 +05:30
b9404683e1 Improve extension support 2020-06-22 07:33:08 +05:30
70954fb6f8 Merge pull request #232 from shivammathur/develop
2.3.0
2020-06-11 16:10:15 +05:30
65e65163cd Bump version to 2.3.0 2020-06-11 16:10:14 +05:30
41397ce45e Update docs 2020-06-11 16:10:09 +05:30
c09954033f Fix exit log on self-hosted 2020-06-09 08:46:21 +05:30
7cec1987ac Improve setup on self-hosted windows 2020-06-09 08:46:16 +05:30
739e40fb5e Add support for updating composer 2020-06-05 12:25:02 +05:30
9dec5892e7 Specify runner to the PHP 8.0 script 2020-06-05 12:24:51 +05:30
94616818f0 Fix blackfire-agent setup 2020-06-04 08:40:46 +05:30
4f0d9003dc Add Ubuntu 20.04 to CI 2020-06-04 08:40:45 +05:30
b2edfc47dd Move WA for sudo to self_hosted_setup in linux.sh 2020-06-04 08:40:39 +05:30
6bd872ad2c Fix composer peer fingerprint error for old PHP 2020-06-03 01:56:43 +05:30
03eb8cc744 Update actions/cache uses to v2 2020-06-03 01:56:43 +05:30
9687dd1d8a Fetch scripts for old PHP and nightly 2020-06-03 01:56:42 +05:30
2df0d2b443 Refactor scripts and improve comments 2020-06-03 01:56:37 +05:30
0e56c0b653 Add WA for setrlimit warning with sudo in focal 2020-05-27 09:29:35 +05:30
0469a6f681 Fix setup on self-hosted linux 2020-05-27 08:57:17 +05:30
325413a824 Use Invoke-RestMethod to get tag 2020-05-27 08:02:21 +05:30
b84dd3ce25 Remove empty line in logs 2020-05-26 06:41:18 +05:30
190220c10d Create ini file using tee instead of touch 2020-05-22 15:46:30 +05:30
4fb049a68b Merge pull request #225 from shivammathur/develop
2.2.2
2020-05-22 03:46:01 +05:30
3e0678b50f Bump version to 2.2.2 2020-05-22 02:50:45 +05:30
5b06192e7c Improve install.ts tests 2020-05-22 02:50:38 +05:30
b419442896 Remove extra newline 2020-05-21 23:33:27 +05:30
49b8b7e301 Update README 2020-05-21 20:43:35 +05:30
b1776b79c8 Add support for phan/phan 2020-05-21 11:28:38 +05:30
a48ff666f8 Bump version to 2.2.1 2020-05-19 01:18:32 +05:30
3bffbad95a Update libs for PHP 8.0 on self-hosted runners 2020-05-18 23:50:49 +05:30
18041fdab5 Setup libwebp-dev with PHP8 on linux 2020-05-18 22:44:26 +05:30
b36d2222e6 Update PPA before phalcon setup 2020-05-18 17:55:48 +05:30
50ffa593bb Update PPA in add_devtools in linux.sh 2020-05-18 17:25:38 +05:30
6cbc46fdb6 Fix sqlite logs 2020-05-17 11:37:27 +05:30
08c60fceea Fix to use correct $php_dir 2020-05-17 04:16:39 +05:30
c30a9630bb Housekeeping 2020-05-16 11:28:01 +05:30
0158fe2782 Fix enabling pdo extension 2020-05-16 00:04:19 +05:30
3a8557bcc6 Merge pull request #219 from shivammathur/develop
2.2.0
2020-05-13 23:15:10 +05:30
d10d1e249b Bump version to 2.2.0 2020-05-13 07:12:42 +05:30
3ec1728de8 Update README 2020-05-13 05:39:40 +05:30
9c266d4158 Fix username hardcode in composer PATH 2020-05-12 19:32:10 +05:30
0135ee2ed1 Fix support for phalcon and gearman 2020-05-12 19:32:07 +05:30
5c2618165a Fetch blackfire latest versions 2020-05-12 19:32:03 +05:30
8123132b99 Add support for removing extensions 2020-05-12 19:32:01 +05:30
f5863fd356 Add support for vapor-cli and infection tools 2020-05-12 19:31:58 +05:30
cf0fdf35f2 Add composer global bin directory to PATH 2020-05-12 19:31:53 +05:30
8830cdd08c Add support for self-hosted darwin runners 2020-05-12 19:31:50 +05:30
4960e3179f Add support for self-hosted windows runners 2020-05-12 19:31:39 +05:30
0f3f604249 Add support for self-hosted ubuntu runners 2020-05-10 04:40:21 +05:30
5915f05b06 Suppress php-config error 2020-05-05 15:26:16 +05:30
dccdb5ab67 Fix loading PECL extensions 2020-05-05 14:44:56 +05:30
9a01fd28ca Fix icu4c version for PHP 5.6 and PHP 7.0 on darwin 2020-04-30 17:02:17 +05:30
d5cd6a4bd1 Fix libzip-dev error in PHP 8.0 on ubuntu 2020-04-30 07:31:41 +05:30
006301e81d Fetch formulae before setup 2020-04-23 16:29:33 +05:30
4a38014043 Merge pull request #212 from shivammathur/develop
2.1.4
2020-04-09 23:54:04 +05:30
a0ac655b06 Bump version to 2.1.4 2020-04-09 23:19:56 +05:30
41e56c42c7 Update README 2020-04-09 23:19:55 +05:30
4e8a0cfe8b Update workflow 2020-04-09 21:58:34 +05:30
ee72f2f8ad Recompile PCOV for PHP8.0 2020-04-09 21:48:22 +05:30
ed557fd2c3 Add support for ast and uopz ubuntu packages 2020-03-30 13:50:20 +05:30
d90cd153ee Refactor PHP setup on linux 2020-03-28 12:49:55 +05:30
3376371dd8 Bump minimum Xdebug version 2020-03-28 09:42:02 +05:30
a2b261d79a Add support to configure GitHub OAuth token in composer 2020-03-25 07:44:38 +05:30
6c93dbd391 cleanup 2020-03-25 07:31:36 +05:30
f58dc6eca1 Update all lists 2020-03-20 19:09:27 +05:30
5326f2302f Merge pull request #203 from shivammathur/develop
2.1.3
2020-03-18 16:26:15 +05:30
b9a78a31fb Bump version to 2.1.3 2020-03-18 16:26:11 +05:30
ba69b25cab Install PhpManager from GitHub repo 2020-03-18 16:26:01 +05:30
a6533acdd4 Update FUNDING.yml 2020-03-18 13:09:15 +05:30
d3b37e3d0d Add SECURITY.md 2020-03-18 13:09:07 +05:30
f3a1262ff6 Fix db extensions 2020-03-16 08:13:25 +05:30
933abd531a Merge pull request #201 from shivammathur/develop
2.1.2
2020-03-14 15:29:33 +05:30
67ed7f234b Bump version to 2.1.2 2020-03-14 15:04:10 +05:30
f90accffb3 Change case in README 2020-03-14 14:58:34 +05:30
93441b70bf [Security] Bump acorn from 6.4.0 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. **This update includes a security fix.**
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-14 14:58:18 +05:30
67f23b6380 Improve code quality 2020-03-14 14:57:21 +05:30
2937ad6e7a Improve extension support 2020-03-14 14:55:28 +05:30
a5e5d07fcb Merge pull request #199 from shivammathur/develop
2.1.1
2020-03-14 14:48:42 +05:30
30d8b321f4 Bump version to 2.1.1 2020-03-14 14:48:27 +05:30
405e57e429 Switch to macports based builds for old PHP on darwin 2020-03-08 08:10:10 +05:30
58f376b118 Fix caching PDO extensions on linux 2020-03-07 17:00:39 +05:30
b7d68d8225 Merge pull request #196 from shivammathur/develop
Hotfix 2.1.0
2020-03-02 20:11:17 +05:30
9252820289 Fix logs of blackfire setup 2020-03-02 19:56:53 +05:30
a5cc9fab25 Merge pull request #195 from shivammathur/develop
2.1.0
2020-02-29 22:30:50 +05:30
4e5685a75d Bump version to 2.1.0 2020-02-29 21:38:22 +05:30
d475227ba5 Improve README 2020-02-29 21:38:22 +05:30
38cb8b924d Use shivammathur/php5-darwin for PHP5 on darwin 2020-02-29 01:17:20 +05:30
fdd83e94df Update tools in README 2020-02-29 00:26:00 +05:30
ad112b7981 Fix support for symfony/flex 2020-02-28 16:51:00 +05:30
2b0d6e221f Improve blackfire examples 2020-02-28 15:42:17 +05:30
acee5b203f Add support for blackfire client, agent and player 2020-02-28 14:43:57 +05:30
84e88e382f Fix and refactor ext-blackfire 2020-02-27 19:27:11 +05:30
bbdc4e3b67 Merge pull request #193 from jaapio/feature/ext-blackfire
🎉 Add blackfire extenstion
2020-02-27 15:50:29 +05:30
311eb9f3ba Add example 2020-02-27 11:12:57 +01:00
3dfd7a648b Add blackfire support on windows 2020-02-27 11:12:56 +01:00
943f491830 Add blackfire on OSX 2020-02-27 11:12:52 +01:00
dc9461a053 Add blackfire to linux install
Add logging about install process

Fix formating of semversion blackfire

Only add version when needed

Pass phpversion
2020-02-27 10:38:52 +01:00
f2720d7b82 Update examples to start mysql service 2020-02-26 22:15:27 +05:30
99161b7790 Add perimission for composer self-update 2020-02-25 23:01:49 +05:30
5de6285e1f Fix composer version 2020-02-25 22:05:48 +05:30
14d702e830 Fix test name 2020-02-25 17:58:15 +05:30
9539b27b4a Add symfony/flex to supported tools 2020-02-25 10:00:07 +05:30
a4f7326577 Move dependency setup to cache-extensions 2020-02-25 09:38:53 +05:30
9b297384e1 Fix versioned extensions 2020-02-24 21:14:54 +05:30
9d77946f60 Switch to liip for old PHP on darwin 2020-02-24 20:24:08 +05:30
6d21e6dc05 Revert instllaing libicu64 2020-02-23 01:46:35 +05:30
68c827cfcf Fix wp-cli support 2020-02-23 01:19:07 +05:30
d95ca49e8d WP-CLI tool support added 2020-02-23 01:18:24 +05:30
03fd0b8719 Merge pull request #190 from shivammathur/develop
Hotfix: Force install libicu64 for PHP 8.0
2020-02-23 00:43:53 +05:30
ebe1c12c21 Hotfix: Force install libicu64 for PHP 8.0 2020-02-23 00:28:35 +05:30
b46021d870 Merge pull request #186 from shivammathur/develop
Update ppa before installing PHP
2020-02-22 00:30:07 +05:30
64ba54fc1b Hotfix: Force update ppa 2020-02-22 00:16:22 +05:30
71571f685a Merge pull request #185 from shivammathur/develop
2.0.2
2020-02-21 14:19:53 +05:30
10f86cb1a1 Bump version to 2.0.2 2020-02-21 14:06:08 +05:30
0f694c5087 Update README 2020-02-21 14:06:08 +05:30
9dfebd1adb Refactor scripts 2020-02-21 11:33:58 +05:30
3781acab4b Fix link in README 2020-02-20 04:15:24 +05:30
cdfbf6d0f0 Merge pull request #184 from shivammathur/develop
2.0.1
2020-02-19 09:08:04 +05:30
0ccb02802f Bump version to 2.0.1 2020-02-19 08:50:15 +05:30
a4572586dc Fix linux.sh 2020-02-19 07:22:01 +05:30
cb3c752d1f Remove update input, it is env 2020-02-17 15:50:44 +05:30
383a511d0e Merge pull request #177 from shivammathur/develop
2.0.0
2020-02-17 04:40:05 +05:30
cc55dbcaa8 Remove support for deprecated inputs 2020-02-17 02:35:18 +05:30
e644692ccf Update test workflow 2020-02-17 01:15:15 +05:30
96d5358317 Bump version to 2.0.0 2020-02-17 01:14:18 +05:30
3a473c9a22 Add support for unstable versions 2020-02-16 07:04:15 +05:30
40944de129 Fix phalcon caching on darwin 2020-02-15 23:46:26 +05:30
f9202d6b64 Support existing PHP on darwin 2020-02-14 16:52:33 +05:30
d99c8732ba Fix extension_version on windows 2020-02-14 15:48:43 +05:30
2c559eae3d Update documentation for v2 2020-02-14 13:35:04 +05:30
3a2ca44a8a Add problem matcher for PHP native errors 2020-02-14 12:55:54 +05:30
17241e2689 Add support for update and extension versions 2020-02-14 12:55:04 +05:30
ca33d01e9f Add support for old PHP versions on linux 2020-02-13 10:31:48 +05:30
3c6644f237 Add support for old PHP versions on windows 2020-02-06 05:54:20 +05:30
326dfd1e76 Add support for old PHP versions on darwin 2020-02-06 05:53:28 +05:30
d9cf6f5ad6 Merge pull request #173 from shivammathur/develop
1.8.2
2020-02-03 04:26:49 +05:30
ea50c7c0a2 Bump version to 1.8.2 2020-02-03 04:07:28 +05:30
6ca549dcaa Update readme 2020-02-03 03:48:07 +05:30
d3760be2cc Add support for cs2pr and refactor tools code 2020-02-03 02:28:00 +05:30
3454287b87 Improve phalcon scripts 2020-02-02 18:29:12 +05:30
88c7757dc8 Add dependencies when enabling extensions in linux 2020-02-02 12:58:32 +05:30
48cfea3f3e Add script to help cache extensions 2020-02-02 04:30:01 +05:30
43cfa2b1a8 Refactor scripts 2020-02-02 03:26:15 +05:30
76cecacc5e Merge pull request #168 from shivammathur/develop
1.8.1
2020-01-27 22:39:10 +05:30
d6e173ffc6 Fix pecl command in linux 2020-01-27 21:32:49 +05:30
26701f2ec8 Bump version to 1.8.1 2020-01-27 21:24:08 +05:30
e934fe28b8 Fix PECL config 2020-01-27 21:09:51 +05:30
d384d9fe7e Merge pull request #167 from shivammathur/develop
1.8.0
2020-01-26 18:21:58 +05:30
4eeaf5f99e Handle extensions input typo 2020-01-26 18:05:27 +05:30
fd2392db56 Fix check for testing tools setup 2020-01-26 17:21:04 +05:30
494dde7189 Bump version to 1.8.0 2020-01-26 16:25:58 +05:30
706dfca1e6 Add lint to pre-commit hook 2020-01-26 16:21:25 +05:30
d613c975f6 Fix lowercasing of coverage driver 2020-01-26 16:15:39 +05:30
fbe1419ce4 Update Readme for 1.8.0 2020-01-26 16:04:18 +05:30
c844c7b6e4 Add support for symfony in tools input 2020-01-26 12:06:55 +05:30
8e5cc09df9 Fix PHPUnit problem matchers 2020-01-26 04:59:20 +05:30
f4f8aec1f2 Fix php.ini permissions after extension setup 2020-01-26 03:23:41 +05:30
b44b7344e0 Add support for pre-release pecl extensions 2020-01-26 02:27:40 +05:30
e01b2f0bf7 Merge pull request #157 from shivammathur/develop
Fix description in actions.yml
2020-01-22 02:20:27 +05:30
f7f8ecb931 Fix description in actions.yml 2020-01-22 01:54:16 +05:30
4f0d810cbc Merge pull request #156 from shivammathur/develop
1.7.4
2020-01-22 01:48:36 +05:30
47335179aa Bump version to 1.7.4 2020-01-22 01:13:19 +05:30
63c4aea452 Refactor scripts to enable pre-existing ext-phalcon 2020-01-21 19:53:17 +05:30
898b6fa1f9 macOS-latest -> macos-latest 2020-01-21 08:25:14 +05:30
747c8838bc Add phive and ts support to readme 2020-01-21 08:24:33 +05:30
9d6b61c5af Add support for phive 2020-01-21 07:21:36 +05:30
5108c81610 Add support for ext-imagick on darwin 2020-01-21 01:06:31 +05:30
e58c704985 Use ppa:ondrej/php for phalcon4 on PHP7.4 2020-01-21 00:50:38 +05:30
e9c783eef0 Add support for specifying nts/ts builds on windows 2020-01-21 00:44:53 +05:30
b44e5e009f Use ppa:ondrej/php for phalcon except for PHP7.4 2020-01-20 21:07:51 +05:30
8489dbf4de Merge pull request #152 from shivammathur/develop
1.7.3
2020-01-17 17:16:16 +05:30
f23ae2e6f7 Fix xdebug and phalcon logs on linux 2020-01-17 16:53:12 +05:30
d2b233e45f Bump version to 1.7.3 2020-01-17 13:45:04 +05:30
320474a245 Add support for phpize and php-config 2020-01-17 13:21:39 +05:30
65ccfb36dc Fix extensions.ts 2020-01-17 06:07:33 +05:30
88fb99b592 Fix logs on windows for pre-installed version 2020-01-16 10:16:44 +05:30
9e7bc5c91f Fix phalcon.ps1 2020-01-16 09:23:04 +05:30
ca2f547a35 Fix log for composer on darwin 2020-01-16 09:06:55 +05:30
9f21c80d24 Install phalcon v4 from PECL on windows 2020-01-16 09:04:43 +05:30
c4317135df Disable composer process-timeout 2020-01-14 12:06:52 +05:30
a2dd688679 Improve test workflows 2020-01-14 11:42:08 +05:30
bd214a2dca Update old Xdebug version for coverage: xdebug 2020-01-14 11:02:17 +05:30
2ee4653d1c Merge pull request #145 from shivammathur/develop
Improve remove_extensions in linux
2020-01-10 07:10:05 +05:30
0b3e0f451d Bump version to 1.7.2 2020-01-10 06:50:19 +05:30
0bfa897634 Improve remove_extensions in linux 2020-01-10 06:30:41 +05:30
71db1e2cf1 Merge pull request #144 from shivammathur/develop
1.7.1
2020-01-09 03:56:18 +05:30
16d1cd4766 Sort tools in README 2020-01-09 03:45:19 +05:30
1193cd100b Bump version to 1.7.1 2020-01-09 03:28:45 +05:30
e839a77d8c Update default packages in linux 2020-01-08 22:07:21 +05:30
552df3f2b0 Add CakePHP examples with services 2020-01-08 12:58:21 +05:30
3109c941eb Update examples 2020-01-08 11:35:32 +05:30
aa8706a5bf Update warnings in actions.yml 2020-01-08 11:12:36 +05:30
9afdee42e8 Add support to specify version of tools 2020-01-08 10:45:30 +05:30
aa0e9403d8 Merge pull request #138 from PrisisForks/feature/automatic-composer-prefetcher
narrowspark/automatic-composer-prefetcher as a alternative to prestissimo
2020-01-04 13:04:02 +05:30
5b00f068f3 feat : narrowspark/automatic-composer-prefetcher as a alternative to prestissimo 2020-01-04 07:39:39 +01:00
8f39d3eddd Add CakePHP example 2020-01-03 08:25:42 +05:30
9d87d1fd14 Update LICENSE 2020-01-01 22:38:51 +05:30
07ae2343d0 Update actions/checkout to v2 2020-01-01 22:36:25 +05:30
7b8bf7af6a Merge pull request #134 from shivammathur/develop
1.7.0 Hotfix
2020-01-01 16:22:07 +05:30
0ac6f76d36 Fix setup order 2020-01-01 16:05:01 +05:30
6c6203b683 Improve ext-phalcon linux script and readme 2019-12-31 13:47:06 +05:30
0c9f8a8e7e Merge pull request #133 from shivammathur/develop
1.7.0
2019-12-31 06:54:06 +05:30
1705daea72 Bump version to 1.7.0 2019-12-31 06:30:11 +05:30
58fbc33c3a Use tap shivammathur/homebrew-phalcon on darwin 2019-12-31 05:49:48 +05:30
3f42b7d5fb Link tools installed using composer 2019-12-31 05:20:47 +05:30
dd4f0db7bf Update to latest version on windows. Fixes #132 2019-12-29 00:38:06 +05:30
7d026bfa6b Update symfony examples 2019-12-28 02:18:01 +05:30
6a70f864ec Improve tools support 2019-12-28 01:03:57 +05:30
8e1cde2d0a Improve examples and documentation 2019-12-28 00:23:51 +05:30
de32d8b95f Add tools support 2019-12-27 13:11:17 +05:30
273096b82f Refactor coverage and extension code 2019-12-26 20:21:39 +05:30
4c045616f4 Improve support for ext-phalcon and refactor extensions.ts 2019-12-25 03:47:26 +05:30
935e74fb40 Refactor scripts and fix reading php-version 2019-12-22 10:19:53 +05:30
a507be73b5 Merge pull request #127 from shivammathur/develop
Hotfix to support phalcon after v4 release
2019-12-22 10:02:11 +05:30
673dcaff6d Hotfix after phalcon4 release 2019-12-22 09:30:28 +05:30
2cbfd4fb41 Update extensions.ts
Phalcon 4.0.0 is released and now in the master.
2019-12-22 07:47:17 +05:30
0969980399 Merge pull request #125 from shivammathur/develop
Remove coverage drivers completely if requested
2019-12-20 15:04:11 +05:30
1fa2905bc6 Remove coverage drivers completely if requested 2019-12-20 14:32:47 +05:30
790a48c30d Merge pull request #124 from shivammathur/develop
1.6.2
2019-12-20 11:29:34 +05:30
4b69160eff Merge pull request #122 from svenluijten/patch-1
Fix year in comment above deprecated options
2019-12-19 15:55:35 +05:30
7f805f22af Fix year in comment above deprecated options 2019-12-19 10:40:58 +01:00
f2972dcf18 Fix enabling zend extensions 2019-12-19 11:33:35 +05:30
2d488f53fd Bump version to 1.6.2 2019-12-19 10:45:29 +05:30
421187c870 Fix experimental workflow 2019-12-19 10:45:08 +05:30
1798f4d615 Fix matchers and add tests 2019-12-19 10:44:43 +05:30
8039546df3 Merge pull request #84 from decnorton/develop
Add problem matcher for PHPUnit
2019-12-19 02:18:02 +05:30
c6ad3d1a70 Add 8.0 support on windows 2019-12-19 00:23:32 +05:30
922f1e27b8 Set ProgressPreference to Silent in win32.ps1 2019-12-18 18:52:46 +05:30
2d3750b36e Install 64bit version of PHP on windows 2019-12-18 18:42:55 +05:30
51c7527bd8 Merge pull request #121 from shivammathur/develop
Fix add_extension on linux and macOS
2019-12-17 04:28:05 +05:30
2bf7ab0207 Fix add_extension on linux and macOS 2019-12-16 19:40:50 +05:30
b3a84fc51e Merge pull request #119 from shivammathur/develop
1.6.1
2019-12-15 02:28:01 +05:30
1330950cd5 Bump version to 1.6.1 2019-12-15 02:09:03 +05:30
afb57fca4e Merge pull request #118 from svenluijten/patch-1
Fix typo in available options
2019-12-15 01:27:07 +05:30
50344f4883 Fix typo in available options
`extension` should actually be `extensions`.
2019-12-14 14:53:04 +01:00
2b027bd9bc Fix reading unquoted versions 2019-12-14 10:13:01 +05:30
8f8207a1ca Add support for ext-gearman. Closes #116 2019-12-14 09:21:11 +05:30
87e6c70743 Update PEAR channel after installation 2019-12-10 05:34:26 +05:30
e3d18718a9 Update dependencies 2019-12-10 05:22:33 +05:30
cfa7bc51cd Merge pull request #106 from shivammathur/develop
Fix coverage log for Xdebug on PHP 8.0
2019-12-09 15:30:42 +05:30
ade633f0da Fix coverage log for Xdebug on PHP 8.0 2019-12-09 14:58:42 +05:30
2cabcf2941 Merge pull request #105 from shivammathur/develop
1.6.0
2019-12-09 14:00:34 +05:30
9ce4bd6f1b Fix logs on linux 2019-12-09 13:17:02 +05:30
190ae49ac1 Improve README 2019-12-09 12:45:26 +05:30
032bc86056 Fix actions.yml 2019-12-09 12:32:55 +05:30
704c5180a4 Update examples 2019-12-09 12:20:03 +05:30
e4fc767f9c Deprecate extension-csv and ini-values-csv inputs 2019-12-09 11:14:07 +05:30
1cf6a369bb Add support for PHP 8.0.0-dev #104 2019-12-09 10:31:11 +05:30
14acb26bdc Merge pull request #103 from shivammathur/develop
1.5.8
2019-12-06 09:30:32 +05:30
3ff7f9cedc Bump version to 1.5.8 2019-12-06 09:13:56 +05:30
98e937751c Merge branch 'develop' of https://github.com/shivammathur/setup-php into develop 2019-12-06 09:11:34 +05:30
31b338b199 Install PCOV from pecl for PHP7.4 on windows 2019-12-06 09:10:20 +05:30
9e32964a24 Merge pull request #102 from shivammathur/dependabot/npm_and_yarn/develop/typescript-3.7.3
Bump typescript from 3.7.2 to 3.7.3
2019-12-05 04:57:13 +05:30
4dcf2b117f Bump typescript from 3.7.2 to 3.7.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.7.2 to 3.7.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.7.2...v3.7.3)

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

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

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

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

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 18:54:44 +00:00
914c51cfb6 Fix ext-redis 2019-12-03 00:12:29 +05:30
8d8c2bd524 Use shivammathur/homebrew-php for macOS 2019-12-02 17:24:50 +05:30
7ef437ee9d Update pre-commit hook 2019-12-02 07:00:41 +05:30
0871fbb11b Update action.yml 2019-11-30 23:30:48 +05:30
3039a720ed Merge pull request #95 from shivammathur/develop
1.5.6
2019-11-30 07:11:14 +05:30
7f32ab318e Show semantic versions on PHP install and correct logs 2019-11-30 06:57:39 +05:30
ddcacf4760 Improve readme and workflow 2019-11-30 05:30:17 +05:30
2f951ef5cd Use Homebrew for PHP 7.4 on macOS 2019-11-30 04:59:05 +05:30
5a081357b4 Merge pull request #94 from shivammathur/develop
Fix phpdbg and improve windows script.
2019-11-29 12:10:41 +05:30
c4a64dff61 Install phpdbg with PHP7.4 2019-11-29 11:41:25 +05:30
aad33a8e35 Update Update-PhpCAInfo command in win32.ps1 2019-11-29 10:52:07 +05:30
eae890b1b2 Fix phpdbg version 2019-11-29 10:14:53 +05:30
8fbd2ea6bb Merge pull request #92 from shivammathur/develop
Switch to v1 tag and stable PHP 7.4.0
2019-11-28 16:47:42 +05:30
46161660dc Bump to 7.4.0 stable on linux 2019-11-28 15:58:33 +05:30
de68427afb Bump to 7.4.0 stable on windows and macOS 2019-11-28 15:54:15 +05:30
4ba36c5432 Shift to rotating stable tags 2019-11-28 05:17:56 +05:30
99e2d8d309 Merge pull request #90 from shivammathur/develop
Fix PHP-FPM in PHP and add a flag to skip checksum check if it fails
2019-11-27 23:56:05 +05:30
929f9cd52d Add flag to skip checksum if it fails 2019-11-27 23:43:04 +05:30
4dba50d3af Fix php-fpm on linux in PHP 5.6 and 7.0 2019-11-27 21:56:29 +05:30
1c258f399f Merge pull request #89 from shivammathur/develop
1.5.5
2019-11-27 21:05:36 +05:30
e05bc317ec Fix README 2019-11-27 20:55:51 +05:30
44815f1f73 Fix workflow and bump version 2019-11-27 20:44:27 +05:30
22f5ad47d2 Handle exception in Update-PhpCAInfo in win32.ps1 2019-11-27 20:36:58 +05:30
a29956826a Edit README and workflow 2019-11-27 20:26:36 +05:30
c11d023c03 Add sage and bedrock example, add cache to examples 2019-11-27 06:00:34 +05:30
cade5f7157 Merge pull request #87 from shivammathur/develop
1.5.4
2019-11-26 12:24:58 +05:30
7964656607 Improve templates 2019-11-25 22:06:40 +05:30
970e2d5ebb Add pre-commit hook to create release 2019-11-25 21:58:24 +05:30
5b09e1195e Change log message 2019-11-25 21:55:52 +05:30
6fdecd40be Disable es-lint check @typescript-eslint/no-unused-vars 2019-11-25 21:41:39 +05:30
159a09794e Merge pull request #86 from mlocati/improve-win32
Simplify win32 script
2019-11-25 21:35:52 +05:30
0be846de83 Install the stable release of xdebug even on PHP 7.4RC 2019-11-25 16:35:11 +01:00
981c662f5d Minor change to trigger build 2019-11-25 14:56:31 +01:00
71c631cffb Fix installing xdebug with PHP 7.4 on Windows 2019-11-25 14:03:28 +01:00
47387dd6e9 Use the curl CA list if PKI Powershell Module is not available 2019-11-25 12:33:52 +01:00
fec9df11d6 Simplify win32 script
- Always specify the PHP install dir
- Use default PhpManager functions
- Fix CA Authorities (so that HTTPS calls work)
- Don't handle the special xdebug case (it's bundled in PhpManager)
2019-11-25 12:19:22 +01:00
03f36220f4 Add PHPUnit problem matcher 2019-11-24 16:35:21 +00:00
1db0b0651d Ship with @zeit/ncc 2019-11-24 05:17:35 +05:30
3f6c88dec7 Improve workflow and lint the code 2019-11-24 02:38:52 +05:30
2b938d931a Merge pull request #82 from shivammathur/develop
Improve workflows and documentation
2019-11-22 01:59:30 +05:30
71bd88f604 Combine workflows into one 2019-11-22 01:16:07 +05:30
242082a22f Update workflows and README, bump version 2019-11-22 01:13:20 +05:30
b9db11a072 Merge pull request #81 from shivammathur/develop
Fix check for existing extensions on windows
2019-11-15 21:00:02 +05:30
f381d2384c Fix check for existing extensions on windows 2019-11-15 20:36:50 +05:30
63d8fa1a9e Merge pull request #79 from shivammathur/develop
Bump PHP7.4 version on windows and macOS
2019-11-15 06:20:14 +05:30
dd1c34be39 Bump PHP7.4 version on windows and macOS 2019-11-15 05:24:58 +05:30
1eb8e8f5cd Merge pull request #78 from shivammathur/develop
1.5.1
2019-11-13 07:02:47 +05:30
0000679cbb Bump version to 1.5.1 2019-11-13 06:48:35 +05:30
7c5f2ab8e9 Fix extensions with PDO prefix 2019-11-13 06:29:58 +05:30
9d5e8ddc70 Update cache dependencies section after fix 2019-11-13 06:14:04 +05:30
77bc79bd22 Merge pull request #76 from shivammathur/develop
Edit extension installation, update cache yml
2019-11-08 16:16:49 +05:30
02c5ec11cc Use runner context in cache yml 2019-11-08 16:00:22 +05:30
d2e09be6ce Edit extensions installation on PHP7.4 2019-11-07 23:22:34 +05:30
013ddc75a3 Merge pull request #75 from shivammathur/develop
Fix matrix usage yml
2019-11-07 15:11:34 +05:30
25abc4c776 Fix matrix usage yml 2019-11-07 15:02:05 +05:30
4000f65b59 Merge pull request #74 from shivammathur/develop
Add PECL support on Linux
2019-11-07 14:47:29 +05:30
e14155415a Add PECL support on linux 2019-11-07 14:35:31 +05:30
9f16995a6f Merge pull request #73 from shivammathur/develop
Update OS/virtual environments available
2019-11-07 02:35:55 +05:30
24ecbee4ea Update OS/virtual environments available 2019-11-07 02:24:12 +05:30
c71102b8a0 Merge pull request #72 from shivammathur/develop
Revert to apt for extensions
2019-11-07 02:00:57 +05:30
0815f5a8bb Revert to apt for extensions 2019-11-07 01:31:01 +05:30
e5076cee70 Merge pull request #70 from shivammathur/develop
Update cache dependencies section in README
2019-11-05 05:24:16 +05:30
bd85a2a227 Update cache dependencies section 2019-11-05 05:07:46 +05:30
976fb6996a Merge pull request #69 from shivammathur/develop
Improve documentation and workflows.
2019-11-03 10:48:58 +05:30
06e916db9d Improve documentation 2019-11-03 10:28:43 +05:30
46ac6f2211 Cache node_modules in workflows 2019-11-03 08:40:57 +05:30
47d1da0476 Merge pull request #68 from shivammathur/develop
1.4.6
2019-11-02 19:52:52 +05:30
dfabf8ce29 Update ppa:ondrej/php before install 2019-11-02 18:50:10 +05:30
9304663cff Bump version to 1.4.6 2019-11-02 17:44:32 +05:30
878561f9a8 Bump to PHP7.4RC5 on darwin and windows 2019-11-01 05:06:33 +05:30
9550c7aa45 Bump xdebug version for PHP7.4 on windows 2019-10-31 15:00:51 +05:30
ebeb82f894 Add PHP7.4 to phalcon examples 2019-10-31 14:43:11 +05:30
aa2af38672 Add tests for install.ts and update dependencies 2019-10-30 09:27:04 +05:30
d27b4a7bc7 Create different workflows for each os 2019-10-30 03:13:56 +05:30
aeb5831c32 Install ext-psr using apt for phalcon 2019-10-30 01:30:54 +05:30
cb5e07baff Merge pull request #67 from shivammathur/develop
Revert action.yml changes
2019-10-29 07:10:37 +05:30
9469267fb3 Revert action.yml changes 2019-10-29 07:01:12 +05:30
1d6dab3cd1 Merge pull request #66 from shivammathur/develop
1.4.5
2019-10-29 06:45:12 +05:30
20d1b1c6f1 Bump version, and update workflow, readme and actions.yml 2019-10-29 06:25:40 +05:30
0d8d5d2f2c Fix side effects of this action 2019-10-29 05:37:39 +05:30
16267e1982 Merge pull request #64 from shivammathur/develop
Speed improvements and fixes for shell change in windows
2019-10-25 05:11:14 +05:30
91d14c7068 Update workflows as powershell is now default on windows 2019-10-25 04:28:19 +05:30
340ab0b95f Fix logs on windows 2019-10-23 15:27:40 +05:30
75c0e130e8 Switch to apt-fast 2019-10-23 03:35:15 +05:30
57a0907a18 Enable ext-curl on windows 2019-10-22 22:56:27 +05:30
3315fa09dc Overwrite existing PHP on windows 2019-10-22 21:59:36 +05:30
b132b4eb7c Merge pull request #62 from shivammathur/develop
PHP 7.4RC4, pdo_* extensions and test workflow.
2019-10-19 21:09:39 +05:30
9145972d5c Edit README and the test workflow 2019-10-19 19:59:48 +05:30
0ac43c03b2 Add timeout to codecov step in the workflow 2019-10-19 19:48:25 +05:30
46f009cce1 Fix installation of extensions with pdo prefix 2019-10-19 19:29:29 +05:30
8d9a12ba84 PHP7.4 RC4 on windows and macOS 2019-10-19 11:09:31 +05:30
76e0150bb5 Update FUNDING.yml 2019-10-19 10:29:42 +05:30
ffc5b0249d Merge pull request #60 from shivammathur/develop
Release 1.4.3
2019-10-17 22:12:11 +05:30
a6aaa1db78 Improve Logs and tests 2019-10-17 21:39:01 +05:30
62beed29e3 Merge pull request #59 from shivammathur/develop
Release 1.4.2
2019-10-14 08:55:35 +05:30
fce9311522 Add support for phalcon 2019-10-14 08:35:38 +05:30
b2e7a49dd5 Add lumen examples and fix laravel examples 2019-10-13 05:27:58 +05:30
99bbaa2a58 Improve documentation 2019-10-11 23:09:05 +05:30
f7f5b1a7e1 Specify version in phpenmod and phpdismod 2019-10-11 13:14:59 +05:30
e755fb7a69 Refactor installation scripts 2019-10-11 12:48:49 +05:30
3087ceb811 Merge pull request #58 from shivammathur/develop
Fix enableExtensionUnix
2019-10-10 22:10:37 +05:30
05e2b0d1e9 Fix enableExtensionUnix 2019-10-10 21:21:50 +05:30
dd5c977988 Merge pull request #57 from shivammathur/develop
Fix scripts, README and examples
2019-10-10 19:55:19 +05:30
c1c0acc338 Fix scripts, README and examples 2019-10-10 19:45:43 +05:30
409e055931 Merge pull request #55 from shivammathur/develop
Improve code and examples
2019-10-08 19:41:46 +05:30
46a875ad7e Improve code and examples 2019-10-08 18:31:45 +05:30
7e81c058fb Merge pull request #54 from shivammathur/develop
Add option to disable coverage drivers
2019-10-05 15:32:11 +05:30
754ab9515b Add option to disable coverage drivers 2019-10-05 15:00:00 +05:30
f866c880c2 Merge pull request #52 from shivammathur/develop
Fix links in README. Broken in #51
2019-10-05 07:01:38 +05:30
eb21cb8fb3 Fix links in README. Broken in #51 2019-10-05 07:00:06 +05:30
aee6b953c3 Merge pull request #51 from shivammathur/develop
Fix examples and add coverage badge
2019-10-05 06:54:59 +05:30
21c3c8db47 Fix examples and add coverage badge 2019-10-05 06:44:08 +05:30
c0e0d9d98e Merge pull request #50 from shivammathur/develop
Fix example laravel with postgres
2019-10-04 21:48:41 +05:30
5ab8ec4a99 Fix example laravel with postgres 2019-10-04 21:46:54 +05:30
ec3c220bb2 Merge pull request #49 from shivammathur/develop
1.3.8
2019-10-04 21:41:40 +05:30
17d90ace86 Improve examples and logging, and fix PCOV setup on linux 2019-10-04 21:26:49 +05:30
ba5306eea9 Use pre-compiled PCOV binary for PHP7.4 on windows 2019-10-04 13:48:09 +05:30
06929bdf4c Merge pull request #48 from shivammathur/develop
1.3.7 - restructure code, fix extensions on 7.4 and add example
2019-10-03 20:57:14 +05:30
e97e822eff Cleanup 7.4.sh and bump version to 1.3.7 2019-10-03 20:45:58 +05:30
0f97f445fb Merge pull request #47 from linuxjuggler/add-example
adding laravel with mysql example
2019-10-03 19:52:45 +05:30
507cc5e95d adding laravel with mysql example 2019-10-03 13:43:34 +03:00
2a30f9d208 Fix xdebug and pcov on PHP7.4 and restructre code 2019-10-03 11:44:17 +05:30
eaf140ca8b Fix xdebug version 2019-09-28 16:40:37 +05:30
dcd432d918 Remove log output from 7.4 on darwin 2019-09-28 08:01:23 +05:30
91a03a2865 Fix kerberos package name 2019-09-28 08:01:23 +05:30
ca33947c62 Fix logs 2019-09-28 08:01:23 +05:30
932b66f3fc Fix config.yaml path 2019-09-28 07:23:27 +05:30
651d2619bb Install extensions with PHP7.4 on darwin. 2019-09-28 01:15:33 +05:30
16f13a69eb Add extension to php.ini in windows using Add-Content 2019-09-27 00:15:03 +05:30
9134867822 Add coverage support, improve logs and fix bugs 2019-09-26 20:24:24 +05:30
36104f0983 Fix scripts and action workflow 2019-09-25 17:04:10 +05:30
a0b0e58cb3 Improve composer installer on darwin
- Check to signature.
- Add error handling.
2019-09-25 08:46:37 +05:30
c6f956927a Improve composer installer
- Check to signature.
- Add error handling.
- See Also https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
2019-09-25 08:46:37 +05:30
83cc9a4bcf Fix condition to check if extension is enabled 2019-09-24 21:49:53 +05:30
e63fd8e122 Fix link to CONTRIBUTING.md 2019-09-24 16:16:33 +05:30
d33e2e06e4 Not run workflow on *.md changes and fix links in README 2019-09-24 15:53:38 +05:30
7fcf39f8e9 Fix codecov reporting and improve README 2019-09-24 14:54:34 +05:30
43a64813f3 Improve PR Templates 2019-09-22 14:34:08 +05:30
ba83ab2e67 Add templates and format code 2019-09-22 12:25:51 +05:30
9cfe4e665e Optimize installation scripts 2019-09-22 00:30:44 +05:30
585f7a1fd2 Add FUNDING.yml and issue templates 2019-09-21 17:31:59 +05:30
43178a7254 Improve code quality and write tests 2019-09-20 21:54:46 +05:30
db44db4b97 Fix PECL extension installation on darwin 2019-09-19 18:05:40 +05:30
601f50f55e cleanup 2019-09-19 06:40:09 +05:30
e71c06a64f Make /run/php directory in ubuntu and fix extension install 2019-09-19 06:16:13 +05:30
c5825452ec Adding hirak/prestissimo to darwin and linux 2019-09-18 19:13:58 +05:30
339c69c9a5 Fix php.ini in php7.4 in darwin 2019-09-18 18:02:35 +05:30
e4a37d0f16 Add support for php.ini customization and fix bugs 2019-09-18 16:19:52 +05:30
a398f54da4 Install PHP only if not found and support 7.4.0RC2 2019-09-18 01:18:33 +05:30
360 changed files with 22365 additions and 801642 deletions

16
.eslintrc.json Normal file
View File

@ -0,0 +1,16 @@
{
"env": { "node": true, "jest": true },
"parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 2019, "sourceType": "module" },
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
"prettier/@typescript-eslint"
],
"plugins": ["@typescript-eslint", "jest"]
}

76
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at contact@shivammathur.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

70
.github/CONTRIBUTING.md vendored Normal file
View File

@ -0,0 +1,70 @@
# Contributing to setup-php
## Contributor Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
## Workflow
* Fork the project.
* Make your bug fix or feature addition.
* Add tests for it, so we don't break it in a future version unintentionally.
* If editing the scripts, create a demo integration test.
* Send a pull request to the develop branch with all the details.
Please make sure that you have [set up your user name and email address](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for use with Git. Strings such as `silly nick name <root@localhost>` look really stupid in the commit history of a project.
Due to time constraints, you may not always get a quick response. Please do not take delays personally and feel free to remind.
## Coding Guidelines
## Using setup-php from a Git checkout
The following commands can be used to perform the initial checkout of setup-php:
```bash
$ git clone https://github.com/shivammathur/setup-php.git
$ cd setup-php
```
Install setup-php dependencies using [npm](https://www.npmjs.com/):
```bash
$ 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
After following the steps shown above, The `setup-php` tests in the `__tests__` directory can be run using this command:
```bash
$ npm test
```
## Creating a release
Create a release before you push your changes.
```bash
$ npm run release
```
## Reporting issues
Please submit the issue using the appropriate template provided for a bug report or a feature request:
* [Issues](https://github.com/shivammathur/setup-php/issues)

7
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,7 @@
# These are supported funding model platforms
open_collective: setup-php
tidelift: "npm/setup-php"
community_bridge: setup-php
patreon: shivammathur
custom: https://www.paypal.me/shivammathur

42
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,42 @@
---
name: Bug report
about: Nice, you found a bug!
title: ''
labels: 'bug'
assignees: 'shivammathur'
---
**Describe the bug**
<!-- Please describe the bug concisely. -->
**Version**
- [ ] I have checked releases, and the bug exists in the latest patch version of `v1` or `v2`.
- [ ] `v2`
- [ ] `v1`
**Runners**
<!-- Please mark the GitHub Action runner your workflow uses. -->
- [ ] GitHub Hosted
- [ ] Self Hosted
**Operating systems**
<!-- Please mention the operating systems your workflow uses. -->
**PHP versions**
<!-- Please mention the PHP versions your workflow uses. -->
**To Reproduce**
<!-- Please provide the relevant steps of your workflow `.yml` file. -->
**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->
**Screenshots/Logs**
<!-- If applicable, add screenshots or logs to help explain your problem. -->
**Additional context**
<!-- Add any other context about the problem here. -->
**Are you willing to submit a PR?**
<!-- We accept pull requests targeting the develop branch. -->

View File

@ -0,0 +1,26 @@
---
name: Feature request
about: Suggest a new feature
title: ''
labels: 'enhancement'
assignees: 'shivammathur'
---
**Describe the feature**
<!-- Please describe concisely the feature you want to add. -->
**Version**
- [ ] I have checked releases, and the feature is missing in the latest patch version of `v2`.
**Underlying issue**
<!-- Please describe the issue this would solve. -->
**Describe alternatives**
<!-- Please mention any alternative solutions you've considered. -->
**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
**Are you willing to submit a PR?**
<!-- We accept pull requests targeting the develop branch. -->

37
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,37 @@
---
name: 🐞 Bug Fix, ⚙ Improvement or 🎉 New Feature
about: You found a bug, want to improve something or add a new feature
labels: bug or enhancement
---
## A Pull Request should be associated with a Discussion.
> If you're fixing a bug, adding a new feature or improving something please provide the details in discussions,
> so that the development can be pointed in the intended direction.
Related discussion: <!-- Please link the related discussion -->
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
> Thank you for your contribution.
### 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 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.
-->

30
.github/SECURITY.md vendored Normal file
View File

@ -0,0 +1,30 @@
# Security Policy
## Supported Versions
The following versions of this project are supported for security updates.
| Version | Supported |
| ------- | ------------------ |
| 1.10.x | :white_check_mark: |
| 2.8.x | :white_check_mark: |
## Supported PHP Versions
This security policy only applies to the latest patches of the following PHP versions.
| Version | Supported |
| ------- | ------------------ |
| 7.2 | :white_check_mark: |
| 7.3 | :white_check_mark: |
| 7.4 | :white_check_mark: |
| 8.0 | :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).

73
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,73 @@
name: Docs workflow
on:
workflow_dispatch:
schedule:
- cron: '0 15 * * 2'
jobs:
create:
name: Create
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-2019, macos-10.15, macos-11.0]
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Save unix
env:
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
version: ${{ matrix.php-versions }}
if: matrix.operating-system != 'windows-2019'
run: |
echo "## PHP $version" >> "$file"
printf "\n" >> "$file"
echo "\`\`\`" >> "$file"
php -m >> "$file"
echo "\`\`\`" >> "$file"
printf "\n" >> "$file"
- name: Save Windows
env:
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
version: ${{ matrix.php-versions }}
if: matrix.operating-system == 'windows-2019'
run: |
Write-Output "## PHP ${{ matrix.php-versions }}`n" | Out-File -FilePath "$env:file"
Write-Output "``````" | Out-File -FilePath "$env:file" -Append
php -m | Out-File -FilePath "$env:file" -Append
Write-Output "```````n" | Out-File -FilePath "$env:file" -Append
- uses: actions/upload-artifact@v2
with:
name: lists
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
update:
name: Update
needs: create
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}.wiki
- uses: actions/download-artifact@v2
with:
path: ${{ github.workspace }}
- name: Combine
run: |
git config --local user.email "${{ secrets.email }}"
git config --local user.name "${{ github.repository_owner }}"
for os in ubuntu-20.04 ubuntu-18.04 ubuntu-16.04 windows-2019 macos-10.15 macos-11.0; do
echo "These are extensions which are loaded by default on the following PHP versions. More extensions which are available as packages and available on pecl are supported by setup-php. Refer to [php extension support](https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support) for more details." > Php-extensions-loaded-on-"$os".md
for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1; do
cat lists/php"$version"-"$os".md >> Php-extensions-loaded-on-"$os".md
done
done
rm -rf ./lists
if [ "$(git status --porcelain=v1 2>/dev/null | wc -l)" != "0" ]; then
git add .
git commit -m "Update PHP extensions on wiki - $(date +'%d-%m-%y')"
git push -f https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git master || true
fi

51
.github/workflows/node-workflow.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: Node workflow
on:
pull_request:
branches:
- master
- develop
- verbose
paths-ignore:
- '**.md'
- 'examples/**'
push:
branches:
- 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]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.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 }}

View File

@ -1,30 +1,78 @@
name: Main workflow
on: [push]
on:
workflow_dispatch:
pull_request:
branches:
- master
- develop
- verbose
paths-ignore:
- '**.md'
- 'examples/**'
push:
branches:
- master
- develop
- verbose
paths-ignore:
- '**.md'
- 'examples/**'
jobs:
run:
name: Run
runs-on: ${{ matrix.operating-system }}
strategy:
max-parallel: 6
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-latest, macos-latest]
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
env:
extensions: xml, opcache, xdebug, pcov
key: cache-v3
steps:
- name: Checkout
uses: actions/checkout@master
- name: Checkout
uses: actions/checkout@v2
- name: Set Node.js 10.x
uses: actions/setup-node@master
with:
version: 10.x
- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@develop
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Installing NPM
run: npm install
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: Installing PHP
run: node lib/install.js
env:
php-version: ${{ matrix.php-versions }}
extension-csv: "mbstring, curl, mysqli, json, xml, xdebug, pcov, phpdbg"
- name: Testing
run: php -v && composer -V && php -m
- name: Setup PHP with extensions and custom config
run: node dist/index.js
env:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata
- 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('xml')) {throw new Exception('xml not found');}"
php -r "if(! extension_loaded('Xdebug')) {throw new Exception('Xdebug not found');}"
php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
- name: Testing ini values
run: |
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('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');}"

93
.gitignore vendored
View File

@ -0,0 +1,93 @@
# Explicitly not ignoring node_modules so that they are included in package downloaded by runner
node_modules/
__tests__/runner/*
lib/
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/

View File

@ -1,11 +1,12 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"endOfLine": "auto",
"parser": "typescript",
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
"useTabs": false
}

View File

@ -1,7 +1,7 @@
The MIT License (MIT)
Copyright (c) 2019 shivammathur and contributors
Copyright (c) 2019-2020 shivammathur and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

915
README.md
View File

@ -1,109 +1,882 @@
# Setup PHP in GitHub Actions
<p align="left">
<a href="https://github.com/shivammathur/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/blob/master/LICENSE"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg"></a>
<p align="center">
<a href="https://github.com/marketplace/actions/setup-php-action" target="_blank">
<img src="https://repository-images.githubusercontent.com/206578964/e0a18480-dc65-11e9-8dd3-b9ffbf5575fe" alt="Setup PHP in GitHub Actions" width="400">
</a>
</p>
[GitHub Action](https://github.com/features/actions) to install PHP with required extensions and composer. This action can be added as a step in your action workflow and it will setup the PHP environment you need to test your application. Refer to [Usage](#usage) section to see how to use this.
<h1 align="center">Setup PHP in GitHub Actions</h1>
## PHP Versions Support
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4 `7.4.0beta4` on `ubuntu`, and `7.4.0RC1` on `windows` and `macOS`
<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://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?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.1-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
</p>
<p align="center">
<a href="https://reddit.com/r/setup_php" title="setup-php reddit"><img alt="setup-php reddit" src="https://img.shields.io/badge/reddit-join-FF5700?logo=reddit&logoColor=FF5700&labelColor=555555"></a>
<a href="https://twitter.com/setup_php" title="setup-php twitter"><img alt="setup-php twitter" src="https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555"></a>
<a href="https://setup-php.statuspage.io/" title="setup-php status"><img alt="setup-php status" src="https://img.shields.io/badge/status-subscribe-28A745?logo=statuspage&logoColor=28A745&labelColor=555555"></a>
</p>
**Note:** PHP 7.4 is currently in development, do not use in production.
Setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross platform interface to set up the PHP environment you need to test your application. Refer to [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
## OS Support
## Contents
|Virtual environment|matrix.operating-system|
- [OS/Platform Support](#cloud-osplatform-support)
- [GitHub-Hosted Runners](#github-hosted-runners)
- [Self-Hosted Runners](#self-hosted-runners)
- [PHP Support](#tada-php-support)
- [PHP Extension Support](#heavy_plus_sign-php-extension-support)
- [Tools Support](#wrench-tools-support)
- [Coverage Support](#signal_strength-coverage-support)
- [Xdebug](#xdebug)
- [PCOV](#pcov)
- [Disable Coverage](#disable-coverage)
- [Usage](#memo-usage)
- [Inputs](#inputs)
- [Flags](#flags)
- [Basic Setup](#basic-setup)
- [Matrix Setup](#matrix-setup)
- [Nightly Build Setup](#nightly-build-setup)
- [Thread Safe Setup](#thread-safe-setup)
- [Force Update Setup](#force-update-setup)
- [Verbose Setup](#verbose-setup)
- [Multi-Arch Setup](#multi-arch-setup)
- [Self Hosted Setup](#self-hosted-setup)
- [Local Testing Setup](#local-testing-setup)
- [JIT Configuration](#jit-configuration)
- [Cache Extensions](#cache-extensions)
- [Cache Composer Dependencies](#cache-composer-dependencies)
- [Cache Node.js Dependencies](#cache-nodejs-dependencies)
- [Composer GitHub OAuth](#composer-github-oauth)
- [Problem Matchers](#problem-matchers)
- [Examples](#examples)
- [Versioning](#bookmark-versioning)
- [License](#scroll-license)
- [Contributions](#1-contributions)
- [Support This Project](#sparkling_heart-support-this-project)
- [Dependencies](#package-dependencies)
- [Further Reading](#bookmark_tabs-further-reading)
## :cloud: OS/Platform Support
Both `GitHub-hosted` and `self-hosted` runners are suppported by `setup-php` on the following OS/Platforms.
### GitHub-Hosted Runners
|Virtual environment|YAML workflow label|Pre-installed PHP|
|--- |--- |--- |
|Ubuntu 16.04|`ubuntu-16.04`|`PHP 5.6` to `PHP 8.0`|
|Ubuntu 18.04|`ubuntu-latest` or `ubuntu-18.04`|`PHP 7.1` to `PHP 8.0`|
|Ubuntu 20.04|`ubuntu-20.04`|`PHP 7.4` to `PHP 8.0`|
|Windows Server 2019|`windows-latest` or `windows-2019`|`PHP 8.0`|
|macOS Catalina 10.15|`macos-latest` or `macos-10.15`|`PHP 8.0`|
|macOS Big Sur 11.0|`macos-11.0`|`PHP 8.0`|
### Self-Hosted Runners
|Host OS/Virtual environment|YAML workflow label|
|--- |--- |
|Windows Server 2019|`windows-latest` or `windows-2019`|
|Windows Server 2016 R2|`windows-2016`|
|Ubuntu 18.04|`ubuntu-latest` or `ubuntu-18.04`|
|Ubuntu 16.04|`ubuntu-16.04`|
|macOS X Mojave 10.14|`macOS-latest` or `macOS-10.14`|
|Ubuntu 16.04|`self-hosted` or `Linux`|
|Ubuntu 18.04|`self-hosted` or `Linux`|
|Ubuntu 20.04|`self-hosted` or `Linux`|
|Windows 7 and newer|`self-hosted` or `Windows`|
|Windows Server 2012 R2 and newer|`self-hosted` or `Windows`|
|macOS Catalina 10.15|`self-hosted` or `macOS`|
|macOS Big Sur 11.x x86_64/arm64|`self-hosted` or `macOS`|
- Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
- If the requested PHP version is pre-installed, `setup-php` switches to it, otherwise it installs the PHP version.
## PHP Extension Support
- On `ubuntu` extensions which have the package in apt are installed.
- On `windows` and `macOS` PECL extensions are installed.
- Extensions which are installed along with PHP if specified are enabled.
- Extensions which cannot be installed gracefully leave an error message in the logs, the action is not interruped.
## :tada: PHP Support
## Usage
On all supported OS/Platforms the following PHP versions are supported as per the runner.
See [action.yml](action.yml) for inputs this action supports.
- PHP 5.3 to PHP 8.1 on GitHub-hosted runners.
- PHP 5.6 to PHP 8.1 on self-hosted runners.
### Basic
|PHP Version|Stability|Release Support|Runner Support|
|--- |--- |--- |--- |
|`5.3`|`Stable`|`End of life`|`GitHub-hosted`|
|`5.4`|`Stable`|`End of life`|`GitHub-hosted`|
|`5.5`|`Stable`|`End of life`|`GitHub-hosted`|
|`5.6`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|`7.0`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|`7.1`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|`7.2`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|`7.3`|`Stable`|`Security fixes only`|`GitHub-hosted`, `self-hosted`|
|`7.4`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|`8.0`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|`8.1`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`|
**Notes:**
- Specifying `8.1` in `php-version` input installs a nightly build of `PHP 8.1.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
- To use JIT on `PHP 8.0` and `PHP 8.1` refer to the [JIT configuration](#jit-configuration) section.
## :heavy_plus_sign: PHP Extension Support
PHP extensions can be setup using the `extensions` input. It accepts a `string` in csv-format.
- On `Ubuntu`, extensions which are available as a package or available on `PECL` can be setup.
```yaml
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: imagick, swoole
```
- On `Windows`, extensions available on `PECL` which have the `DLL` binary can be setup.
- On `macOS`, extensions available on `PECL` can be installed.
- Extensions installed along with PHP if specified are enabled.
- Specific versions of extensions available on `PECL` can be setup by suffixing the extension's name with the version. This is useful for installing old versions of extensions which support end of life PHP versions.
```yaml
- name: Setup PHP with specific version of PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '5.4'
extensions: swoole-1.9.3
```
- Pre-release versions extensions available on `PECL` can be setup by suffixing the extension's name with its state i.e `alpha`, `beta`, `devel` or `snapshot`.
```yaml
- name: Setup PHP with pre-release PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: xdebug-beta
```
- Shared extensions can be removed by prefixing them with a `:`.
```yaml
- name: Setup PHP and remove shared extension
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: :opcache
```
- Extension `intl` can be setup with specific `ICU` version for `PHP 5.6` to `PHP 8.0` in `Ubuntu` workflows by suffixing `intl` with the `ICU` version. `ICU 50.2` and newer versions are supported. Refer to [`ICU builds`](https://github.com/shivammathur/icu-intl#icu4c-builds) for the specific versions supported.
```yaml
- name: Setup PHP with intl
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: intl-68.2
```
- Extensions loaded by default after `setup-php` runs can be found on the [wiki](https://github.com/shivammathur/setup-php/wiki).
- These extensions have custom support:
- `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`.
- `geos` on `Ubuntu` and `macOS`.
- `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_oci`, `phalcon3` and `phalcon4` on all supported OS.
- By default, extensions which cannot be added or removed gracefully leave an error message in the logs, the action is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
```yaml
- name: Setup PHP with fail-fast
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: oci8
env:
fail-fast: true
```
## :wrench: Tools Support
These tools can be setup globally using the `tools` input. It accepts a string in csv-format.
`behat`, `blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-normalize`, `composer-prefetcher`, `composer-require-checker`, `composer-unused`, `cs2pr`, `deployer`, `flex`, `grpc_php_plugin`, `infection`, `pecl`, `phan`, `phing`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpspec`, `phpstan`, `phpunit`, `prestissimo`, `protoc`, `psalm`, `symfony`, `vapor-cli`
```yaml
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: php-cs-fixer, phpunit
```
- To set up a particular version of a tool, specify it in the form `tool:version`. The latest stable version of `composer` is set up by default. You can set up the required `composer` version by specifying `v1`, `v2`, `snapshot` or `preview` as versions or the exact version in semver format.
```yaml
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
```
- Tools `prestissimo` and `composer-prefetcher` will be skipped unless `composer:v1` is also specified in tools input. It is recommended to drop `prestissimo` and use `composer v2`.
- The latest versions of both agent `blackfire-agent` and client `blackfire` are setup when `blackfire` is specified in tools input. Please refer to the [official documentation](https://blackfire.io/docs/integrations/ci/github-actions "Blackfire.io documentation for GitHub Actions") for using `blackfire` with GitHub Actions.
- Version for other tools should be in `semver` format and a valid release of the tool. This is useful for installing tools for older versions of PHP. For example to set up `PHPUnit` on `PHP 7.2`.
```yaml
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
tools: phpunit:8.5.8
```
- By default, tools which cannot be set up gracefully leave an error message in the logs, the action is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
```yaml
- name: Setup PHP with fail-fast
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: deployer
env:
fail-fast: true
```
**Notes**
- Input `tools` is useful to set up tools which you only use in GitHub Actions, thus keeping your `composer.json` tidy.
- If you do not want to use all your dev-dependencies in GitHub Actions workflow, you can run composer with `--no-dev` and install required tools using `tools` input to speed up your workflow.
- If you have a tool in your `composer.json`, do not setup it with `tools` input as the two instances of the tool might conflict.
## :signal_strength: Coverage Support
### 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").
```yaml
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: xdebug
```
- The latest version of Xdebug compatible with the PHP version is set up by default.
- If you need Xdebug 2.x on PHP 7.2, 7.3 or 7.4, you can specify `coverage: xdebug2`.
```yaml
- name: Setup PHP with Xdebug 2.x
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: xdebug2
```
### PCOV
Specify `coverage: pcov` to use PCOV and disable Xdebug.
Runs on PHP 7.1 and newer PHP versions.
- In most cases, tests with `PCOV` execute much faster than with `Xdebug`.
- If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values` input.
```yaml
- name: Setup PHP with PCOV
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
ini-values: pcov.directory=api #optional, see above for usage.
coverage: pcov
```
- PHPUnit 8.x and above supports PCOV out of the box.
- If you are using PHPUnit 5.x, 6.x or 7.x, you need to set up `pcov/clobber` before executing your tests.
```yaml
- name: Setup PCOV
run: |
composer require pcov/clobber
vendor/bin/pcov clobber
```
### Disable Coverage
Specify `coverage: none` to remove both `Xdebug` and `PCOV`.
Consider disabling the coverage using this PHP action for these reasons.
- You are not generating coverage reports while testing.
- It will remove `Xdebug`, which will have a positive impact on PHP performance.
- You are using `phpdbg` for running your tests.
- You are profiling your code using `blackfire`.
```yaml
- name: Setup PHP with no coverage driver
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
```
## :memo: Usage
### Inputs
> Specify using `with` keyword
#### `php-version` (required)
- Specify the PHP version you want to set up.
- Accepts a `string`. For example `'7.4'`.
- Accepts `latest` to set up the latest stable PHP version.
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
- See [PHP support](#tada-php-support) for supported PHP versions.
#### `extensions` (optional)
- Specify the extensions you want to add or remove.
- Accepts a `string` in csv-format. For example `mbstring, :opcache`.
- Non-default extensions prefixed with `:` are removed.
- See [PHP extension support](#heavy_plus_sign-php-extension-support) for more info.
#### `ini-values` (optional)
- Specify the values you want to add to `php.ini`.
- Accepts a `string` in csv-format. For example `post_max_size=256M, max_execution_time=180`.
- Accepts ini values with commas if wrapped in quotes. For example `xdebug.mode="develop,coverage"`.
#### `coverage` (optional)
- Specify the code coverage driver you want to set up.
- Accepts `xdebug`, `pcov` or `none`.
- See [coverage support](#signal_strength-coverage-support) for more info.
#### `tools` (optional)
- Specify the tools you want to set up.
- Accepts a `string` in csv-format. For example: `phpunit, phpcs`
- See [tools Support](#wrench-tools-support) for tools supported.
### Flags
> Specify using `env` keyword
#### `fail-fast` (optional)
- Specify to mark the workflow as failed if an extension or tool fails to set up.
- This changes the default mode from graceful warnings to fail-fast.
- By default, it is set to `false`.
- Accepts `true` and `false`.
#### `phpts` (optional)
- Specify to set up thread-safe version of PHP on windows.
- Accepts `ts` and `nts`.
- By default, it is set to `nts`.
- See [thread safe setup](#thread-safe-setup) for more info.
#### `update` (optional)
- Specify to update PHP on the runner to the latest patch version.
- Accepts `true` and `false`.
- By default, it is set to `false`.
- See [force update setup](#force-update-setup) for more info.
See below for more info.
### Basic Setup
> Setup a particular PHP version.
```yaml
steps:
- name: Checkout
uses: actions/checkout@master
- name: Installing PHP
uses: shivammathur/setup-php@master
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
extension-csv: mbstring, xdebug
- name: Check PHP Version
run: php -v
- name: Check Composer Version
run: composer -V
- name: Check PHP Extensions
run: php -m
php-version: '7.4'
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit
```
### Matrix Testing
### Matrix Setup
> Setup multiple PHP versions on multiple operating systems.
```yaml
jobs:
run:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
max-parallel: 15
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
php-versions: ['7.3', '7.4']
phpunit-versions: ['latest']
include:
- operating-system: 'ubuntu-latest'
php-versions: '7.2'
phpunit-versions: '8.5.13'
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install PHP
uses: shivammathur/setup-php@master
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, xdebug
- name: Check PHP Version
run: php -v
- name: Check Composer Version
run: composer -V
- name: Check PHP Extensions
run: php -m
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }}
```
## License
### Nightly Build Setup
The scripts and documentation in this project are released under the [MIT License](LICENSE)
> Setup a nightly build of `PHP 8.1`.
## Contributions
- This version is currently in development.
- Some user space extensions might not support this version currently.
Contributions are welcome! See [Contributor's Guide](docs/contributors.md)
```yaml
steps:
- name: Checkout
uses: actions/checkout@v2
## This action uses the following works
- name: Setup nightly PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit
```
- [powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager)
- [Homebrew](https://brew.sh/)
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php)
- [exolnet/homebrew-deprecated](https://github.com/eXolnet/homebrew-deprecated)
- [phpbrew](https://github.com/phpbrew/phpbrew)
### Thread Safe Setup
## Further Reading
> Setup `TS` or `NTS` PHP on `Windows`.
- [About GitHub Actions](https://github.com/features/actions)
- [GitHub Actions Syntax](https://help.github.com/en/articles/workflow-syntax-for-github-actions)
- [Other Awesome Actions](https://github.com/sdras/awesome-actions)
- `NTS` versions are setup by default.
- On `Ubuntu` and `macOS` only `NTS` versions are supported.
- On `Windows` both `TS` and `NTS` versions are supported.
```yaml
jobs:
run:
runs-on: windows-latest
name: Setup PHP TS on Windows
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
env:
phpts: ts # specify ts or nts
```
### Force Update Setup
> Update to the latest patch of PHP versions.
- Pre-installed PHP versions on the GitHub Actions runner are not updated to their latest patch release by default.
- You can specify the `update` environment variable to `true` to force update to the latest release.
```yaml
- name: Setup PHP with latest versions
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
env:
update: true # specify true or false
```
### Verbose Setup
> Debug your workflow
To debug any issues, you can use the `verbose` tag instead of `v2`.
```yaml
- name: Setup PHP with logs
uses: shivammathur/setup-php@verbose
with:
php-version: '7.4'
```
### Multi-Arch Setup
> Setup PHP on multiple architecture on Ubuntu GitHub Runners.
- `PHP 5.6` to `PHP 7.4` are supported by `setup-php` on multiple architecture on `Ubuntu`.
- For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `spc` utility.
- Using `spc` you can run `setup-php` on both `i386` and `amd64` containers as opposed to [default syntax](#basic-setup), which only supports `amd64`.
- Currently, for `Arm` based setup, you will need [self-hosted runners](#self-hosted-setup).
```yaml
jobs:
run:
runs-on: ubuntu-latest
container: shivammathur/node:latest-${{ matrix.arch }}
strategy:
matrix:
arch: ["amd64", "i386"]
steps:
- name: Install PHP
run: |
# Update spc (See https://github.com/shivammathur/spc for options)
spc -U
# Install PHP
spc --php-version "7.4" \
--extensions "mbstring, intl" \
--ini-values "post_max_size=256M, max_execution_time=180" \
--coverage "xdebug" \
--tools "php-cs-fixer, phpunit"
```
### Self Hosted Setup
> Setup PHP on a self-hosted runner.
- To set up a dockerized self-hosted runner, refer to this [guide](https://github.com/shivammathur/setup-php/wiki/Dockerized-self-hosted-runner-on-Ubuntu) to set up in an `Ubuntu` container and refer to this [guide](https://github.com/shivammathur/setup-php/wiki/Dockerized-self-hosted-runner-on-Windows) to set up in a `Windows` container.
- To set up the runner directly on the host OS or in a virtual machine, follow this [requirements guide](https://github.com/shivammathur/setup-php/wiki/Requirements-for-self-hosted-runners "Requirements guide for self-hosted runner to run setup-php") before setting up the self-hosted runner.
- If your workflow uses [services](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices "GitHub Actions Services"), then setup the runner on a Linux host or in a Linux virtual machine. GitHub Actions does not support nested virtualization on Linux, so services will not work in a dockerized container.
Specify the environment variable `runner` with the value `self-hosted`. Without this your workflow will fail.
```yaml
jobs:
run:
runs-on: self-hosted
strategy:
matrix:
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
name: PHP ${{ matrix.php-versions }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
env:
runner: self-hosted # Specify the runner.
```
**Notes**
- Do not setup multiple self-hosted runners on a single server instance as parallel workflow will conflict with each other.
- Do not setup self-hosted runners on the side on your development environment or your production server.
- Avoid using the same labels for your `self-hosted` runners which are used by `GitHub-hosted` runners.
### Local Testing Setup
> Test your `Ubuntu` workflow locally using [`nektos/act`](https://github.com/nektos/act "Project to test GitHub Actions locally").
```yaml
jobs:
run:
runs-on: ubuntu-latest
name: PHP 7.4 Test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
```
Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker images.
```bash
# For runs-on: ubuntu-latest
act -P ubuntu-latest=shivammathur/node:latest
# For runs-on: ubuntu-20.04
act -P ubuntu-20.04=shivammathur/node:focal
# For runs-on: ubuntu-18.04
act -P ubuntu-18.04=shivammathur/node:bionic
# For runs-on: ubuntu-16.04
act -P ubuntu-16.04=shivammathur/node:xenial
```
### JIT Configuration
> Enable Just-in-time(JIT) on PHP 8.0 and PHP 8.1.
- To enable JIT, enable `opcache` in cli mode by setting `opcache.enable_cli=1`.
- By default, `opcache.jit=1235` and `opcache.jit_buffer_size=256M` are set which can be changed using `ini-values` input.
- For detailed information about JIT related directives refer to the [`official PHP documentation`](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit "opcache.jit documentation").
For example to enable JIT in `tracing` mode with buffer size of `64 MB`.
```yaml
- name: Setup PHP with JIT in tracing mode
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
ini-values: opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=64M
```
### Cache Extensions
You can cache PHP extensions using `shivammathur/cache-extensions` and `action/cache` GitHub Actions. Extensions which take very long to set up when cached are available in the next workflow run and are enabled directly. This reduces the workflow execution time.
Refer to [`shivammathur/cache-extensions`](https://github.com/shivammathur/cache-extensions "GitHub Action to cache php extensions") for details.
### Cache Composer Dependencies
If your project uses composer, you can persist the composer's internal cache directory. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time.
```yaml
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist
```
**Notes**
- Please do not cache `vendor` directory using `action/cache` as that will have side effects.
- If you do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
```yaml
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 and add them to the keys.
```yaml
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.prefer }}-
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
```
### Cache Node.js Dependencies
If your project has node.js dependencies, you can persist NPM or yarn cache directory. The cached files are available across check-runs and will reduce the workflow execution time.
```yaml
- name: Get node.js cache directory
id: node-cache-dir
run: echo "::set-output name=dir::$(npm config get cache)" # Use $(yarn cache dir) for yarn
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.node-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} # Use '**/yarn.lock' for yarn
restore-keys: ${{ runner.os }}-node-
```
**Note:** Please do not cache `node_modules` directory as that will have side effects.
### 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 an `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 are `json` configurations which identify errors and warnings in your logs and surface them prominently in the GitHub Actions UI by highlighting them and creating code annotations.
#### PHP
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
Setup problem matchers for your `PHPUnit` output by adding this step after the `setup-php` step.
```yaml
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
```
#### PHPStan
PHPStan supports error reporting in GitHub Actions, so it does not require problem matchers.
```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 examples refer to [cs2pr documentation](https://github.com/staabm/annotate-pull-request-from-checkstyle).
> Here is an example with `phpcs`.
```yaml
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: cs2pr, phpcs
- name: Run phpcs
run: phpcs -q --report=checkstyle src | cs2pr
```
### Examples
Examples of using `setup-php` with various PHP Frameworks and Packages.
|Framework/Package|Runs on|Workflow|
|--- |--- |--- |
|Blackfire|`macOS`, `ubuntu` and `windows`|[blackfire.yml](./examples/blackfire.yml "GitHub Action using Blackfire")|
|Blackfire Player|`macOS`, `ubuntu` and `windows`|[blackfire-player.yml](./examples/blackfire-player.yml "GitHub Action using Blackfire Player")|
|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 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")|
|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 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 `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")|
|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")|
|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")|
|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 `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")|
|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")|
|Zend Framework|`macOS`, `ubuntu` and `windows`|[zend-framework.yml](./examples/zend-framework.yml "GitHub Action for Zend Framework")|
## :bookmark: Versioning
- Use the `v2` tag as `setup-php` version. It is a rolling tag and is synced with the latest minor and patch releases. With `v2` you automatically get the bug fixes, new features and support for latest PHP releases. For debugging any issues `verbose` tag can be used temporarily. It outputs all the logs and is also synced with the latest releases.
- Semantic release versions can also be used. It is recommended to [use dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot "Setup Dependabot with GitHub Actions") with semantic versioning to keep the actions in your workflows up to date.
- Commit SHA can also be used, but are not recommended. They have to be updated with every release manually, without which you will not get any bug fixes or new features.
- It is highly discouraged to use the `master` branch as version, it might break your workflow after major releases as they have breaking changes.
- If you are using the `v1` tag or a `1.x.y` version, you should [switch to v2](https://github.com/shivammathur/setup-php/wiki/Switch-to-v2 "Guide for switching from setup-php v1 to v2") as `v1` only gets critical bug fixes. Maintenance support for `v1` will be dropped with the last `PHP 8.0` release.
## :scroll: License
- The scripts and documentation in this project are under the [MIT License](LICENSE "License for shivammathur/setup-php").
- This project has multiple [dependencies](#package-dependencies "Dependencies for this PHP Action"). Their licenses can be found in their respective repositories.
- 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
> Contributions are welcome!
- See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/setup-php contribution guide") before you start.
- If you face any issues or want to suggest a feature/improvement, start a discussion [here](https://github.com/shivammathur/setup-php/discussions "Setup PHP discussions").
*Join the list of setup-php contributors*
<p align="center">
<a href="https://github.com/shivammathur/setup-php/graphs/contributors">
<img src="https://opencollective.com/setup-php/contributors.svg?width=1024&button=false" alt="setup-php contributors" width="100%">
</a>
</p>
## :sparkling_heart: Support This Project
- If setup-php saved your developer time, please consider sponsoring setup-php:
- [Open Collective](https://opencollective.com/setup-php "setup-php Open Collective")
- [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal")
- [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon")
- Please [reach out](mailto:contact@setup-php.com) if you have any questions regarding sponsoring setup-php.
- Please star the project and share it. If you blog, please share your experience of using this action.
*Huge thanks to the following companies for supporting `setup-php`*
<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://blackfire.io/?utm_source=setup-php">
<img src="https://setup-php.com/sponsors//blackfire.svg" alt="Blackfire" width="212" height="60">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://www.macstadium.com/?source=setup-php">
<img src="https://setup-php.com/sponsors//macstadium.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>
</p>
## :package: 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")
- [gplessis/dotdeb-php](https://github.com/gplessis/dotdeb-php "Packaging for end of life PHP versions")
- [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/cache-extensions](https://github.com/shivammathur/cache-extensions "GitHub action to help with caching PHP extensions")
- [shivammathur/composer-cache](https://github.com/shivammathur/composer-cache "Cache composer releases")
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions on MacOS")
- [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds on MacOS")
- [shivammathur/icu-intl](https://github.com/shivammathur/icu-intl "icu4c and php-intl builds")
- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Nightly PHP package for Ubuntu")
- [shivammathur/php-builder-windows](https://github.com/shivammathur/php-builder-windows "Nightly PHP package for Windows")
- [shivammathur/php-ubuntu](https://github.com/shivammathur/php-ubuntu "Cache stable PHP Packages for Ubuntu")
- [shivammathur/php5-darwin](https://github.com/shivammathur/php5-darwin "Scripts to setup PHP5 versions on darwin")
- [shivammathur/php5-ubuntu](https://github.com/shivammathur/php5-ubuntu "Scripts to setup PHP5 versions on ubuntu")
## :bookmark_tabs: Further Reading
- [About GitHub Actions](https://github.com/features/actions "GitHub Actions")
- [GitHub Actions Syntax](https://help.github.com/en/articles/workflow-syntax-for-github-actions "GitHub Actions Syntax")
- [Other Awesome Actions](https://github.com/sdras/awesome-actions "List of Awesome GitHub Actions")

52
__tests__/config.test.ts Normal file
View File

@ -0,0 +1,52 @@
import * as config from '../src/config';
describe('Config tests', () => {
it('checking addINIValuesOnWindows', async () => {
let win32: string = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'win32'
);
expect(win32).toContain(
'Add-Content "$php_dir\\php.ini" "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
);
win32 = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'openbsd'
);
expect(win32).toContain('Platform openbsd is not supported');
});
it('checking addINIValuesOnLinux', async () => {
let linux: string = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'linux',
true
);
expect(linux).toContain(
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" | sudo tee -a "${pecl_file:-${ini_file[@]}}"'
);
linux = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'openbsd'
);
expect(linux).toContain('Platform openbsd is not supported');
});
it('checking addINIValuesOnDarwin', async () => {
let darwin: string = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'darwin'
);
expect(darwin).toContain(
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" | sudo tee -a "${pecl_file:-${ini_file[@]}}"'
);
darwin = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'openbsd'
);
expect(darwin).toContain('Platform openbsd is not supported');
});
});

110
__tests__/coverage.test.ts Normal file
View File

@ -0,0 +1,110 @@
import * as coverage from '../src/coverage';
describe('Config tests', () => {
it('checking addCoverage with PCOV on windows', async () => {
let win32: string = await coverage.addCoverage('PCOV', '7.4', 'win32');
expect(win32).toContain('Add-Extension pcov');
expect(win32).toContain('Remove-Extension xdebug');
win32 = await coverage.addCoverage('pcov', '7.0', 'win32');
expect(win32).toContain('PHP 7.1 or newer is required');
win32 = await coverage.addCoverage('pcov', '5.6', 'win32');
expect(win32).toContain('PHP 7.1 or newer is required');
});
it('checking addCoverage with PCOV on linux', async () => {
const linux: string = await coverage.addCoverage('pcov', '7.4', 'linux');
expect(linux).toContain('add_extension pcov');
expect(linux).toContain('remove_extension xdebug');
});
it('checking addCoverage with PCOV on darwin', async () => {
const darwin: string = await coverage.addCoverage('pcov', '7.4', 'darwin');
expect(darwin).toContain('add_brew_extension pcov');
expect(darwin).toContain('remove_extension xdebug');
});
it('checking addCoverage with Xdebug on windows', async () => {
const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32');
expect(win32).toContain('Add-Extension xdebug');
});
it('checking addCoverage with Xdebug3 on windows', async () => {
const win32: string = await coverage.addCoverage('xdebug3', '7.4', 'win32');
expect(win32).toContain('Add-Extension xdebug');
});
it('checking addCoverage with Xdebug2 on windows', async () => {
const win32: string = await coverage.addCoverage('xdebug2', '7.4', 'win32');
expect(win32).toContain('Add-Extension xdebug stable 2.9.8');
});
it('checking addCoverage with Xdebug on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
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 () => {
const darwin: string = await coverage.addCoverage(
'xdebug',
'7.4',
'darwin'
);
expect(darwin).toContain('add_brew_extension xdebug');
});
it('checking addCoverage with Xdebug3 on darwin', async () => {
const darwin: string = await coverage.addCoverage(
'xdebug3',
'7.4',
'darwin'
);
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 () => {
const win32 = await coverage.addCoverage('none', '7.4', 'win32');
expect(win32).toContain('Remove-Extension xdebug');
expect(win32).toContain('Remove-Extension pcov');
});
it('checking disableCoverage on linux', async () => {
const linux: string = await coverage.addCoverage('none', '7.4', 'linux');
expect(linux).toContain('remove_extension xdebug');
expect(linux).toContain('remove_extension pcov');
});
it('checking disableCoverage on darwin', async () => {
const darwin: string = await coverage.addCoverage('none', '7.4', 'darwin');
expect(darwin).toContain('remove_extension xdebug');
expect(darwin).toContain('remove_extension pcov');
});
it('checking no or invalid coverage driver', async () => {
let nocov: string = await coverage.addCoverage('nocov', '7.x', 'any');
expect(nocov).toEqual('');
nocov = await coverage.addCoverage('', '7.x', 'any');
expect(nocov).toEqual('');
});
});

View File

@ -0,0 +1,224 @@
import * as extensions from '../src/extensions';
describe('Extension tests', () => {
it('checking addExtensionOnWindows', async () => {
let win32: string = await extensions.addExtension(
'Xdebug, pcov, sqlite, :intl, phalcon4, ioncube, oci8, pdo_oci, ast-beta, grpc-1.2.3, inotify-1.2.3alpha2, sqlsrv-1.2.3preview1',
'7.4',
'win32'
);
expect(win32).toContain('Add-Extension xdebug');
expect(win32).toContain('Add-Extension pcov');
expect(win32).toContain('Add-Extension sqlite3');
expect(win32).toContain('Remove-Extension intl');
expect(win32).toContain('Add-Phalcon phalcon4');
expect(win32).toContain('Add-Ioncube');
expect(win32).toContain('Add-Oci oci8');
expect(win32).toContain('Add-Oci pdo_oci');
expect(win32).toContain('Add-Extension ast beta');
expect(win32).toContain('Add-Extension grpc stable 1.2.3');
expect(win32).toContain('Add-Extension inotify alpha 1.2.3');
expect(win32).toContain('Add-Extension sqlsrv devel 1.2.3');
win32 = await extensions.addExtension('pcov', '5.6', 'win32');
expect(win32).toContain(
'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
);
win32 = await extensions.addExtension('xdebug2', '7.2', 'win32');
expect(win32).toContain('Add-Extension xdebug stable 2.9.8');
win32 = await extensions.addExtension('mysql', '7.4', 'win32');
expect(win32).toContain('Add-Extension mysqli');
expect(win32).toContain('Add-Extension mysqlnd');
win32 = await extensions.addExtension('mysql', '8.0', 'win32');
expect(win32).toContain('Add-Extension mysqli');
expect(win32).toContain('Add-Extension mysqlnd');
win32 = await extensions.addExtension('mysql', '5.5', 'win32');
expect(win32).toContain('Add-Extension mysql');
expect(win32).toContain('Add-Extension mysqli');
expect(win32).toContain('Add-Extension mysqlnd');
win32 = await extensions.addExtension(
'phalcon3, does_not_exist',
'7.2',
'win32',
true
);
expect(win32).toContain('Add-Phalcon phalcon3');
expect(win32).toContain('Add-Extension does_not_exist');
win32 = await extensions.addExtension('xdebug', '7.2', 'openbsd');
expect(win32).toContain('Platform openbsd is not supported');
win32 = await extensions.addExtension('blackfire', '7.3', 'win32');
expect(win32).toContain('Add-Blackfire blackfire');
win32 = await extensions.addExtension('blackfire-1.31.0', '7.3', 'win32');
expect(win32).toContain('Add-Blackfire blackfire-1.31.0');
});
it('checking addExtensionOnLinux', async () => {
let linux: string = await extensions.addExtension(
'Xdebug, pcov, sqlite, :intl, ast, ast-beta, pdo_mysql, pdo-odbc, xdebug-alpha, grpc-1.2.3',
'7.4',
'linux'
);
expect(linux).toContain('add_extension xdebug');
expect(linux).toContain('add_extension sqlite3');
expect(linux).toContain('remove_extension intl');
expect(linux).toContain('add_unstable_extension ast beta extension');
expect(linux).toContain('add_pdo_extension mysql');
expect(linux).toContain('add_pdo_extension odbc');
expect(linux).toContain('add_pecl_extension grpc 1.2.3 extension');
expect(linux).toContain(
'add_unstable_extension xdebug alpha zend_extension'
);
linux = await extensions.addExtension('pcov', '5.6', 'linux');
expect(linux).toContain(
'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
);
linux = await extensions.addExtension('gearman', '5.6', 'linux');
expect(linux).toContain('add_gearman');
linux = await extensions.addExtension('gearman', '7.4', 'linux');
expect(linux).toContain('add_gearman');
linux = await extensions.addExtension('couchbase', '5.6', 'linux');
expect(linux).toContain('add_couchbase');
linux = await extensions.addExtension('couchbase', '7.4', 'linux');
expect(linux).toContain('add_couchbase');
linux = await extensions.addExtension('pdo_cubrid', '7.0', 'linux');
expect(linux).toContain('add_cubrid pdo_cubrid');
linux = await extensions.addExtension('cubrid', '7.4', 'linux');
expect(linux).toContain('add_cubrid cubrid');
linux = await extensions.addExtension('xdebug2', '7.2', 'linux');
expect(linux).toContain('add_pecl_extension xdebug 2.9.8 zend_extension');
linux = await extensions.addExtension('xdebug', '7.2', 'openbsd');
expect(linux).toContain('Platform openbsd is not supported');
linux = await extensions.addExtension('phalcon3, phalcon4', '7.3', 'linux');
expect(linux).toContain('add_phalcon phalcon3');
expect(linux).toContain('add_phalcon phalcon4');
linux = await extensions.addExtension('ioncube', '7.3', 'linux');
expect(linux).toContain('add_ioncube');
linux = await extensions.addExtension('geos', '7.3', 'linux');
expect(linux).toContain('add_geos');
linux = await extensions.addExtension('oci8, pdo_oci', '7.3', 'linux');
expect(linux).toContain('add_oci oci8');
expect(linux).toContain('add_oci pdo_oci');
linux = await extensions.addExtension('blackfire', '7.3', 'linux');
expect(linux).toContain('add_blackfire blackfire');
linux = await extensions.addExtension('blackfire-1.31.0', '7.3', 'linux');
expect(linux).toContain('add_blackfire blackfire-1.31.0');
linux = await extensions.addExtension('intl-65.1', '5.6', 'linux');
expect(linux).toContain('add_intl intl-65.1');
linux = await extensions.addExtension('intl-67.1', '7.3', 'linux');
expect(linux).toContain('add_intl intl-67.1');
linux = await extensions.addExtension('intl-68.2', '8.0', 'linux');
expect(linux).toContain('add_intl intl-68.2');
});
it('checking addExtensionOnDarwin', async () => {
let darwin: string = await extensions.addExtension(
'amqp, Xdebug, pcov, grpc, igbinary, imagick, imap, protobuf, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
'7.2',
'darwin'
);
expect(darwin).toContain('add_brew_extension amqp extension');
expect(darwin).toContain('add_brew_extension xdebug zend_extension');
expect(darwin).toContain('add_brew_extension pcov extension');
expect(darwin).toContain('add_brew_extension grpc extension');
expect(darwin).toContain('add_brew_extension igbinary extension');
expect(darwin).toContain('add_brew_extension imagick extension');
expect(darwin).toContain('add_brew_extension imap extension');
expect(darwin).toContain('add_brew_extension protobuf extension');
expect(darwin).toContain('add_brew_extension swoole extension');
expect(darwin).toContain('add_extension sqlite3');
expect(darwin).toContain('remove_extension intl');
expect(darwin).toContain('add_unstable_extension ast beta extension');
expect(darwin).toContain('add_pecl_extension grpc 1.2.3 extension');
darwin = await extensions.addExtension('phalcon3', '7.0', 'darwin');
expect(darwin).toContain('add_phalcon phalcon3');
darwin = await extensions.addExtension('phalcon4', '7.3', 'darwin');
expect(darwin).toContain('add_phalcon phalcon4');
darwin = await extensions.addExtension('couchbase', '5.6', 'darwin');
expect(darwin).toContain('add_couchbase');
darwin = await extensions.addExtension('couchbase', '7.3', 'darwin');
expect(darwin).toContain('add_couchbase');
darwin = await extensions.addExtension('ioncube', '7.3', 'darwin');
expect(darwin).toContain('add_ioncube');
darwin = await extensions.addExtension('geos', '7.3', 'darwin');
expect(darwin).toContain('add_geos');
darwin = await extensions.addExtension('oci8, pdo_oci', '7.3', 'darwin');
expect(darwin).toContain('add_oci oci8');
expect(darwin).toContain('add_oci pdo_oci');
darwin = await extensions.addExtension('pcov', '5.6', 'darwin');
expect(darwin).toContain(
'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
);
darwin = await extensions.addExtension('pcov', '7.2', 'darwin');
expect(darwin).toContain('add_brew_extension pcov');
darwin = await extensions.addExtension('xdebug', '5.6', 'darwin');
expect(darwin).toContain('add_brew_extension xdebug');
darwin = await extensions.addExtension('xdebug', '7.0', 'darwin');
expect(darwin).toContain('add_brew_extension xdebug');
darwin = await extensions.addExtension('xdebug', '7.2', 'darwin');
expect(darwin).toContain('add_brew_extension xdebug');
darwin = await extensions.addExtension('xdebug2', '7.2', 'darwin');
expect(darwin).toContain('add_brew_extension xdebug2');
darwin = await extensions.addExtension('redis', '5.6', 'darwin');
expect(darwin).toContain('add_extension redis-2.2.8');
darwin = await extensions.addExtension('redis', '7.2', 'darwin');
expect(darwin).toContain('add_extension redis');
darwin = await extensions.addExtension('imagick', '5.5', 'darwin');
expect(darwin).toContain('add_extension imagick');
darwin = await extensions.addExtension('blackfire', '7.3', 'darwin');
expect(darwin).toContain('add_blackfire blackfire');
darwin = await extensions.addExtension('blackfire-1.31.0', '7.3', 'darwin');
expect(darwin).toContain('add_blackfire blackfire-1.31.0');
darwin = await extensions.addExtension(
'does_not_exist',
'7.2',
'darwin',
false
);
expect(darwin).toContain('add_extension does_not_exist');
darwin = await extensions.addExtension('xdebug', '7.2', 'openbsd');
expect(darwin).toContain('Platform openbsd is not supported');
});
});

View File

@ -1,6 +1,175 @@
let a = '2';
describe('Finder tests', () => {
it('checking 2', async () => {
expect(a).toBe('2');
import * as install from '../src/install';
import * as utils from '../src/utils';
/**
* Mock install.ts
*/
jest.mock('../src/install', () => ({
getScript: jest.fn().mockImplementation(
async (
filename: string,
version: string,
os_version: string
): Promise<string> => {
const extension_csv: string = process.env['extensions'] || '';
const ini_values_csv: string = process.env['ini-values'] || '';
const coverage_driver: string = process.env['coverage'] || '';
let tools_csv: string = process.env['tools'] || '';
const pecl: string = process.env['pecl'] || '';
if (pecl == 'true') {
tools_csv = 'pecl, ' + tools_csv;
}
let script = 'initial script ' + filename + version + os_version;
if (tools_csv) {
script += 'add_tool';
}
if (extension_csv) {
script += 'install extensions';
}
if (coverage_driver) {
script += 'set coverage driver';
}
if (ini_values_csv) {
script += 'edit php.ini';
}
return script;
}
),
run: jest.fn().mockImplementation(
async (): Promise<string> => {
const os_version: string = process.env['RUNNER_OS'] || '';
const version: string = await utils.parseVersion(
await utils.getInput('php-version', true)
);
const tool = await utils.scriptTool(os_version);
const filename = os_version + (await utils.scriptExtension(os_version));
return [
await install.getScript(filename, version, os_version),
tool,
filename,
version,
__dirname
].join(' ');
}
)
}));
/**
* Function to set the process.env
*
* @param version
* @param os
* @param extension_csv
* @param ini_values_csv
* @param coverage_driver
* @param tools
*/
function setEnv(
version: string | number,
os: string,
extension_csv: string,
ini_values_csv: string,
coverage_driver: string,
tools: string
): void {
process.env['php-version'] = version.toString();
process.env['RUNNER_OS'] = os;
process.env['extensions'] = extension_csv;
process.env['ini-values'] = ini_values_csv;
process.env['coverage'] = coverage_driver;
process.env['tools'] = tools;
}
describe('Install', () => {
it('Test install on windows', async () => {
setEnv('7.0', 'win32', '', '', '', '');
let script: string = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('pwsh win32.ps1 7.0 ' + __dirname);
setEnv('7.3', 'win32', '', '', '', '');
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('pwsh win32.ps1 7.3 ' + __dirname);
setEnv('7.3', 'win32', 'a, b', 'a=b', 'x', '');
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
expect(script).toContain('pwsh win32.ps1 7.3 ' + __dirname);
});
it('Test install on linux', async () => {
setEnv('7.3', 'linux', '', '', '', '');
let script: string = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash linux.sh 7.3 ');
setEnv('latest', 'linux', '', '', '', '');
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash linux.sh 8.0 ');
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit');
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
expect(script).toContain('bash linux.sh 7.3');
expect(script).toContain('add_tool');
});
it('Test install on darwin', async () => {
setEnv('7.3', 'darwin', '', '', '', '');
let script: string = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash darwin.sh 7.3 ' + __dirname);
setEnv('7.3', 'darwin', 'a, b', 'a=b', 'x', '');
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
expect(script).toContain('bash darwin.sh 7.3 ' + __dirname);
});
it('Test malformed version inputs', async () => {
setEnv('7.4.1', 'darwin', '', '', '', '');
let script: string = '' + '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash darwin.sh 7.4 ' + __dirname);
setEnv(8.0, 'darwin', '', '', '', '');
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash darwin.sh 8.0 ' + __dirname);
setEnv(8, 'darwin', '', '', '', '');
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash darwin.sh 8.0 ' + __dirname);
setEnv(8.1, 'darwin', '', '', '', '');
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash darwin.sh 8.1 ' + __dirname);
});
});

684
__tests__/tools.test.ts Normal file
View File

@ -0,0 +1,684 @@
import * as tools from '../src/tools';
describe('Tools tests', () => {
it('checking parseToolVersion', async () => {
expect(await tools.getToolVersion('latest')).toBe('latest');
expect(await tools.getToolVersion('1.2.3')).toBe('1.2.3');
expect(await tools.getToolVersion('^1.2.3')).toBe('1.2.3');
expect(await tools.getToolVersion('>=1.2.3')).toBe('1.2.3');
expect(await tools.getToolVersion('>1.2.3')).toBe('1.2.3');
expect(await tools.getToolVersion('1.2.3-ALPHA')).toBe('1.2.3-ALPHA');
expect(await tools.getToolVersion('1.2.3-alpha')).toBe('1.2.3-alpha');
expect(await tools.getToolVersion('1.2.3-beta')).toBe('1.2.3-beta');
expect(await tools.getToolVersion('1.2.3-rc')).toBe('1.2.3-rc');
expect(await tools.getToolVersion('1.2.3-dev')).toBe('1.2.3-dev');
expect(await tools.getToolVersion('1.2.3-alpha1')).toBe('1.2.3-alpha1');
expect(await tools.getToolVersion('1.2.3-alpha.1')).toBe('1.2.3-alpha.1');
});
it('checking parseToolVersion', async () => {
expect(await tools.parseTool('phpunit')).toStrictEqual({
name: 'phpunit',
version: 'latest'
});
expect(await tools.parseTool('phpunit:1.2.3')).toStrictEqual({
name: 'phpunit',
version: '1.2.3'
});
expect(await tools.parseTool('phpunit:^1.2.3')).toStrictEqual({
name: 'phpunit',
version: '1.2.3'
});
expect(await tools.parseTool('phpunit:>=1.2.3')).toStrictEqual({
name: 'phpunit',
version: '1.2.3'
});
expect(await tools.parseTool('phpunit:>1.2.3')).toStrictEqual({
name: 'phpunit',
version: '1.2.3'
});
expect(await tools.parseTool('phpunit:1.2.3-ALPHA')).toStrictEqual({
name: 'phpunit',
version: '1.2.3-ALPHA'
});
expect(await tools.parseTool('phpunit:1.2.3-alpha')).toStrictEqual({
name: 'phpunit',
version: '1.2.3-alpha'
});
expect(await tools.parseTool('phpunit:1.2.3-beta')).toStrictEqual({
name: 'phpunit',
version: '1.2.3-beta'
});
expect(await tools.parseTool('phpunit:1.2.3-rc')).toStrictEqual({
name: 'phpunit',
version: '1.2.3-rc'
});
expect(await tools.parseTool('phpunit:1.2.3-dev')).toStrictEqual({
name: 'phpunit',
version: '1.2.3-dev'
});
expect(await tools.parseTool('phpunit:1.2.3-alpha1')).toStrictEqual({
name: 'phpunit',
version: '1.2.3-alpha1'
});
expect(await tools.parseTool('phpunit:1.2.3-alpha.1')).toStrictEqual({
name: 'phpunit',
version: '1.2.3-alpha.1'
});
});
it('checking getUri', async () => {
expect(
await tools.getUri('tool', '.phar', 'latest', 'releases', '', 'download')
).toBe('releases/latest/download/tool.phar');
expect(
await tools.getUri('tool', '.phar', '1.2.3', 'releases', '', 'download')
).toBe('releases/download/1.2.3/tool.phar');
expect(
await tools.getUri('tool', '.phar', '1.2.3', 'releases', 'v', 'download')
).toBe('releases/download/v1.2.3/tool.phar');
});
it('checking getCodeceptionUriBuilder', async () => {
expect(await tools.getCodeceptionUriBuilder('3.2.1', 'php56')).toBe(
'releases/3.2.1/php56/codecept.phar'
);
expect(await tools.getCodeceptionUriBuilder('3.2.1', 'php54')).toBe(
'releases/3.2.1/php54/codecept.phar'
);
expect(await tools.getCodeceptionUriBuilder('3.2.1', '')).toBe(
'releases/3.2.1/codecept.phar'
);
});
it('checking getCodeceptionUri', async () => {
expect(await tools.getCodeceptionUri('latest', '5.6')).toBe(
'php56/codecept.phar'
);
expect(await tools.getCodeceptionUri('latest', '7.0')).toBe(
'php56/codecept.phar'
);
expect(await tools.getCodeceptionUri('latest', '7.1')).toBe(
'php56/codecept.phar'
);
expect(await tools.getCodeceptionUri('latest', '7.2')).toBe(
'codecept.phar'
);
expect(await tools.getCodeceptionUri('latest', '7.3')).toBe(
'codecept.phar'
);
expect(await tools.getCodeceptionUri('latest', '7.4')).toBe(
'codecept.phar'
);
expect(await tools.getCodeceptionUri('4.0.0', '7.4')).toBe(
'releases/4.0.0/codecept.phar'
);
expect(await tools.getCodeceptionUri('4.0.0', '5.6')).toBe(
'releases/4.0.0/php56/codecept.phar'
);
expect(await tools.getCodeceptionUri('4.0.0', '7.1')).toBe(
'releases/4.0.0/php56/codecept.phar'
);
expect(await tools.getCodeceptionUri('3.1.0', '7.4')).toBe(
'releases/3.1.0/codecept.phar'
);
expect(await tools.getCodeceptionUri('3.1.0', '5.6')).toBe(
'releases/3.1.0/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.5.4', '7.4')).toBe(
'releases/2.5.4/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.5.4', '5.6')).toBe(
'releases/2.5.4/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.3.4', '7.4')).toBe(
'releases/2.3.4/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.3.4', '5.4')).toBe(
'releases/2.3.4/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.2.4', '5.6')).toBe(
'releases/2.2.4/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.2.4', '7.4')).toBe(
'releases/2.2.4/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.2.4', '5.4')).toBe(
'releases/2.2.4/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.1.7', '5.6')).toBe(
'releases/2.1.7/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.1.7', '5.4')).toBe(
'releases/2.1.7/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.1.5', '5.4')).toBe(
'releases/2.1.5/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.1.5', '7.4')).toBe(
'releases/2.1.5/codecept.phar'
);
expect(await tools.getCodeceptionUri('1.6.9', '7.4')).toBe(
'releases/1.6.9/codecept.phar'
);
expect(await tools.getCodeceptionUri('1.5.0', '7.4')).toBe(
'releases/1.5.0/codecept.phar'
);
});
it('checking addPhive', async () => {
let script: string = await tools.addPhive('1.2.3', '7.4', 'linux');
expect(script).toContain(
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'
);
script = await tools.addPhive('latest', '5.5', 'win32');
expect(script).toContain('Phive is not supported on PHP 5.5');
script = await tools.addPhive('latest', '5.6', 'win32');
expect(script).toContain(
'Add-Tool https://github.com/phar-io/phive/releases/download/0.12.1/phive-0.12.1.phar phive'
);
script = await tools.addPhive('latest', '7.1', 'win32');
expect(script).toContain(
'Add-Tool https://github.com/phar-io/phive/releases/download/0.13.5/phive-0.13.5.phar phive'
);
});
it('checking getPharUri', async () => {
expect(await tools.getPharUrl('domain', 'tool', '', 'latest')).toBe(
'domain/tool.phar'
);
expect(await tools.getPharUrl('domain', 'tool', 'v', '1.2.3')).toBe(
'domain/tool-v1.2.3.phar'
);
});
it('checking getBlackfirePlayerUrl', async () => {
expect(await tools.getBlackfirePlayerUrl('latest', '7.4')).toBe(
'https://get.blackfire.io/blackfire-player.phar'
);
expect(await tools.getBlackfirePlayerUrl('latest', '5.5')).toBe(
'https://get.blackfire.io/blackfire-player-v1.9.3.phar'
);
expect(await tools.getBlackfirePlayerUrl('latest', '7.0')).toBe(
'https://get.blackfire.io/blackfire-player-v1.9.3.phar'
);
expect(await tools.getBlackfirePlayerUrl('1.2.3', '7.0')).toBe(
'https://get.blackfire.io/blackfire-player-v1.2.3.phar'
);
});
it('checking getDeployerUri', async () => {
expect(await tools.getDeployerUrl('latest')).toBe(
'https://deployer.org/deployer.phar'
);
expect(await tools.getDeployerUrl('1.2.3')).toBe(
'https://deployer.org/releases/v1.2.3/deployer.phar'
);
});
it('checking addComposer', async () => {
expect(await tools.addComposer(['a', 'b'])).toStrictEqual([
'composer',
'a',
'b'
]);
expect(await tools.addComposer(['a', 'b', 'composer'])).toStrictEqual([
'composer',
'a',
'b'
]);
expect(await tools.addComposer(['a', 'b', 'composer:1.2'])).toStrictEqual([
'composer',
'a',
'b'
]);
expect(
await tools.addComposer(['a', 'b', 'composer:1.2.3'])
).toStrictEqual(['composer:1.2.3', 'a', 'b']);
expect(
await tools.addComposer(['a', 'b', 'composer:v1.2.3'])
).toStrictEqual(['composer:1.2.3', 'a', 'b']);
expect(
await tools.addComposer(['a', 'b', 'composer:snapshot'])
).toStrictEqual(['composer:snapshot', 'a', 'b']);
expect(
await tools.addComposer(['a', 'b', 'composer:preview'])
).toStrictEqual(['composer:preview', 'a', 'b']);
expect(
await tools.addComposer(['a', 'b', 'c', 'composer:1'])
).toStrictEqual(['composer:1', 'a', 'b', 'c']);
expect(
await tools.addComposer(['a', 'b', 'c', 'composer:2'])
).toStrictEqual(['composer:2', 'a', 'b', 'c']);
expect(
await tools.addComposer(['a', 'b', 'c', 'composer:v1'])
).toStrictEqual(['composer:1', 'a', 'b', 'c']);
expect(
await tools.addComposer(['a', 'b', 'c', 'composer:v2'])
).toStrictEqual(['composer:2', 'a', 'b', 'c']);
});
it('checking getComposerUrl', async () => {
expect(await tools.getComposerUrl('latest')).toContain(
'https://getcomposer.org/composer-stable.phar'
);
expect(await tools.getComposerUrl('stable')).toContain(
'https://getcomposer.org/composer-stable.phar'
);
expect(await tools.getComposerUrl('snapshot')).toContain(
'https://getcomposer.org/composer.phar'
);
expect(await tools.getComposerUrl('preview')).toContain(
'https://getcomposer.org/composer-preview.phar'
);
expect(await tools.getComposerUrl('1')).toContain(
'https://getcomposer.org/composer-1.phar'
);
expect(await tools.getComposerUrl('2')).toContain(
'https://getcomposer.org/composer-2.phar'
);
expect(await tools.getComposerUrl('1.7.2')).toContain(
'https://github.com/composer/composer/releases/download/1.7.2/composer.phar'
);
expect(await tools.getComposerUrl('1.7.2')).toContain(
'https://getcomposer.org/composer-1.7.2.phar'
);
expect(await tools.getComposerUrl('2.0.0-RC2')).toContain(
'https://github.com/composer/composer/releases/download/2.0.0-RC2/composer.phar'
);
expect(await tools.getComposerUrl('2.0.0-RC2')).toContain(
'https://getcomposer.org/composer-2.0.0-RC2.phar'
);
expect(await tools.getComposerUrl('wrong')).toContain(
'https://getcomposer.org/composer-stable.phar'
);
});
it('checking getSymfonyUri', async () => {
expect(await tools.getSymfonyUri('latest', 'linux')).toContain(
'releases/latest/download/symfony_linux_amd64'
);
expect(await tools.getSymfonyUri('1.2.3', 'linux')).toContain(
'releases/download/v1.2.3/symfony_linux_amd64'
);
expect(await tools.getSymfonyUri('latest', 'darwin')).toContain(
'releases/latest/download/symfony_darwin_amd64'
);
expect(await tools.getSymfonyUri('1.2.3', 'darwin')).toContain(
'releases/download/v1.2.3/symfony_darwin_amd64'
);
expect(await tools.getSymfonyUri('latest', 'win32')).toContain(
'releases/latest/download/symfony_windows_amd64'
);
expect(await tools.getSymfonyUri('1.2.3', 'win32')).toContain(
'releases/download/v1.2.3/symfony_windows_amd64'
);
expect(await tools.getSymfonyUri('1.2.3', 'openbsd')).toContain(
'Platform openbsd is not supported'
);
});
it('checking getCleanedToolsList', async () => {
const tools_list: string[] = await tools.getCleanedToolsList(
'tool, composer:1.2, behat/behat, icanhazstring/composer-unused, laravel/vapor-cli, robmorgan/phinx, phpspec/phpspec, symfony/flex'
);
expect(tools_list).toStrictEqual([
'composer',
'tool',
'behat',
'composer-unused',
'vapor-cli',
'phinx',
'phpspec',
'flex'
]);
});
it('checking getWpCliUri', async () => {
expect(await tools.getWpCliUrl('latest')).toBe(
'wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true'
);
expect(await tools.getWpCliUrl('2.4.0')).toBe(
'wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar'
);
});
it('checking addArchive', async () => {
let script: string = await tools.addArchive(
'tool',
'https://tool.com/tool.phar',
'linux',
'-v'
);
expect(script).toContain('add_tool https://tool.com/tool.phar tool');
script = await tools.addArchive(
'tool',
'https://tool.com/tool.phar',
'darwin',
'-v'
);
expect(script).toContain('add_tool https://tool.com/tool.phar tool');
script = await tools.addArchive(
'tool',
'https://tool.com/tool.phar',
'win32',
'-v'
);
expect(script).toContain('Add-Tool https://tool.com/tool.phar tool');
script = await tools.addArchive(
'tool',
'https://tool.com/tool.phar',
'openbsd',
'-v'
);
expect(script).toContain('Platform openbsd is not supported');
});
it('checking addDevTools', async () => {
let script: string = await tools.addDevTools('phpize', 'linux');
expect(script).toContain('add_devtools phpize');
script = await tools.addDevTools('php-config', 'linux');
expect(script).toContain('add_devtools php-config');
script = await tools.addDevTools('phpize', 'darwin');
expect(script).toContain('add_devtools phpize');
script = await tools.addDevTools('php-config', 'darwin');
expect(script).toContain('add_devtools php-config');
script = await tools.addDevTools('phpize', 'win32');
expect(script).toContain(
'Add-Log "$tick" "phpize" "phpize is not a windows tool"'
);
script = await tools.addDevTools('php-config', 'win32');
expect(script).toContain(
'Add-Log "$tick" "php-config" "php-config is not a windows tool"'
);
script = await tools.addDevTools('tool', 'openbsd');
expect(script).toContain('Platform openbsd is not supported');
});
it('checking addPackage', async () => {
let script: string = await tools.addPackage(
'tool',
'tool:1.2.3',
'user/',
'linux'
);
expect(script).toContain('add_composertool tool tool:1.2.3 user/');
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'darwin');
expect(script).toContain('add_composertool tool tool:1.2.3 user/');
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'win32');
expect(script).toContain('Add-Composertool tool tool:1.2.3 user/');
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'openbsd');
expect(script).toContain('Platform openbsd is not supported');
});
it('checking addTools on linux', async () => {
const script: string = await tools.addTools(
'blackfire, blackfire-player, cs2pr, flex, grpc_php_plugin, php-cs-fixer, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, php-config, phpize, protoc, symfony, wp-cli',
'7.4',
'linux'
);
expect(script).toContain('add_blackfire');
expect(script).toContain(
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"'
);
expect(script).toContain(
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
);
expect(script).toContain(
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"'
);
expect(script).toContain(
'add_tool https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/latest/download/php-cs-fixer.phar php-cs-fixer "-V"'
);
expect(script).toContain(
'add_tool https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar phpstan "-V"'
);
expect(script).toContain(
'add_tool https://www.phing.info/get/phing-latest.phar phing "-v"'
);
expect(script).toContain(
'add_tool https://phar.io/releases/phive.phar phive status'
);
expect(script).toContain(
'add_tool https://phar.phpunit.de/phpunit.phar phpunit "--version"'
);
expect(script).toContain(
'add_tool https://github.com/symfony/cli/releases/latest/download/symfony_linux_amd64 symfony version'
);
expect(script).toContain(
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
);
expect(script).toContain('add_protoc latest');
expect(script).toContain('add_grpc_php_plugin latest');
expect(script).toContain('add_pecl');
expect(script).toContain('add_composertool flex flex symfony/');
expect(script).toContain('add_composertool phinx phinx robmorgan/');
expect(script).toContain('add_composertool phplint phplint overtrue/');
expect(script).toContain('add_composertool phinx phinx:1.2.3 robmorgan/');
expect(script).toContain('add_devtools php-config');
expect(script).toContain('add_devtools phpize');
});
it('checking addTools on darwin', async () => {
const listOfTools = [
'behat',
'blackfire',
'blackfire-player',
'composer-normalize',
'composer-require-checker',
'composer-unused',
'cs2pr:1.2.3',
'flex',
'grpc_php_plugin:1.2.3',
'infection',
'phan',
'phan:2.7.2',
'phing:1.2.3',
'phinx',
'phive:1.2.3',
'php-config',
'phpcbf',
'phpcpd',
'phpcs',
'phpize',
'phpmd',
'phpspec',
'protoc:v1.2.3',
'psalm',
'symfony',
'symfony:1.2.3',
'vapor-cli',
'wp-cli'
];
const script: string = await tools.addTools(
listOfTools.join(', '),
'7.4',
'darwin'
);
expect(script).toContain('add_blackfire');
expect(script).toContain(
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"'
);
expect(script).toContain(
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
);
expect(script).toContain(
'add_tool https://github.com/ergebnis/composer-normalize/releases/latest/download/composer-normalize.phar composer-normalize "-V"'
);
expect(script).toContain(
'add_tool https://github.com/maglnet/ComposerRequireChecker/releases/latest/download/composer-require-checker.phar composer-require-checker "-V"'
);
expect(script).toContain(
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr "-V"'
);
expect(script).toContain(
'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection "-V"'
);
expect(script).toContain(
'add_tool https://github.com/phan/phan/releases/latest/download/phan.phar phan "-v"'
);
expect(script).toContain(
'add_tool https://www.phing.info/get/phing-1.2.3.phar phing "-v"'
);
expect(script).toContain(
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs "--version"'
);
expect(script).toContain(
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcbf.phar phpcbf "--version"'
);
expect(script).toContain(
'add_tool https://phar.phpunit.de/phpcpd.phar phpcpd "--version"'
);
expect(script).toContain(
'add_tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"'
);
expect(script).toContain(
'https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm "-v"'
);
expect(script).toContain('add_grpc_php_plugin 1.2.3');
expect(script).toContain('add_protoc 1.2.3');
expect(script).toContain('add_composertool behat behat behat/');
expect(script).toContain('add_composertool phpspec phpspec phpspec/');
expect(script).toContain('add_composertool vapor-cli vapor-cli laravel/');
expect(script).toContain('add_composertool flex flex symfony/');
expect(script).toContain('add_composertool phinx phinx robmorgan/');
expect(script).toContain(
'add_tool https://github.com/phan/phan/releases/download/2.7.2/phan.phar phan "-v"'
);
expect(script).toContain(
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'
);
expect(script).toContain(
'add_composertool composer-unused composer-unused icanhazstring/'
);
expect(script).toContain(
'add_tool https://github.com/symfony/cli/releases/latest/download/symfony_darwin_amd64 symfony version'
);
expect(script).toContain(
'add_tool https://github.com/symfony/cli/releases/download/v1.2.3/symfony_darwin_amd64 symfony version'
);
expect(script).toContain(
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
);
expect(script).toContain('add_devtools phpize');
expect(script).toContain('add_devtools php-config');
});
it('checking addTools on windows', async () => {
const listOfTools = [
'blackfire',
'blackfire-player:1.8.1',
'codeception',
'cs2pr',
'deployer',
'does_not_exist',
'flex',
'phinx',
'phive:0.13.2',
'php-config',
'phpize',
'phpmd',
'symfony',
'wp-cli'
];
const script: string = await tools.addTools(
listOfTools.join(', '),
'7.4',
'win32'
);
expect(script).toContain('Add-Blackfire');
expect(script).toContain(
'Add-Tool https://get.blackfire.io/blackfire-player-v1.8.1.phar blackfire-player "-V"'
);
expect(script).toContain(
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
);
expect(script).toContain(
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"'
);
expect(script).toContain('Add-Composertool flex flex symfony/');
expect(script).toContain(
'Add-Tool https://deployer.org/deployer.phar deployer "-V"'
);
expect(script).toContain(
'Add-Tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"'
);
expect(script).toContain('Add-Composertool phinx phinx robmorgan/');
expect(script).toContain(
'Add-Tool https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar phive status'
);
expect(script).toContain(
'Add-Tool https://github.com/symfony/cli/releases/latest/download/symfony_windows_amd64.exe symfony version'
);
expect(script).toContain(
'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
);
expect(script).toContain('phpize is not a windows tool');
expect(script).toContain('php-config is not a windows tool');
expect(script).toContain('Tool does_not_exist is not supported');
});
it('checking addTools with composer tool using user/tool as input', async () => {
const listOfTools = [
'composer:v1',
'hirak/prestissimo',
'narrowspark/automatic-composer-prefetcher',
'robmorgan/phinx'
];
const script: string = await tools.addTools(
listOfTools.join(', '),
'7.4',
'win32'
);
expect(script).toContain(
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-1.phar,https://getcomposer.org/composer-1.phar composer'
);
expect(script).toContain('Add-Composertool prestissimo prestissimo hirak/');
expect(script).toContain('Add-Composertool phinx phinx robmorgan/');
expect(script).toContain(
'Add-Composertool composer-prefetcher composer-prefetcher narrowspark/automatic-'
);
});
it('checking composer setup', async () => {
const listOfTools = ['composer', 'composer:v1'];
let script: string = await tools.addTools(
listOfTools.join(', '),
'7.4',
'linux'
);
expect(script).toContain(
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-1.phar,https://getcomposer.org/composer-1.phar composer'
);
script = await tools.addTools('composer:preview', '7.4', 'linux');
expect(script).toContain(
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-preview.phar,https://getcomposer.org/composer-preview.phar composer preview'
);
script = await tools.addTools(
'composer:v1, composer:preview, composer:snapshot',
'7.4',
'linux'
);
expect(script).toContain(
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-snapshot.phar,https://getcomposer.org/composer.phar composer snapshot'
);
});
});

262
__tests__/utils.test.ts Normal file
View File

@ -0,0 +1,262 @@
import * as fs from 'fs';
import * as path from 'path';
import * as utils from '../src/utils';
jest.mock('@actions/core', () => ({
getInput: jest.fn().mockImplementation(key => {
return ['setup-php'].indexOf(key) !== -1 ? key : '';
})
}));
jest.spyOn(utils, 'fetch').mockImplementation(
async (url): Promise<string> => {
return `{ "latest": "8.0", "5.x": "5.6", "url": "${url}" }`;
}
);
async function cleanup(path: string): Promise<void> {
fs.unlink(path, error => {
if (error) {
console.log(error);
}
});
}
describe('Utils tests', () => {
it('checking readEnv', async () => {
process.env['test'] = 'setup-php';
expect(await utils.readEnv('test')).toBe('setup-php');
expect(await utils.readEnv('undefined')).toBe('');
});
it('checking getInput', async () => {
process.env['test'] = 'setup-php';
expect(await utils.getInput('test', false)).toBe('setup-php');
expect(await utils.getInput('setup-php', false)).toBe('setup-php');
expect(await utils.getInput('DoesNotExist', false)).toBe('');
expect(async () => {
await utils.getInput('DoesNotExist', true);
}).rejects.toThrow('Input required and not supplied: DoesNotExist');
});
it('checking fetch', async () => {
expect(await utils.fetch('test_url')).toBe(
'{ "latest": "8.0", "5.x": "5.6", "url": "test_url" }'
);
});
it('checking parseVersion', async () => {
expect(await utils.parseVersion('latest')).toBe('8.0');
expect(await utils.parseVersion('7')).toBe('7.0');
expect(await utils.parseVersion('7.4')).toBe('7.4');
expect(await utils.parseVersion('5.x')).toBe('5.6');
expect(await utils.parseVersion('4.x')).toBe(undefined);
});
it('checking asyncForEach', async () => {
const array: Array<string> = ['a', 'b', 'c'];
let concat = '';
await utils.asyncForEach(
array,
async function (str: string): Promise<void> {
concat += str;
}
);
expect(concat).toBe('abc');
});
it('checking asyncForEach', async () => {
expect(await utils.color('error')).toBe('31');
expect(await utils.color('success')).toBe('32');
expect(await utils.color('any')).toBe('32');
expect(await utils.color('warning')).toBe('33');
});
it('checking readScripts', async () => {
const darwin: string = fs.readFileSync(
path.join(__dirname, '../src/scripts/darwin.sh'),
'utf8'
);
const linux: string = fs.readFileSync(
path.join(__dirname, '../src/scripts/linux.sh'),
'utf8'
);
const win32: string = fs.readFileSync(
path.join(__dirname, '../src/scripts/win32.ps1'),
'utf8'
);
expect(await utils.readScript('darwin.sh')).toBe(darwin);
expect(await utils.readScript('darwin.sh')).toBe(darwin);
expect(await utils.readScript('linux.sh')).toBe(linux);
expect(await utils.readScript('linux.sh')).toBe(linux);
expect(await utils.readScript('win32.ps1')).toBe(win32);
expect(await utils.readScript('win32.ps1')).toBe(win32);
});
it('checking writeScripts', async () => {
const testString = 'sudo apt-get install php';
const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
const script_path: string = path.join(runner_dir, 'test.sh');
await utils.writeScript('test.sh', testString);
await fs.readFile(
script_path,
function (error: Error | null, data: Buffer) {
expect(testString).toBe(data.toString());
}
);
await cleanup(script_path);
});
it('checking extensionArray', async () => {
expect(await utils.extensionArray('a, b, php_c, php-d')).toEqual([
'a',
'b',
'c',
'd'
]);
expect(await utils.extensionArray('')).toEqual([]);
expect(await utils.extensionArray(' ')).toEqual([]);
});
it('checking INIArray', async () => {
expect(await utils.CSVArray('a=1, b=2, c=3')).toEqual([
'a=1',
'b=2',
'c=3'
]);
expect(await utils.CSVArray('\'a=1,2\', "b=3, 4", c=5, d=~e~')).toEqual([
'a=1,2',
'b=3, 4',
'c=5',
"d='~e~'"
]);
expect(await utils.CSVArray('a=\'1,2\', b="3, 4", c=5')).toEqual([
'a=1,2',
'b=3, 4',
'c=5'
]);
expect(
await utils.CSVArray('a=E_ALL, b=E_ALL & ~ E_ALL, c="E_ALL", d=\'E_ALL\'')
).toEqual(['a=E_ALL', 'b=E_ALL & ~ E_ALL', 'c=E_ALL', 'd=E_ALL']);
expect(await utils.CSVArray('')).toEqual([]);
expect(await utils.CSVArray(' ')).toEqual([]);
});
it('checking log', async () => {
const message = 'Test message';
let warning_log: string = await utils.log(message, 'win32', 'warning');
expect(warning_log).toEqual('printf "\\033[33;1m' + message + ' \\033[0m"');
warning_log = await utils.log(message, 'linux', 'warning');
expect(warning_log).toEqual('echo "\\033[33;1m' + message + '\\033[0m"');
warning_log = await utils.log(message, 'darwin', 'warning');
expect(warning_log).toEqual('echo "\\033[33;1m' + message + '\\033[0m"');
let error_log: string = await utils.log(message, 'win32', 'error');
expect(error_log).toEqual('printf "\\033[31;1m' + message + ' \\033[0m"');
error_log = await utils.log(message, 'linux', 'error');
expect(error_log).toEqual('echo "\\033[31;1m' + message + '\\033[0m"');
error_log = await utils.log(message, 'darwin', 'error');
expect(error_log).toEqual('echo "\\033[31;1m' + message + '\\033[0m"');
let success_log: string = await utils.log(message, 'win32', 'success');
expect(success_log).toEqual('printf "\\033[32;1m' + message + ' \\033[0m"');
success_log = await utils.log(message, 'linux', 'success');
expect(success_log).toEqual('echo "\\033[32;1m' + message + '\\033[0m"');
success_log = await utils.log(message, 'darwin', 'success');
expect(success_log).toEqual('echo "\\033[32;1m' + message + '\\033[0m"');
let step_log: string = await utils.stepLog(message, 'win32');
expect(step_log).toEqual('Step-Log "Test message"');
step_log = await utils.stepLog(message, 'linux');
expect(step_log).toEqual('step_log "Test message"');
step_log = await utils.stepLog(message, 'darwin');
expect(step_log).toEqual('step_log "Test message"');
step_log = await utils.stepLog(message, 'openbsd');
expect(step_log).toContain('Platform openbsd is not supported');
let add_log: string = await utils.addLog(
'tick',
'xdebug',
'enabled',
'win32'
);
expect(add_log).toEqual('Add-Log "tick" "xdebug" "enabled"');
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'linux');
expect(add_log).toEqual('add_log "tick" "xdebug" "enabled"');
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'darwin');
expect(add_log).toEqual('add_log "tick" "xdebug" "enabled"');
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'openbsd');
expect(add_log).toContain('Platform openbsd is not supported');
});
it('checking getExtensionPrefix', async () => {
expect(await utils.getExtensionPrefix('extensionDoesNotExist')).toEqual(
'extension'
);
expect(await utils.getExtensionPrefix('xsl')).toEqual('extension');
expect(await utils.getExtensionPrefix('xdebug')).toEqual('zend_extension');
expect(await utils.getExtensionPrefix('xdebug3')).toEqual('zend_extension');
expect(await utils.getExtensionPrefix('opcache')).toEqual('zend_extension');
});
it('checking suppressOutput', async () => {
expect(await utils.suppressOutput('win32')).toEqual(' >$null 2>&1');
expect(await utils.suppressOutput('linux')).toEqual(' >/dev/null 2>&1');
expect(await utils.suppressOutput('darwin')).toEqual(' >/dev/null 2>&1');
expect(await utils.suppressOutput('openbsd')).toContain(
'Platform openbsd is not supported'
);
});
it('checking getUnsupportedLog', async () => {
expect(await utils.getUnsupportedLog('ext', '5.6', 'linux')).toContain(
'add_log "$cross" "ext" "ext is not supported on PHP 5.6"'
);
});
it('checking getCommand', async () => {
expect(await utils.getCommand('linux', 'tool')).toBe('add_tool ');
expect(await utils.getCommand('darwin', 'tool')).toBe('add_tool ');
expect(await utils.getCommand('win32', 'tool')).toBe('Add-Tool ');
expect(await utils.getCommand('openbsd', 'tool')).toContain(
'Platform openbsd is not supported'
);
});
it('checking joins', async () => {
expect(await utils.joins('a', 'b', 'c')).toBe('a b c');
});
it('checking scriptExtension', async () => {
expect(await utils.scriptExtension('linux')).toBe('.sh');
expect(await utils.scriptExtension('darwin')).toBe('.sh');
expect(await utils.scriptExtension('win32')).toBe('.ps1');
expect(await utils.scriptExtension('openbsd')).toContain(
'Platform openbsd is not supported'
);
});
it('checking scriptTool', async () => {
expect(await utils.scriptTool('linux')).toBe('bash');
expect(await utils.scriptTool('darwin')).toBe('bash');
expect(await utils.scriptTool('win32')).toBe('pwsh');
expect(await utils.scriptTool('openbsd')).toContain(
'Platform openbsd is not supported'
);
});
it('checking customPackage', async () => {
const script_path: string = path.join('ext', 'pkg.sh');
expect(await utils.customPackage('pkg', 'ext', '1.2.3', 'linux')).toContain(
script_path + '\nadd_pkg 1.2.3'
);
expect(
await utils.customPackage('pdo_pkg', 'ext', '1.2.3', 'linux')
).toContain(script_path + '\nadd_pkg 1.2.3');
expect(
await utils.customPackage('pkg8', 'ext', '1.2.3', 'linux')
).toContain(script_path + '\nadd_pkg 1.2.3');
});
});

View File

@ -1,16 +1,26 @@
name: 'Setup PHP Action'
author: shivammathur
description: 'Setup a PHP environment with composer and add it to the PATH'
description: 'GitHub Action for PHP'
branding:
icon: 'activity'
color: 'purple'
icon: 'play-circle'
inputs:
php-version:
description: 'PHP version to be installed.'
description: 'Setup PHP version.'
default: '8.0'
required: true
extension-csv:
description: '(Optional) Comma seperated list of PHP extensions to be installed.'
extensions:
description: 'Setup PHP extensions.'
required: false
ini-values:
description: 'Add values to php.ini.'
required: false
coverage:
description: 'Setup code coverage driver.'
required: false
tools:
description: 'Setup popular tools globally.'
required: false
runs:
using: 'node12'
main: 'lib/install.js'
main: 'dist/index.js'

3188
dist/index.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
# Contributors
Please submit a Pull Request to the develop branch

32
examples/bedrock.yml Normal file
View File

@ -0,0 +1,32 @@
# GitHub Action for roots/bedrock
name: Testing Bedrock
on: [push, pull_request]
jobs:
bedrock:
name: Bedrock (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: PHP test
run: composer test

View File

@ -0,0 +1,31 @@
# GitHub Action for Blackfire Player
name: Play a Blackfire Scenario
on: [push, pull_request]
jobs:
blackfire-player:
name: Blackfire (PHP ${{ matrix.php-versions }})
# Add your Blackfire credentials securely using GitHub Secrets
env:
BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }}
BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4']
# blackfire-player supports PHP >= 5.5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: blackfire
tools: blackfire, blackfire-player #Setup Blackfire client, agent and player
coverage: none
- name: Play the scenario
run: blackfire-player run scenario.bkf # Refer to https://blackfire.io/docs/player/index#usage

31
examples/blackfire.yml Normal file
View File

@ -0,0 +1,31 @@
# GitHub Action for Blackfire
name: Profiling with blackfire
on: [push, pull_request]
jobs:
blackfire:
name: Blackfire (PHP ${{ matrix.php-versions }})
# Add your Blackfire credentials securely using GitHub Secrets
env:
BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }}
BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4']
# Blackfire supports PHP >= 5.3 on ubuntu and macos and PHP >= 5.4 on windows
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: blackfire
tools: blackfire #Setup Blackfire client and agent
coverage: none
- name: Profile
run: blackfire run php my-script.php # Refer to https://blackfire.io/docs/cookbooks/profiling-cli

114
examples/cakephp-mysql.yml Normal file
View File

@ -0,0 +1,114 @@
# GitHub Action for CakePHP with MySQL and Redis
# Tested with https://github.com/cakephp/app
name: Testing CakePHP with MySQL
on: [push, pull_request]
jobs:
tests:
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4']
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: cakephp
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# You can also use ext-apcu or ext-memcached instead of ext-redis
# Install memcached if using ext-memcached
extensions: mbstring, intl, redis, pdo_mysql
coverage: pcov
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
composer run-script post-install-cmd --no-interaction
# Add a step to run migrations if required
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
env:
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DB_DSN: "mysql://root:password@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/cakephp?init[]=SET sql_mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\""
coding-standard:
name: Coding Standard
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: PHP CodeSniffer
run: composer cs-check
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
tools: phpstan
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Static Analysis using PHPStan
run: phpstan analyse --no-progress src/

View File

@ -0,0 +1,112 @@
# GitHub Action for CakePHP with PostgreSQL and Redis
# Tested with https://github.com/cakephp/app
name: Testing CakePHP with PostgreSQL
on: [push, pull_request]
jobs:
tests:
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4']
runs-on: ubuntu-latest
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# You can also use ext-apcu or ext-memcached instead of ext-redis
# Install memcached if using ext-memcached
extensions: mbstring, intl, redis, pdo_pgsql
coverage: pcov
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
composer run-script post-install-cmd --no-interaction
# Add a step to run migrations if required
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
env:
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DB_DSN: postgres://postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres
coding-standard:
name: Coding Standard
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: PHP CodeSniffer
run: composer cs-check
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
tools: phpstan
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Static Analysis using PHPStan
run: phpstan analyse --no-progress src/

92
examples/cakephp.yml Normal file
View File

@ -0,0 +1,92 @@
# GitHub Action for CakePHP
# Tested with https://github.com/cakephp/app
name: Testing CakePHP
on: [push, pull_request]
jobs:
tests:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, pdo_sqlite, pdo_mysql
coverage: pcov #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
composer run-script post-install-cmd --no-interaction
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
coding-standard:
name: Coding Standard
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: PHP CodeSniffer
run: composer cs-check
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
tools: phpstan
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Static Analysis using PHPStan
run: phpstan analyse --no-progress src/

34
examples/codeigniter.yml Normal file
View File

@ -0,0 +1,34 @@
# GitHub Action for CodeIgniter
name: Testing CodeIgniter
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, curl, dom
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text

View File

@ -0,0 +1,74 @@
# GitHub Action for Laravel with MySQL and Redis
name: Testing Laravel with MySQL
on: [push, pull_request]
jobs:
laravel:
name: Laravel (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
DB_DATABASE: laravel
DB_USERNAME: root
DB_PASSWORD: password
BROADCAST_DRIVER: log
CACHE_DRIVER: redis
QUEUE_CONNECTION: redis
SESSION_DRIVER: redis
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: laravel
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.example', '.env');"
php artisan key:generate
- name: Clear Config
run: php artisan config:clear
- name: Run Migration
run: php artisan migrate -v
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

View File

@ -0,0 +1,74 @@
# GitHub Action for Laravel with PostgreSQL and Redis
name: Testing Laravel with PostgreSQL
on: [push, pull_request]
jobs:
laravel:
name: Laravel (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
BROADCAST_DRIVER: log
CACHE_DRIVER: redis
QUEUE_CONNECTION: redis
SESSION_DRIVER: redis
DB_CONNECTION: pgsql
DB_HOST: localhost
DB_PASSWORD: postgres
DB_USERNAME: postgres
DB_DATABASE: postgres
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, pgsql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.example', '.env');"
php artisan key:generate
- name: Clear Config
run: php artisan config:clear
- name: Run Migration
run: php artisan migrate -v
env:
DB_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
env:
DB_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

42
examples/laravel.yml Normal file
View File

@ -0,0 +1,42 @@
# GitHub Action for Laravel
name: Testing Laravel
on: [push, pull_request]
jobs:
laravel:
name: Laravel (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.example', '.env');"
php artisan key:generate
- name: Clear Config
run: php artisan config:clear
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text

74
examples/lumen-mysql.yml Normal file
View File

@ -0,0 +1,74 @@
# GitHub Action for Lumen with MySQL and Redis
name: Testing Lumen with MySQL
on: [push, pull_request]
jobs:
lumen:
name: Lumen (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
DB_DATABASE: lumen
DB_USERNAME: root
DB_PASSWORD: password
BROADCAST_DRIVER: log
CACHE_DRIVER: redis
QUEUE_CONNECTION: redis
SESSION_DRIVER: redis
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: lumen
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
composer require predis/predis illuminate/redis
- name: Prepare the application
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Register Redis as service provider
run: sed -i '$i\$app->register(Illuminate\\Redis\\RedisServiceProvider::class);' bootstrap/app.php
- name: Run Migration
run: php artisan migrate -v
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

View File

@ -0,0 +1,74 @@
# GitHub Action for Lumen with PostgreSQL and Redis
name: Testing Lumen with PostgreSQL
on: [push, pull_request]
jobs:
laravel:
name: Lumen (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
BROADCAST_DRIVER: log
CACHE_DRIVER: redis
QUEUE_CONNECTION: redis
SESSION_DRIVER: redis
DB_CONNECTION: pgsql
DB_HOST: localhost
DB_PASSWORD: postgres
DB_USERNAME: postgres
DB_DATABASE: postgres
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, pgsql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
composer require predis/predis illuminate/redis
- name: Prepare the application
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Register Redis as service provider
run: sed -i '$i\$app->register(Illuminate\\Redis\\RedisServiceProvider::class);' bootstrap/app.php
- name: Run Migration
run: php artisan migrate -v
env:
DB_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
env:
DB_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

38
examples/lumen.yml Normal file
View File

@ -0,0 +1,38 @@
# GitHub Action for Lumen
name: Unit Testing Lumen
on: [push, pull_request]
jobs:
lumen:
name: Lumen (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text

View File

@ -0,0 +1,74 @@
# GitHub Action for Phalcon with MySQL
## Notes
## Make sure you have .env.example or .env file in your project
## and you have loaded Dotenv (https://github.com/vlucas/phpdotenv)
name: Testing Phalcon with MySQL
on: [push, pull_request]
jobs:
phalcon:
name: Phalcon (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
DB_ADAPTER: mysql
DB_HOST: 127.0.0.1
DB_NAME: phalcon
DB_USERNAME: root
DB_PASSWORD: password
CODECEPTION_URL: 127.0.0.1
CODECEPTION_PORT: 8888
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: phalcon
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
# For phalcon 3.x, use
# php-versions: ['7.0', '7.1', '7.2', '7.3']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, zip, phalcon4, mysql #use phalcon3 for the phalcon 3.x.
coverage: xdebug #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Run Migration
run: |
if [ ! -e phinx.yml ]; then vendor/bin/phinx init; fi
vendor/bin/phinx migrate
vendor/bin/phinx seed:run
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Run Tests
run: |
(cd public && nohup php -S $CODECEPTION_URL:$CODECEPTION_PORT > phalcon.log 2>&1 &)
vendor/bin/codecept build
vendor/bin/codecept run
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}

View File

@ -0,0 +1,73 @@
# GitHub Action for Phalcon with PostgreSQL
## Notes
## Make sure you have .env.example or .env file in your project
## and you have loaded Dotenv (https://github.com/vlucas/phpdotenv)
name: Testing Phalcon with PostgreSQL
on: [push, pull_request]
jobs:
phalcon:
name: Phalcon (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
DB_ADAPTER: pgsql
DB_HOST: 127.0.0.1
DB_NAME: postgres
DB_USERNAME: postgres
DB_PASSWORD: postgres
CODECEPTION_URL: 127.0.0.1
CODECEPTION_PORT: 8888
DB_CONNECTION: pgsql
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
# For phalcon 3.x, use
# php-versions: ['7.0', '7.1', '7.2', '7.3']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, zip, phalcon4, pgsql #use phalcon3 for the phalcon 3.x
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Run Migration
run: |
if [ ! -e phinx.yml ]; then vendor/bin/phinx init; fi
vendor/bin/phinx migrate
vendor/bin/phinx seed:run
env:
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
- name: Run Tests
run: |
(cd public && nohup php -S $CODECEPTION_URL:$CODECEPTION_PORT > phalcon.log 2>&1 &)
vendor/bin/codecept build
vendor/bin/codecept run
env:
DB_PORT: ${{ job.services.postgres.ports['5432'] }}

57
examples/sage.yml Normal file
View File

@ -0,0 +1,57 @@
# GitHub Action for roots/sage
name: Testing Sage
on: [push, pull_request]
jobs:
sage:
name: Sage (PHP ${{ matrix.php-versions }} & Node ${{ matrix.node-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4']
node-versions: ['8', '10']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-versions }}
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
- name: Check node versions
run: node -v
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install yarn dependencies
run: yarn -V
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Yarn test and build
run: |
yarn run test
yarn run build
yarn run rmdist
yarn run "build:production"
- name: PHP test
run: composer test

View File

@ -0,0 +1,34 @@
# GitHub Action for Slim Framework
name: Testing Slim Framework
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, simplexml, dom
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text

View File

@ -0,0 +1,56 @@
# GitHub Action for Symfony with MySQL
name: Testing Symfony with MySQL
on: [push, pull_request]
jobs:
symfony:
name: Symfony (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: symfony
MYSQL_DATABASE: symfony
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql
coverage: xdebug #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer require --dev symfony/orm-pack symfony/phpunit-bridge
composer install --no-progress --prefer-dist --optimize-autoloader
php bin/phpunit install
- name: Run Migration
run: |
php bin/console doctrine:schema:update --force || echo "No migrations found or schema update failed"
php bin/console doctrine:migrations:migrate || echo "No migrations found or migration failed"
env:
DATABASE_URL: mysql://root:symfony@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/symfony
- name: Run Tests
run: php bin/phpunit --coverage-text

View File

@ -0,0 +1,54 @@
# GitHub Action for Symfony with PostgreSQL
name: Testing Symfony with PostgreSQL
on: [push, pull_request]
jobs:
symfony:
name: Symfony (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
strategy:
fail-fast: false
matrix:
php-versions: ['7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer require --dev symfony/orm-pack symfony/phpunit-bridge
composer install --no-progress --prefer-dist --optimize-autoloader
php bin/phpunit install
- name: Run Migration
run: |
php bin/console doctrine:schema:update --force || echo "No migrations found or schema update failed"
php bin/console doctrine:migrations:migrate || echo "No migrations found or migration failed"
env:
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8
- name: Run Tests
run: php bin/phpunit --coverage-text

39
examples/symfony.yml Normal file
View File

@ -0,0 +1,39 @@
# GitHub Action for Symfony
name: Testing Symfony
on: [push, pull_request]
jobs:
symfony:
name: Symfony (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer require --dev symfony/phpunit-bridge
composer install --no-progress --prefer-dist --optimize-autoloader
php bin/phpunit install
- name: Run Tests
run: php bin/phpunit --coverage-text

73
examples/yii2-mysql.yml Normal file
View File

@ -0,0 +1,73 @@
# GitHub Action for Yii Framework with MySQL
name: Testing Yii2 with MySQL
on: [push, pull_request]
jobs:
yii:
name: Yii2 (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
DB_USERNAME: root
DB_PASSWORD: yii
TEST_DB_USERNAME: root
TEST_DB_PASSWORD: yii
DB_CHARSET: utf8
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: yii
MYSQL_DATABASE: yii
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, gd, imagick, zip, dom, mysql
coverage: xdebug #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.dist', '.env');"
php console/yii app/setup
npm install --development
npm run build
env:
DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
TEST_DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
- name: Run Tests
run: |
vendor/bin/codecept build
php tests/bin/yii app/setup --interactive=0
nohup php -S localhost:8080 > yii.log 2>&1 &
vendor/bin/codecept run
env:
DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
TEST_DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii

View File

@ -0,0 +1,71 @@
# GitHub Action for Yii Framework with PostgreSQL
name: Testing Yii2 with PostgreSQL
on: [push, pull_request]
jobs:
yii:
name: Yii2 (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
DB_USERNAME: postgres
DB_PASSWORD: postgres
TEST_DB_USERNAME: postgres
TEST_DB_PASSWORD: postgres
DB_CHARSET: utf8
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, gd, imagick, zip, dom, pgsql
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.dist', '.env');"
php console/yii app/setup
npm install --development
npm run build
env:
DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
TEST_DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
- name: Run Tests
run: |
vendor/bin/codecept build
php tests/bin/yii app/setup --interactive=0
nohup php -S localhost:8080 > yii.log 2>&1 &
vendor/bin/codecept run
env:
DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
TEST_DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres

View File

@ -0,0 +1,36 @@
# GitHub Action for Zend Framework
name: Testing Zend Framework
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, bcmath, curl, intl
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
composer require --dev phpunit/phpunit squizlabs/php_codesniffer zendframework/zend-test
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text

View File

@ -7,5 +7,6 @@ module.exports = {
transform: {
'^.+\\.ts$': 'ts-jest'
},
verbose: true
}
verbose: true,
collectCoverage: true
};

View File

@ -1,205 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const exec_1 = require("@actions/exec/lib/exec");
const path = __importStar(require("path"));
const httpm = __importStar(require("typed-rest-client/HttpClient"));
const fs = __importStar(require("fs"));
/*
Read the scripts
*/
let os_version = process.platform;
let darwin = fs.readFileSync(path.join(__dirname, '../src/darwin.sh'), 'utf8');
let linux = fs.readFileSync(path.join(__dirname, '../src/linux.sh'), 'utf8');
let windows = fs.readFileSync(path.join(__dirname, '../src/windows.ps1'), 'utf8');
/*
Credit: https://github.com/Atinux
*/
function asyncForEach(array, callback) {
return __awaiter(this, void 0, void 0, function* () {
for (let index = 0; index < array.length; index++) {
yield callback(array[index], index, array);
}
});
}
/*
Enable extensions which are installed but not enabled
*/
function enableExtension(extension) {
return __awaiter(this, void 0, void 0, function* () {
windows += `try {
$ext_dir = Get-PhpIniKey extension_dir
$exist = Test-Path -Path $ext_dir\\php_${extension}.dll
$enabled = php -r "if (in_array('${extension}', get_loaded_extensions())) {echo 'yes';} else {echo 'no';}"
if($enabled -eq 'no' -and $exist) {
Enable-PhpExtension ${extension} C:\\tools\\php$version
}
} catch [Exception] {
echo $_
}\n`;
let shell_code = `ext_dir=$(php-config --extension-dir)
enabled=$(php -r "if (in_array('${extension}', get_loaded_extensions())) {echo 'yes';} else {echo 'no';}")
if [ "$enabled" = "no" ] && [ -e "$ext_dir/${extension}.so" ]; then
echo "extension=${extension}.so" >> 'php -i | grep "Loaded Configuration" | sed -e "s|.*=>\s*||"'
echo "${extension} enabled"
fi\n`;
linux += shell_code;
darwin += shell_code;
});
}
/*
Install and enable extensions
*/
function addExtension(extension_csv, version) {
return __awaiter(this, void 0, void 0, function* () {
let extensions = extension_csv
.split(',')
.map(function (extension) {
return extension
.trim()
.replace('php-', '')
.replace('php_', '');
});
linux += '\n';
windows += '\n';
darwin += '\n';
yield asyncForEach(extensions, function (extension) {
return __awaiter(this, void 0, void 0, function* () {
// add script to enable extension is already installed along with php
enableExtension(extension);
// else add script to attempt to install the extension
if (os_version == 'linux') {
linux +=
'sudo apt install -y php' +
version +
'-' +
extension +
' || echo "Couldn\'t find extension php' +
version +
'-' +
extension +
'"\n';
}
else {
// check if pecl extension exists
const http = new httpm.HttpClient('shivammathur/php-setup', [], {
allowRetries: true,
maxRetries: 2
});
const response = yield http.get('https://pecl.php.net/package/' + extension);
if (response.message.statusCode == 200) {
let extension_version = 'stable';
if (version == '7.4') {
extension_version = 'alpha';
}
windows +=
'try { Install-PhpExtension ' +
extension +
' -MinimumStability ' +
extension_version +
' } catch [Exception] { echo $_; echo "Could not install extension: "' +
extension +
' }\n';
darwin +=
'pecl install ' +
extension +
' || echo "Couldn\'t find extension: ' +
extension +
'"\n';
}
else {
console.log('Cannot find pecl extension: ' + extension);
}
}
});
});
linux += 'sudo apt autoremove -y';
});
}
/*
Write final script which runs
*/
function createScript(filename, version) {
return __awaiter(this, void 0, void 0, function* () {
let script = '';
if (filename == 'linux.sh') {
script = linux;
}
else if (filename == 'darwin.sh') {
script = darwin;
}
else if (filename == 'windows.ps1') {
script = windows;
}
fs.writeFile(version + filename, script, function (error) {
if (error) {
return console.log(error);
}
console.log('The file was saved!');
});
});
}
/*
Run the script
*/
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
// taking inputs
let version = process.env['php-version'];
if (!version) {
version = core.getInput('php-version', { required: true });
}
console.log('Input: ' + version);
if (version == '7.4') {
darwin = fs.readFileSync(path.join(__dirname, '../src/7.4.sh'), 'utf8');
}
let extension_csv = process.env['extension-csv'];
if (!extension_csv) {
extension_csv = core.getInput('extension-csv');
}
if (extension_csv) {
console.log('Input: ' + extension_csv);
yield addExtension(extension_csv, version);
}
// check the os version and run the respective script
if (os_version == 'darwin') {
yield createScript('darwin.sh', version);
yield exec_1.exec('sudo chmod a+x ' + version + 'darwin.sh');
yield exec_1.exec('sh -x ./' + version + 'darwin.sh ' + version);
}
else if (os_version == 'win32') {
yield createScript('windows.ps1', version);
yield exec_1.exec('powershell .\\' + version + 'windows.ps1 -version ' + version);
}
else if (os_version == 'linux') {
yield createScript('linux.sh', version);
yield exec_1.exec('sudo chmod a+x ' + version + 'linux.sh');
yield exec_1.exec('./' + version + 'linux.sh ' + version);
}
}
catch (err) {
core.setFailed(err.message);
}
});
}
// call the run function
run().then(function () {
console.log('done');
});

15
node_modules/.bin/semver generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
ret=$?
else
node "$basedir/../semver/bin/semver.js" "$@"
ret=$?
fi
exit $ret

7
node_modules/.bin/semver.cmd generated vendored
View File

@ -1,7 +0,0 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\semver\bin\semver.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\semver\bin\semver.js" %*
)

15
node_modules/.bin/tsc generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
ret=$?
else
node "$basedir/../typescript/bin/tsc" "$@"
ret=$?
fi
exit $ret

7
node_modules/.bin/tsc.cmd generated vendored
View File

@ -1,7 +0,0 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\typescript\bin\tsc" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\typescript\bin\tsc" %*
)

15
node_modules/.bin/tsserver generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
ret=$?
else
node "$basedir/../typescript/bin/tsserver" "$@"
ret=$?
fi
exit $ret

7
node_modules/.bin/tsserver.cmd generated vendored
View File

@ -1,7 +0,0 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\typescript\bin\tsserver" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\typescript\bin\tsserver" %*
)

15
node_modules/.bin/uuid generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../uuid/bin/uuid" "$@"
ret=$?
else
node "$basedir/../uuid/bin/uuid" "$@"
ret=$?
fi
exit $ret

7
node_modules/.bin/uuid.cmd generated vendored
View File

@ -1,7 +0,0 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\uuid\bin\uuid" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\uuid\bin\uuid" %*
)

View File

@ -1,7 +0,0 @@
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

97
node_modules/@actions/core/README.md generated vendored
View File

@ -1,97 +0,0 @@
# `@actions/core`
> Core functions for setting results, logging, registering secrets and exporting variables across actions
## Usage
#### Inputs/Outputs
You can use this library to get inputs or set outputs:
```js
const core = require('@actions/core');
const myInput = core.getInput('inputName', { required: true });
// Do stuff
core.setOutput('outputKey', 'outputVal');
```
#### Exporting variables
You can also export variables for future steps. Variables get set in the environment.
```js
const core = require('@actions/core');
// Do stuff
core.exportVariable('envVar', 'Val');
```
#### PATH Manipulation
You can explicitly add items to the path for all remaining steps in a workflow:
```js
const core = require('@actions/core');
core.addPath('pathToTool');
```
#### Exit codes
You should use this library to set the failing exit code for your action:
```js
const core = require('@actions/core');
try {
// Do stuff
}
catch (err) {
// setFailed logs the message and sets a failing exit code
core.setFailed(`Action failed with error ${err}`);
}
```
#### Logging
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
```js
const core = require('@actions/core');
const myInput = core.getInput('input');
try {
core.debug('Inside try block');
if (!myInput) {
core.warning('myInput was not set');
}
// Do stuff
}
catch (err) {
core.error(`Error ${err}, action may still succeed though`);
}
```
This library can also wrap chunks of output in foldable groups.
```js
const core = require('@actions/core')
// Manually wrap output
core.startGroup('Do some function')
doSomeFunction()
core.endGroup()
// Wrap an asynchronous function call
const result = await core.group('Do something async', async () => {
const response = await doSomeHTTPRequest()
return response
})
```

View File

@ -1,16 +0,0 @@
interface CommandProperties {
[key: string]: string;
}
/**
* Commands
*
* Command Format:
* ##[name key=value;key=value]message
*
* Examples:
* ##[warning]This is the user warning message
* ##[set-secret name=mypassword]definitelyNotAPassword!
*/
export declare function issueCommand(command: string, properties: CommandProperties, message: string): void;
export declare function issue(name: string, message?: string): void;
export {};

View File

@ -1,66 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const os = require("os");
/**
* Commands
*
* Command Format:
* ##[name key=value;key=value]message
*
* Examples:
* ##[warning]This is the user warning message
* ##[set-secret name=mypassword]definitelyNotAPassword!
*/
function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message);
process.stdout.write(cmd.toString() + os.EOL);
}
exports.issueCommand = issueCommand;
function issue(name, message = '') {
issueCommand(name, {}, message);
}
exports.issue = issue;
const CMD_PREFIX = '##[';
class Command {
constructor(command, properties, message) {
if (!command) {
command = 'missing.command';
}
this.command = command;
this.properties = properties;
this.message = message;
}
toString() {
let cmdStr = CMD_PREFIX + this.command;
if (this.properties && Object.keys(this.properties).length > 0) {
cmdStr += ' ';
for (const key in this.properties) {
if (this.properties.hasOwnProperty(key)) {
const val = this.properties[key];
if (val) {
// safely append the val - avoid blowing up when attempting to
// call .replace() if message is not a string for some reason
cmdStr += `${key}=${escape(`${val || ''}`)};`;
}
}
}
}
cmdStr += ']';
// safely append the message - avoid blowing up when attempting to
// call .replace() if message is not a string for some reason
const message = `${this.message || ''}`;
cmdStr += escapeData(message);
return cmdStr;
}
}
function escapeData(s) {
return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
}
function escape(s) {
return s
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A')
.replace(/]/g, '%5D')
.replace(/;/g, '%3B');
}
//# sourceMappingURL=command.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;AAAA,yBAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,KAAK,CAAA;AAExB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,8DAA8D;wBAC9D,6DAA6D;wBAC7D,MAAM,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,CAAC,GAAG,CAAA;qBAC9C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,CAAA;QAEb,kEAAkE;QAClE,6DAA6D;QAC7D,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAA;QACvC,MAAM,IAAI,UAAU,CAAC,OAAO,CAAC,CAAA;QAE7B,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}

View File

@ -1,94 +0,0 @@
/**
* Interface for getInput options
*/
export interface InputOptions {
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
required?: boolean;
}
/**
* The code to exit an action
*/
export declare enum ExitCode {
/**
* A code indicating that the action was successful
*/
Success = 0,
/**
* A code indicating that the action was a failure
*/
Failure = 1
}
/**
* sets env variable for this action and future actions in the job
* @param name the name of the variable to set
* @param val the value of the variable
*/
export declare function exportVariable(name: string, val: string): void;
/**
* exports the variable and registers a secret which will get masked from logs
* @param name the name of the variable to set
* @param val value of the secret
*/
export declare function exportSecret(name: string, val: string): void;
/**
* Prepends inputPath to the PATH (for this action and future actions)
* @param inputPath
*/
export declare function addPath(inputPath: string): void;
/**
* Gets the value of an input. The value is also trimmed.
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns string
*/
export declare function getInput(name: string, options?: InputOptions): string;
/**
* Sets the value of an output.
*
* @param name name of the output to set
* @param value value to store
*/
export declare function setOutput(name: string, value: string): void;
/**
* Sets the action status to failed.
* When the action exits it will be with an exit code of 1
* @param message add error issue message
*/
export declare function setFailed(message: string): void;
/**
* Writes debug message to user log
* @param message debug message
*/
export declare function debug(message: string): void;
/**
* Adds an error issue
* @param message error issue message
*/
export declare function error(message: string): void;
/**
* Adds an warning issue
* @param message warning issue message
*/
export declare function warning(message: string): void;
/**
* Begin an output group.
*
* Output until the next `groupEnd` will be foldable in this group
*
* @param name The name of the output group
*/
export declare function startGroup(name: string): void;
/**
* End an output group.
*/
export declare function endGroup(): void;
/**
* Wrap an asynchronous function call in a group.
*
* Returns the same type as the function itself.
*
* @param name The name of the group
* @param fn The function to wrap in the group
*/
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;

View File

@ -1,168 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = require("./command");
const path = require("path");
/**
* The code to exit an action
*/
var ExitCode;
(function (ExitCode) {
/**
* A code indicating that the action was successful
*/
ExitCode[ExitCode["Success"] = 0] = "Success";
/**
* A code indicating that the action was a failure
*/
ExitCode[ExitCode["Failure"] = 1] = "Failure";
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
//-----------------------------------------------------------------------
// Variables
//-----------------------------------------------------------------------
/**
* sets env variable for this action and future actions in the job
* @param name the name of the variable to set
* @param val the value of the variable
*/
function exportVariable(name, val) {
process.env[name] = val;
command_1.issueCommand('set-env', { name }, val);
}
exports.exportVariable = exportVariable;
/**
* exports the variable and registers a secret which will get masked from logs
* @param name the name of the variable to set
* @param val value of the secret
*/
function exportSecret(name, val) {
exportVariable(name, val);
// the runner will error with not implemented
// leaving the function but raising the error earlier
command_1.issueCommand('set-secret', {}, val);
throw new Error('Not implemented.');
}
exports.exportSecret = exportSecret;
/**
* Prepends inputPath to the PATH (for this action and future actions)
* @param inputPath
*/
function addPath(inputPath) {
command_1.issueCommand('add-path', {}, inputPath);
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
exports.addPath = addPath;
/**
* Gets the value of an input. The value is also trimmed.
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns string
*/
function getInput(name, options) {
const val = process.env[`INPUT_${name.replace(' ', '_').toUpperCase()}`] || '';
if (options && options.required && !val) {
throw new Error(`Input required and not supplied: ${name}`);
}
return val.trim();
}
exports.getInput = getInput;
/**
* Sets the value of an output.
*
* @param name name of the output to set
* @param value value to store
*/
function setOutput(name, value) {
command_1.issueCommand('set-output', { name }, value);
}
exports.setOutput = setOutput;
//-----------------------------------------------------------------------
// Results
//-----------------------------------------------------------------------
/**
* Sets the action status to failed.
* When the action exits it will be with an exit code of 1
* @param message add error issue message
*/
function setFailed(message) {
process.exitCode = ExitCode.Failure;
error(message);
}
exports.setFailed = setFailed;
//-----------------------------------------------------------------------
// Logging Commands
//-----------------------------------------------------------------------
/**
* Writes debug message to user log
* @param message debug message
*/
function debug(message) {
command_1.issueCommand('debug', {}, message);
}
exports.debug = debug;
/**
* Adds an error issue
* @param message error issue message
*/
function error(message) {
command_1.issue('error', message);
}
exports.error = error;
/**
* Adds an warning issue
* @param message warning issue message
*/
function warning(message) {
command_1.issue('warning', message);
}
exports.warning = warning;
/**
* Begin an output group.
*
* Output until the next `groupEnd` will be foldable in this group
*
* @param name The name of the output group
*/
function startGroup(name) {
command_1.issue('group', name);
}
exports.startGroup = startGroup;
/**
* End an output group.
*/
function endGroup() {
command_1.issue('endgroup');
}
exports.endGroup = endGroup;
/**
* Wrap an asynchronous function call in a group.
*
* Returns the same type as the function itself.
*
* @param name The name of the group
* @param fn The function to wrap in the group
*/
function group(name, fn) {
return __awaiter(this, void 0, void 0, function* () {
startGroup(name);
let result;
try {
result = yield fn();
}
finally {
endGroup();
}
return result;
});
}
exports.group = group;
//# sourceMappingURL=core.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAA6C;AAE7C,6BAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,GAAW;IACpD,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAEzB,6CAA6C;IAC7C,qDAAqD;IACrD,sBAAY,CAAC,YAAY,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IACnC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;AACrC,CAAC;AAPD,oCAOC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACpE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IACnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAHD,8BAGC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,eAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzB,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,eAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC"}

View File

@ -1,68 +0,0 @@
{
"_args": [
[
"@actions/core@1.1.0",
"E:\\python\\setup-php"
]
],
"_from": "@actions/core@1.1.0",
"_id": "@actions/core@1.1.0",
"_inBundle": false,
"_integrity": "sha512-KKpo3xzo0Zsikni9tbOsEQkxZBGDsYSJZNkTvmo0gPSXrc98TBOcdTvKwwjitjkjHkreTggWdB1ACiAFVgsuzA==",
"_location": "/@actions/core",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@actions/core@1.1.0",
"name": "@actions/core",
"escapedName": "@actions%2fcore",
"scope": "@actions",
"rawSpec": "1.1.0",
"saveSpec": null,
"fetchSpec": "1.1.0"
},
"_requiredBy": [
"/",
"/@actions/tool-cache"
],
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.1.0.tgz",
"_spec": "1.1.0",
"_where": "E:\\python\\setup-php",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"description": "Actions core lib",
"devDependencies": {
"@types/node": "^12.0.2"
},
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
"keywords": [
"github",
"actions",
"core"
],
"license": "MIT",
"main": "lib/core.js",
"name": "@actions/core",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/actions/toolkit.git"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "1.1.0"
}

View File

@ -1,7 +0,0 @@
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

60
node_modules/@actions/exec/README.md generated vendored
View File

@ -1,60 +0,0 @@
# `@actions/exec`
## Usage
#### Basic
You can use this package to execute your tools on the command line in a cross platform way:
```js
const exec = require('@actions/exec');
await exec.exec('node index.js');
```
#### Args
You can also pass in arg arrays:
```js
const exec = require('@actions/exec');
await exec.exec('node', ['index.js', 'foo=bar']);
```
#### Output/options
Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5):
```js
const exec = require('@actions/exec');
let myOutput = '';
let myError = '';
const options = {};
options.listeners = {
stdout: (data: Buffer) => {
myOutput += data.toString();
},
stderr: (data: Buffer) => {
myError += data.toString();
}
};
options.cwd = './lib';
await exec.exec('node', ['index.js', 'foo=bar'], options);
```
#### Exec tools not in the PATH
You can use it in conjunction with the `which` function from `@actions/io` to execute tools that are not in the PATH:
```js
const exec = require('@actions/exec');
const io = require('@actions/io');
const pythonPath: string = await io.which('python', true)
await exec.exec(`"${pythonPath}"`, ['main.py']);
```

View File

@ -1,12 +0,0 @@
import * as im from './interfaces';
/**
* Exec a command.
* Output will be streamed to the live console.
* Returns promise with return code
*
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
* @param args optional arguments for tool. Escaping is handled by the lib.
* @param options optional exec options. See ExecOptions
* @returns Promise<number> exit code
*/
export declare function exec(commandLine: string, args?: string[], options?: im.ExecOptions): Promise<number>;

View File

@ -1,37 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const tr = require("./toolrunner");
/**
* Exec a command.
* Output will be streamed to the live console.
* Returns promise with return code
*
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
* @param args optional arguments for tool. Escaping is handled by the lib.
* @param options optional exec options. See ExecOptions
* @returns Promise<number> exit code
*/
function exec(commandLine, args, options) {
return __awaiter(this, void 0, void 0, function* () {
const commandArgs = tr.argStringToArray(commandLine);
if (commandArgs.length === 0) {
throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
}
// Path to tool to execute should be first arg
const toolPath = commandArgs[0];
args = commandArgs.slice(1).concat(args || []);
const runner = new tr.ToolRunner(toolPath, args, options);
return runner.exec();
});
}
exports.exec = exec;
//# sourceMappingURL=exec.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,mCAAkC;AAElC;;;;;;;;;GASG;AACH,SAAsB,IAAI,CACxB,WAAmB,EACnB,IAAe,EACf,OAAwB;;QAExB,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;QACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;SACpE;QACD,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QAC9C,MAAM,MAAM,GAAkB,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACxE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;CAAA;AAdD,oBAcC"}

View File

@ -1,35 +0,0 @@
/// <reference types="node" />
import * as stream from 'stream';
/**
* Interface for exec options
*/
export interface ExecOptions {
/** optional working directory. defaults to current */
cwd?: string;
/** optional envvar dictionary. defaults to current process's env */
env?: {
[key: string]: string;
};
/** optional. defaults to false */
silent?: boolean;
/** optional out stream to use. Defaults to process.stdout */
outStream?: stream.Writable;
/** optional err stream to use. Defaults to process.stderr */
errStream?: stream.Writable;
/** optional. whether to skip quoting/escaping arguments if needed. defaults to false. */
windowsVerbatimArguments?: boolean;
/** optional. whether to fail if output to stderr. defaults to false */
failOnStdErr?: boolean;
/** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */
ignoreReturnCode?: boolean;
/** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */
delay?: number;
/** optional. Listeners for output. Callback functions that will be called on these events */
listeners?: {
stdout?: (data: Buffer) => void;
stderr?: (data: Buffer) => void;
stdline?: (data: string) => void;
errline?: (data: string) => void;
debug?: (data: string) => void;
};
}

View File

@ -1,3 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interfaces.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}

View File

@ -1,37 +0,0 @@
/// <reference types="node" />
import * as events from 'events';
import * as im from './interfaces';
export declare class ToolRunner extends events.EventEmitter {
constructor(toolPath: string, args?: string[], options?: im.ExecOptions);
private toolPath;
private args;
private options;
private _debug;
private _getCommandString;
private _processLineBuffer;
private _getSpawnFileName;
private _getSpawnArgs;
private _endsWith;
private _isCmdFile;
private _windowsQuoteCmdArg;
private _uvQuoteCmdArg;
private _cloneExecOptions;
private _getSpawnOptions;
/**
* Exec a tool.
* Output will be streamed to the live console.
* Returns promise with return code
*
* @param tool path to tool to exec
* @param options optional exec options. See ExecOptions
* @returns number
*/
exec(): Promise<number>;
}
/**
* Convert an arg string to an array of args. Handles escaping
*
* @param argString string of arguments
* @returns string[] array of arguments
*/
export declare function argStringToArray(argString: string): string[];

View File

@ -1,574 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = require("os");
const events = require("events");
const child = require("child_process");
/* eslint-disable @typescript-eslint/unbound-method */
const IS_WINDOWS = process.platform === 'win32';
/*
* Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
*/
class ToolRunner extends events.EventEmitter {
constructor(toolPath, args, options) {
super();
if (!toolPath) {
throw new Error("Parameter 'toolPath' cannot be null or empty.");
}
this.toolPath = toolPath;
this.args = args || [];
this.options = options || {};
}
_debug(message) {
if (this.options.listeners && this.options.listeners.debug) {
this.options.listeners.debug(message);
}
}
_getCommandString(options, noPrefix) {
const toolPath = this._getSpawnFileName();
const args = this._getSpawnArgs(options);
let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
if (IS_WINDOWS) {
// Windows + cmd file
if (this._isCmdFile()) {
cmd += toolPath;
for (const a of args) {
cmd += ` ${a}`;
}
}
// Windows + verbatim
else if (options.windowsVerbatimArguments) {
cmd += `"${toolPath}"`;
for (const a of args) {
cmd += ` ${a}`;
}
}
// Windows (regular)
else {
cmd += this._windowsQuoteCmdArg(toolPath);
for (const a of args) {
cmd += ` ${this._windowsQuoteCmdArg(a)}`;
}
}
}
else {
// OSX/Linux - this can likely be improved with some form of quoting.
// creating processes on Unix is fundamentally different than Windows.
// on Unix, execvp() takes an arg array.
cmd += toolPath;
for (const a of args) {
cmd += ` ${a}`;
}
}
return cmd;
}
_processLineBuffer(data, strBuffer, onLine) {
try {
let s = strBuffer + data.toString();
let n = s.indexOf(os.EOL);
while (n > -1) {
const line = s.substring(0, n);
onLine(line);
// the rest of the string ...
s = s.substring(n + os.EOL.length);
n = s.indexOf(os.EOL);
}
strBuffer = s;
}
catch (err) {
// streaming lines to console is best effort. Don't fail a build.
this._debug(`error processing line. Failed with error ${err}`);
}
}
_getSpawnFileName() {
if (IS_WINDOWS) {
if (this._isCmdFile()) {
return process.env['COMSPEC'] || 'cmd.exe';
}
}
return this.toolPath;
}
_getSpawnArgs(options) {
if (IS_WINDOWS) {
if (this._isCmdFile()) {
let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
for (const a of this.args) {
argline += ' ';
argline += options.windowsVerbatimArguments
? a
: this._windowsQuoteCmdArg(a);
}
argline += '"';
return [argline];
}
}
return this.args;
}
_endsWith(str, end) {
return str.endsWith(end);
}
_isCmdFile() {
const upperToolPath = this.toolPath.toUpperCase();
return (this._endsWith(upperToolPath, '.CMD') ||
this._endsWith(upperToolPath, '.BAT'));
}
_windowsQuoteCmdArg(arg) {
// for .exe, apply the normal quoting rules that libuv applies
if (!this._isCmdFile()) {
return this._uvQuoteCmdArg(arg);
}
// otherwise apply quoting rules specific to the cmd.exe command line parser.
// the libuv rules are generic and are not designed specifically for cmd.exe
// command line parser.
//
// for a detailed description of the cmd.exe command line parser, refer to
// http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
// need quotes for empty arg
if (!arg) {
return '""';
}
// determine whether the arg needs to be quoted
const cmdSpecialChars = [
' ',
'\t',
'&',
'(',
')',
'[',
']',
'{',
'}',
'^',
'=',
';',
'!',
"'",
'+',
',',
'`',
'~',
'|',
'<',
'>',
'"'
];
let needsQuotes = false;
for (const char of arg) {
if (cmdSpecialChars.some(x => x === char)) {
needsQuotes = true;
break;
}
}
// short-circuit if quotes not needed
if (!needsQuotes) {
return arg;
}
// the following quoting rules are very similar to the rules that by libuv applies.
//
// 1) wrap the string in quotes
//
// 2) double-up quotes - i.e. " => ""
//
// this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
// doesn't work well with a cmd.exe command line.
//
// note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
// for example, the command line:
// foo.exe "myarg:""my val"""
// is parsed by a .NET console app into an arg array:
// [ "myarg:\"my val\"" ]
// which is the same end result when applying libuv quoting rules. although the actual
// command line from libuv quoting rules would look like:
// foo.exe "myarg:\"my val\""
//
// 3) double-up slashes that precede a quote,
// e.g. hello \world => "hello \world"
// hello\"world => "hello\\""world"
// hello\\"world => "hello\\\\""world"
// hello world\ => "hello world\\"
//
// technically this is not required for a cmd.exe command line, or the batch argument parser.
// the reasons for including this as a .cmd quoting rule are:
//
// a) this is optimized for the scenario where the argument is passed from the .cmd file to an
// external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
//
// b) it's what we've been doing previously (by deferring to node default behavior) and we
// haven't heard any complaints about that aspect.
//
// note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
// escaped when used on the command line directly - even though within a .cmd file % can be escaped
// by using %%.
//
// the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
// the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
//
// one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
// often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
// variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
// to an external program.
//
// an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
// % can be escaped within a .cmd file.
let reverse = '"';
let quoteHit = true;
for (let i = arg.length; i > 0; i--) {
// walk the string in reverse
reverse += arg[i - 1];
if (quoteHit && arg[i - 1] === '\\') {
reverse += '\\'; // double the slash
}
else if (arg[i - 1] === '"') {
quoteHit = true;
reverse += '"'; // double the quote
}
else {
quoteHit = false;
}
}
reverse += '"';
return reverse
.split('')
.reverse()
.join('');
}
_uvQuoteCmdArg(arg) {
// Tool runner wraps child_process.spawn() and needs to apply the same quoting as
// Node in certain cases where the undocumented spawn option windowsVerbatimArguments
// is used.
//
// Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
// see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
// pasting copyright notice from Node within this function:
//
// Copyright Joyent, Inc. and other Node contributors. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
if (!arg) {
// Need double quotation for empty argument
return '""';
}
if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
// No quotation needed
return arg;
}
if (!arg.includes('"') && !arg.includes('\\')) {
// No embedded double quotes or backslashes, so I can just wrap
// quote marks around the whole thing.
return `"${arg}"`;
}
// Expected input/output:
// input : hello"world
// output: "hello\"world"
// input : hello""world
// output: "hello\"\"world"
// input : hello\world
// output: hello\world
// input : hello\\world
// output: hello\\world
// input : hello\"world
// output: "hello\\\"world"
// input : hello\\"world
// output: "hello\\\\\"world"
// input : hello world\
// output: "hello world\\" - note the comment in libuv actually reads "hello world\"
// but it appears the comment is wrong, it should be "hello world\\"
let reverse = '"';
let quoteHit = true;
for (let i = arg.length; i > 0; i--) {
// walk the string in reverse
reverse += arg[i - 1];
if (quoteHit && arg[i - 1] === '\\') {
reverse += '\\';
}
else if (arg[i - 1] === '"') {
quoteHit = true;
reverse += '\\';
}
else {
quoteHit = false;
}
}
reverse += '"';
return reverse
.split('')
.reverse()
.join('');
}
_cloneExecOptions(options) {
options = options || {};
const result = {
cwd: options.cwd || process.cwd(),
env: options.env || process.env,
silent: options.silent || false,
windowsVerbatimArguments: options.windowsVerbatimArguments || false,
failOnStdErr: options.failOnStdErr || false,
ignoreReturnCode: options.ignoreReturnCode || false,
delay: options.delay || 10000
};
result.outStream = options.outStream || process.stdout;
result.errStream = options.errStream || process.stderr;
return result;
}
_getSpawnOptions(options, toolPath) {
options = options || {};
const result = {};
result.cwd = options.cwd;
result.env = options.env;
result['windowsVerbatimArguments'] =
options.windowsVerbatimArguments || this._isCmdFile();
if (options.windowsVerbatimArguments) {
result.argv0 = `"${toolPath}"`;
}
return result;
}
/**
* Exec a tool.
* Output will be streamed to the live console.
* Returns promise with return code
*
* @param tool path to tool to exec
* @param options optional exec options. See ExecOptions
* @returns number
*/
exec() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
this._debug(`exec tool: ${this.toolPath}`);
this._debug('arguments:');
for (const arg of this.args) {
this._debug(` ${arg}`);
}
const optionsNonNull = this._cloneExecOptions(this.options);
if (!optionsNonNull.silent && optionsNonNull.outStream) {
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
}
const state = new ExecState(optionsNonNull, this.toolPath);
state.on('debug', (message) => {
this._debug(message);
});
const fileName = this._getSpawnFileName();
const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
const stdbuffer = '';
if (cp.stdout) {
cp.stdout.on('data', (data) => {
if (this.options.listeners && this.options.listeners.stdout) {
this.options.listeners.stdout(data);
}
if (!optionsNonNull.silent && optionsNonNull.outStream) {
optionsNonNull.outStream.write(data);
}
this._processLineBuffer(data, stdbuffer, (line) => {
if (this.options.listeners && this.options.listeners.stdline) {
this.options.listeners.stdline(line);
}
});
});
}
const errbuffer = '';
if (cp.stderr) {
cp.stderr.on('data', (data) => {
state.processStderr = true;
if (this.options.listeners && this.options.listeners.stderr) {
this.options.listeners.stderr(data);
}
if (!optionsNonNull.silent &&
optionsNonNull.errStream &&
optionsNonNull.outStream) {
const s = optionsNonNull.failOnStdErr
? optionsNonNull.errStream
: optionsNonNull.outStream;
s.write(data);
}
this._processLineBuffer(data, errbuffer, (line) => {
if (this.options.listeners && this.options.listeners.errline) {
this.options.listeners.errline(line);
}
});
});
}
cp.on('error', (err) => {
state.processError = err.message;
state.processExited = true;
state.processClosed = true;
state.CheckComplete();
});
cp.on('exit', (code) => {
state.processExitCode = code;
state.processExited = true;
this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
state.CheckComplete();
});
cp.on('close', (code) => {
state.processExitCode = code;
state.processExited = true;
state.processClosed = true;
this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
state.CheckComplete();
});
state.on('done', (error, exitCode) => {
if (stdbuffer.length > 0) {
this.emit('stdline', stdbuffer);
}
if (errbuffer.length > 0) {
this.emit('errline', errbuffer);
}
cp.removeAllListeners();
if (error) {
reject(error);
}
else {
resolve(exitCode);
}
});
});
});
}
}
exports.ToolRunner = ToolRunner;
/**
* Convert an arg string to an array of args. Handles escaping
*
* @param argString string of arguments
* @returns string[] array of arguments
*/
function argStringToArray(argString) {
const args = [];
let inQuotes = false;
let escaped = false;
let arg = '';
function append(c) {
// we only escape double quotes.
if (escaped && c !== '"') {
arg += '\\';
}
arg += c;
escaped = false;
}
for (let i = 0; i < argString.length; i++) {
const c = argString.charAt(i);
if (c === '"') {
if (!escaped) {
inQuotes = !inQuotes;
}
else {
append(c);
}
continue;
}
if (c === '\\' && escaped) {
append(c);
continue;
}
if (c === '\\' && inQuotes) {
escaped = true;
continue;
}
if (c === ' ' && !inQuotes) {
if (arg.length > 0) {
args.push(arg);
arg = '';
}
continue;
}
append(c);
}
if (arg.length > 0) {
args.push(arg.trim());
}
return args;
}
exports.argStringToArray = argStringToArray;
class ExecState extends events.EventEmitter {
constructor(options, toolPath) {
super();
this.processClosed = false; // tracks whether the process has exited and stdio is closed
this.processError = '';
this.processExitCode = 0;
this.processExited = false; // tracks whether the process has exited
this.processStderr = false; // tracks whether stderr was written to
this.delay = 10000; // 10 seconds
this.done = false;
this.timeout = null;
if (!toolPath) {
throw new Error('toolPath must not be empty');
}
this.options = options;
this.toolPath = toolPath;
if (options.delay) {
this.delay = options.delay;
}
}
CheckComplete() {
if (this.done) {
return;
}
if (this.processClosed) {
this._setResult();
}
else if (this.processExited) {
this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
}
}
_debug(message) {
this.emit('debug', message);
}
_setResult() {
// determine whether there is an error
let error;
if (this.processExited) {
if (this.processError) {
error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
}
else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
}
else if (this.processStderr && this.options.failOnStdErr) {
error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
}
}
// clear the timeout
if (this.timeout) {
clearTimeout(this.timeout);
this.timeout = null;
}
this.done = true;
this.emit('done', error, this.processExitCode);
}
static HandleTimeout(state) {
if (state.done) {
return;
}
if (!state.processClosed && state.processExited) {
const message = `The STDIO streams did not close within ${state.delay /
1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
state._debug(message);
}
state._setResult();
}
}
//# sourceMappingURL=toolrunner.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,67 +0,0 @@
{
"_args": [
[
"@actions/exec@1.0.1",
"E:\\python\\setup-php"
]
],
"_from": "@actions/exec@1.0.1",
"_id": "@actions/exec@1.0.1",
"_inBundle": false,
"_integrity": "sha512-nvFkxwiicvpzNiCBF4wFBDfnBvi7xp/as7LE1hBxBxKG2L29+gkIPBiLKMVORL+Hg3JNf07AKRfl0V5djoypjQ==",
"_location": "/@actions/exec",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@actions/exec@1.0.1",
"name": "@actions/exec",
"escapedName": "@actions%2fexec",
"scope": "@actions",
"rawSpec": "1.0.1",
"saveSpec": null,
"fetchSpec": "1.0.1"
},
"_requiredBy": [
"/@actions/tool-cache"
],
"_resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.1.tgz",
"_spec": "1.0.1",
"_where": "E:\\python\\setup-php",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"description": "Actions exec lib",
"devDependencies": {
"@actions/io": "^1.0.1"
},
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
"keywords": [
"github",
"actions",
"exec"
],
"license": "MIT",
"main": "lib/exec.js",
"name": "@actions/exec",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/actions/toolkit.git"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "1.0.1"
}

View File

@ -1,7 +0,0 @@
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

53
node_modules/@actions/io/README.md generated vendored
View File

@ -1,53 +0,0 @@
# `@actions/io`
> Core functions for cli filesystem scenarios
## Usage
#### mkdir -p
Recursively make a directory. Follows rules specified in [man mkdir](https://linux.die.net/man/1/mkdir) with the `-p` option specified:
```js
const io = require('@actions/io');
await io.mkdirP('path/to/make');
```
#### cp/mv
Copy or move files or folders. Follows rules specified in [man cp](https://linux.die.net/man/1/cp) and [man mv](https://linux.die.net/man/1/mv):
```js
const io = require('@actions/io');
// Recursive must be true for directories
const options = { recursive: true, force: false }
await io.cp('path/to/directory', 'path/to/dest', options);
await io.mv('path/to/file', 'path/to/dest');
```
#### rm -rf
Remove a file or folder recursively. Follows rules specified in [man rm](https://linux.die.net/man/1/rm) with the `-r` and `-f` rules specified.
```js
const io = require('@actions/io');
await io.rmRF('path/to/directory');
await io.rmRF('path/to/file');
```
#### which
Get the path to a tool and resolves via paths. Follows the rules specified in [man which](https://linux.die.net/man/1/which).
```js
const exec = require('@actions/exec');
const io = require('@actions/io');
const pythonPath: string = await io.which('python', true)
await exec.exec(`"${pythonPath}"`, ['main.py']);
```

View File

@ -1,29 +0,0 @@
/// <reference types="node" />
import * as fs from 'fs';
export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, readdir: typeof fs.promises.readdir, readlink: typeof fs.promises.readlink, rename: typeof fs.promises.rename, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink;
export declare const IS_WINDOWS: boolean;
export declare function exists(fsPath: string): Promise<boolean>;
export declare function isDirectory(fsPath: string, useStat?: boolean): Promise<boolean>;
/**
* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
*/
export declare function isRooted(p: string): boolean;
/**
* Recursively create a directory at `fsPath`.
*
* This implementation is optimistic, meaning it attempts to create the full
* path first, and backs up the path stack from there.
*
* @param fsPath The path to create
* @param maxDepth The maximum recursion depth
* @param depth The current recursion depth
*/
export declare function mkdirP(fsPath: string, maxDepth?: number, depth?: number): Promise<void>;
/**
* Best effort attempt to determine whether a file exists and is executable.
* @param filePath file path to check
* @param extensions additional file extensions to try
* @return if file exists and is executable, returns the file path. otherwise empty string.
*/
export declare function tryGetExecutablePath(filePath: string, extensions: string[]): Promise<string>;

View File

@ -1,195 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = require("assert");
const fs = require("fs");
const path = require("path");
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
exports.IS_WINDOWS = process.platform === 'win32';
function exists(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
try {
yield exports.stat(fsPath);
}
catch (err) {
if (err.code === 'ENOENT') {
return false;
}
throw err;
}
return true;
});
}
exports.exists = exists;
function isDirectory(fsPath, useStat = false) {
return __awaiter(this, void 0, void 0, function* () {
const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
return stats.isDirectory();
});
}
exports.isDirectory = isDirectory;
/**
* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
*/
function isRooted(p) {
p = normalizeSeparators(p);
if (!p) {
throw new Error('isRooted() parameter "p" cannot be empty');
}
if (exports.IS_WINDOWS) {
return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
); // e.g. C: or C:\hello
}
return p.startsWith('/');
}
exports.isRooted = isRooted;
/**
* Recursively create a directory at `fsPath`.
*
* This implementation is optimistic, meaning it attempts to create the full
* path first, and backs up the path stack from there.
*
* @param fsPath The path to create
* @param maxDepth The maximum recursion depth
* @param depth The current recursion depth
*/
function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(fsPath, 'a path argument must be provided');
fsPath = path.resolve(fsPath);
if (depth >= maxDepth)
return exports.mkdir(fsPath);
try {
yield exports.mkdir(fsPath);
return;
}
catch (err) {
switch (err.code) {
case 'ENOENT': {
yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
yield exports.mkdir(fsPath);
return;
}
default: {
let stats;
try {
stats = yield exports.stat(fsPath);
}
catch (err2) {
throw err;
}
if (!stats.isDirectory())
throw err;
}
}
}
});
}
exports.mkdirP = mkdirP;
/**
* Best effort attempt to determine whether a file exists and is executable.
* @param filePath file path to check
* @param extensions additional file extensions to try
* @return if file exists and is executable, returns the file path. otherwise empty string.
*/
function tryGetExecutablePath(filePath, extensions) {
return __awaiter(this, void 0, void 0, function* () {
let stats = undefined;
try {
// test file exists
stats = yield exports.stat(filePath);
}
catch (err) {
if (err.code !== 'ENOENT') {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
}
}
if (stats && stats.isFile()) {
if (exports.IS_WINDOWS) {
// on Windows, test for valid extension
const upperExt = path.extname(filePath).toUpperCase();
if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
return filePath;
}
}
else {
if (isUnixExecutable(stats)) {
return filePath;
}
}
}
// try each extension
const originalFilePath = filePath;
for (const extension of extensions) {
filePath = originalFilePath + extension;
stats = undefined;
try {
stats = yield exports.stat(filePath);
}
catch (err) {
if (err.code !== 'ENOENT') {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
}
}
if (stats && stats.isFile()) {
if (exports.IS_WINDOWS) {
// preserve the case of the actual file (since an extension was appended)
try {
const directory = path.dirname(filePath);
const upperName = path.basename(filePath).toUpperCase();
for (const actualName of yield exports.readdir(directory)) {
if (upperName === actualName.toUpperCase()) {
filePath = path.join(directory, actualName);
break;
}
}
}
catch (err) {
// eslint-disable-next-line no-console
console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
}
return filePath;
}
else {
if (isUnixExecutable(stats)) {
return filePath;
}
}
}
}
return '';
});
}
exports.tryGetExecutablePath = tryGetExecutablePath;
function normalizeSeparators(p) {
p = p || '';
if (exports.IS_WINDOWS) {
// convert slashes on Windows
p = p.replace(/\//g, '\\');
// remove redundant slashes
return p.replace(/\\\\+/g, '\\');
}
// remove redundant slashes
return p.replace(/\/\/+/g, '/');
}
// on Mac/Linux, test the execute bit
// R W X R W X R W X
// 256 128 64 32 16 8 4 2 1
function isUnixExecutable(stats) {
return ((stats.mode & 1) > 0 ||
((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
((stats.mode & 64) > 0 && stats.uid === process.getuid()));
}
//# sourceMappingURL=io-util.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"io-util.js","sourceRoot":"","sources":["../src/io-util.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyB;AACzB,yBAAwB;AACxB,6BAA4B;AAEf,gBAYE,qTAAA;AAEF,QAAA,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAEtD,SAAsB,MAAM,CAAC,MAAc;;QACzC,IAAI;YACF,MAAM,YAAI,CAAC,MAAM,CAAC,CAAA;SACnB;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,OAAO,KAAK,CAAA;aACb;YAED,MAAM,GAAG,CAAA;SACV;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CAAA;AAZD,wBAYC;AAED,SAAsB,WAAW,CAC/B,MAAc,EACd,UAAmB,KAAK;;QAExB,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,YAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;QAChE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IAC5B,CAAC;CAAA;AAND,kCAMC;AAED;;;GAGG;AACH,SAAgB,QAAQ,CAAC,CAAS;IAChC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAC1B,IAAI,CAAC,CAAC,EAAE;QACN,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;KAC5D;IAED,IAAI,kBAAU,EAAE;QACd,OAAO,CACL,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,8BAA8B;SACxE,CAAA,CAAC,sBAAsB;KACzB;IAED,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AAbD,4BAaC;AAED;;;;;;;;;GASG;AACH,SAAsB,MAAM,CAC1B,MAAc,EACd,WAAmB,IAAI,EACvB,QAAgB,CAAC;;QAEjB,WAAE,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAA;QAE9C,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE7B,IAAI,KAAK,IAAI,QAAQ;YAAE,OAAO,aAAK,CAAC,MAAM,CAAC,CAAA;QAE3C,IAAI;YACF,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;YACnB,OAAM;SACP;QAAC,OAAO,GAAG,EAAE;YACZ,QAAQ,GAAG,CAAC,IAAI,EAAE;gBAChB,KAAK,QAAQ,CAAC,CAAC;oBACb,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;oBACvD,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;oBACnB,OAAM;iBACP;gBACD,OAAO,CAAC,CAAC;oBACP,IAAI,KAAe,CAAA;oBAEnB,IAAI;wBACF,KAAK,GAAG,MAAM,YAAI,CAAC,MAAM,CAAC,CAAA;qBAC3B;oBAAC,OAAO,IAAI,EAAE;wBACb,MAAM,GAAG,CAAA;qBACV;oBAED,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;wBAAE,MAAM,GAAG,CAAA;iBACpC;aACF;SACF;IACH,CAAC;CAAA;AAlCD,wBAkCC;AAED;;;;;GAKG;AACH,SAAsB,oBAAoB,CACxC,QAAgB,EAChB,UAAoB;;QAEpB,IAAI,KAAK,GAAyB,SAAS,CAAA;QAC3C,IAAI;YACF,mBAAmB;YACnB,KAAK,GAAG,MAAM,YAAI,CAAC,QAAQ,CAAC,CAAA;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CACT,uEAAuE,QAAQ,MAAM,GAAG,EAAE,CAC3F,CAAA;aACF;SACF;QACD,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;YAC3B,IAAI,kBAAU,EAAE;gBACd,uCAAuC;gBACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;gBACrD,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,EAAE;oBACpE,OAAO,QAAQ,CAAA;iBAChB;aACF;iBAAM;gBACL,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;oBAC3B,OAAO,QAAQ,CAAA;iBAChB;aACF;SACF;QAED,qBAAqB;QACrB,MAAM,gBAAgB,GAAG,QAAQ,CAAA;QACjC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAClC,QAAQ,GAAG,gBAAgB,GAAG,SAAS,CAAA;YAEvC,KAAK,GAAG,SAAS,CAAA;YACjB,IAAI;gBACF,KAAK,GAAG,MAAM,YAAI,CAAC,QAAQ,CAAC,CAAA;aAC7B;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;oBACzB,sCAAsC;oBACtC,OAAO,CAAC,GAAG,CACT,uEAAuE,QAAQ,MAAM,GAAG,EAAE,CAC3F,CAAA;iBACF;aACF;YAED,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;gBAC3B,IAAI,kBAAU,EAAE;oBACd,yEAAyE;oBACzE,IAAI;wBACF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;wBACxC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;wBACvD,KAAK,MAAM,UAAU,IAAI,MAAM,eAAO,CAAC,SAAS,CAAC,EAAE;4BACjD,IAAI,SAAS,KAAK,UAAU,CAAC,WAAW,EAAE,EAAE;gCAC1C,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;gCAC3C,MAAK;6BACN;yBACF;qBACF;oBAAC,OAAO,GAAG,EAAE;wBACZ,sCAAsC;wBACtC,OAAO,CAAC,GAAG,CACT,yEAAyE,QAAQ,MAAM,GAAG,EAAE,CAC7F,CAAA;qBACF;oBAED,OAAO,QAAQ,CAAA;iBAChB;qBAAM;oBACL,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;wBAC3B,OAAO,QAAQ,CAAA;qBAChB;iBACF;aACF;SACF;QAED,OAAO,EAAE,CAAA;IACX,CAAC;CAAA;AA5ED,oDA4EC;AAED,SAAS,mBAAmB,CAAC,CAAS;IACpC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IACX,IAAI,kBAAU,EAAE;QACd,6BAA6B;QAC7B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAE1B,2BAA2B;QAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;KACjC;IAED,2BAA2B;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED,qCAAqC;AACrC,6BAA6B;AAC7B,6BAA6B;AAC7B,SAAS,gBAAgB,CAAC,KAAe;IACvC,OAAO,CACL,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;QACpB,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;QACxD,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAC1D,CAAA;AACH,CAAC"}

56
node_modules/@actions/io/lib/io.d.ts generated vendored
View File

@ -1,56 +0,0 @@
/**
* Interface for cp/mv options
*/
export interface CopyOptions {
/** Optional. Whether to recursively copy all subdirectories. Defaults to false */
recursive?: boolean;
/** Optional. Whether to overwrite existing files in the destination. Defaults to true */
force?: boolean;
}
/**
* Interface for cp/mv options
*/
export interface MoveOptions {
/** Optional. Whether to overwrite existing files in the destination. Defaults to true */
force?: boolean;
}
/**
* Copies a file or folder.
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
*
* @param source source path
* @param dest destination path
* @param options optional. See CopyOptions.
*/
export declare function cp(source: string, dest: string, options?: CopyOptions): Promise<void>;
/**
* Moves a path.
*
* @param source source path
* @param dest destination path
* @param options optional. See MoveOptions.
*/
export declare function mv(source: string, dest: string, options?: MoveOptions): Promise<void>;
/**
* Remove a path recursively with force
*
* @param inputPath path to remove
*/
export declare function rmRF(inputPath: string): Promise<void>;
/**
* Make a directory. Creates the full path with folders in between
* Will throw if it fails
*
* @param fsPath path to create
* @returns Promise<void>
*/
export declare function mkdirP(fsPath: string): Promise<void>;
/**
* Returns path of a tool had the tool actually been invoked. Resolves via paths.
* If you check and the tool does not exist, it will throw.
*
* @param tool name of the tool
* @param check whether to check if tool exists
* @returns Promise<string> path to tool
*/
export declare function which(tool: string, check?: boolean): Promise<string>;

290
node_modules/@actions/io/lib/io.js generated vendored
View File

@ -1,290 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const childProcess = require("child_process");
const path = require("path");
const util_1 = require("util");
const ioUtil = require("./io-util");
const exec = util_1.promisify(childProcess.exec);
/**
* Copies a file or folder.
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
*
* @param source source path
* @param dest destination path
* @param options optional. See CopyOptions.
*/
function cp(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
const { force, recursive } = readCopyOptions(options);
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
// Dest is an existing file, but not forcing
if (destStat && destStat.isFile() && !force) {
return;
}
// If dest is an existing directory, should copy inside.
const newDest = destStat && destStat.isDirectory()
? path.join(dest, path.basename(source))
: dest;
if (!(yield ioUtil.exists(source))) {
throw new Error(`no such file or directory: ${source}`);
}
const sourceStat = yield ioUtil.stat(source);
if (sourceStat.isDirectory()) {
if (!recursive) {
throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
}
else {
yield cpDirRecursive(source, newDest, 0, force);
}
}
else {
if (path.relative(source, newDest) === '') {
// a file cannot be copied to itself
throw new Error(`'${newDest}' and '${source}' are the same file`);
}
yield copyFile(source, newDest, force);
}
});
}
exports.cp = cp;
/**
* Moves a path.
*
* @param source source path
* @param dest destination path
* @param options optional. See MoveOptions.
*/
function mv(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
if (yield ioUtil.exists(dest)) {
let destExists = true;
if (yield ioUtil.isDirectory(dest)) {
// If dest is directory copy src into dest
dest = path.join(dest, path.basename(source));
destExists = yield ioUtil.exists(dest);
}
if (destExists) {
if (options.force == null || options.force) {
yield rmRF(dest);
}
else {
throw new Error('Destination already exists');
}
}
}
yield mkdirP(path.dirname(dest));
yield ioUtil.rename(source, dest);
});
}
exports.mv = mv;
/**
* Remove a path recursively with force
*
* @param inputPath path to remove
*/
function rmRF(inputPath) {
return __awaiter(this, void 0, void 0, function* () {
if (ioUtil.IS_WINDOWS) {
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
try {
if (yield ioUtil.isDirectory(inputPath, true)) {
yield exec(`rd /s /q "${inputPath}"`);
}
else {
yield exec(`del /f /a "${inputPath}"`);
}
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
}
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
try {
yield ioUtil.unlink(inputPath);
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
}
}
else {
let isDir = false;
try {
isDir = yield ioUtil.isDirectory(inputPath);
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
return;
}
if (isDir) {
yield exec(`rm -rf "${inputPath}"`);
}
else {
yield ioUtil.unlink(inputPath);
}
}
});
}
exports.rmRF = rmRF;
/**
* Make a directory. Creates the full path with folders in between
* Will throw if it fails
*
* @param fsPath path to create
* @returns Promise<void>
*/
function mkdirP(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
yield ioUtil.mkdirP(fsPath);
});
}
exports.mkdirP = mkdirP;
/**
* Returns path of a tool had the tool actually been invoked. Resolves via paths.
* If you check and the tool does not exist, it will throw.
*
* @param tool name of the tool
* @param check whether to check if tool exists
* @returns Promise<string> path to tool
*/
function which(tool, check) {
return __awaiter(this, void 0, void 0, function* () {
if (!tool) {
throw new Error("parameter 'tool' is required");
}
// recursive when check=true
if (check) {
const result = yield which(tool, false);
if (!result) {
if (ioUtil.IS_WINDOWS) {
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
}
else {
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
}
}
}
try {
// build the list of extensions to try
const extensions = [];
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
if (extension) {
extensions.push(extension);
}
}
}
// if it's rooted, return it if exists. otherwise return empty.
if (ioUtil.isRooted(tool)) {
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
if (filePath) {
return filePath;
}
return '';
}
// if any path separators, return empty
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
return '';
}
// build the list of directories
//
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
// it feels like we should not do this. Checking the current directory seems like more of a use
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
// across platforms.
const directories = [];
if (process.env.PATH) {
for (const p of process.env.PATH.split(path.delimiter)) {
if (p) {
directories.push(p);
}
}
}
// return the first match
for (const directory of directories) {
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
if (filePath) {
return filePath;
}
}
return '';
}
catch (err) {
throw new Error(`which failed with message ${err.message}`);
}
});
}
exports.which = which;
function readCopyOptions(options) {
const force = options.force == null ? true : options.force;
const recursive = Boolean(options.recursive);
return { force, recursive };
}
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
return __awaiter(this, void 0, void 0, function* () {
// Ensure there is not a run away recursive copy
if (currentDepth >= 255)
return;
currentDepth++;
yield mkdirP(destDir);
const files = yield ioUtil.readdir(sourceDir);
for (const fileName of files) {
const srcFile = `${sourceDir}/${fileName}`;
const destFile = `${destDir}/${fileName}`;
const srcFileStat = yield ioUtil.lstat(srcFile);
if (srcFileStat.isDirectory()) {
// Recurse
yield cpDirRecursive(srcFile, destFile, currentDepth, force);
}
else {
yield copyFile(srcFile, destFile, force);
}
}
// Change the mode for the newly created directory
yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
});
}
// Buffered file copy
function copyFile(srcFile, destFile, force) {
return __awaiter(this, void 0, void 0, function* () {
if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
// unlink/re-link it
try {
yield ioUtil.lstat(destFile);
yield ioUtil.unlink(destFile);
}
catch (e) {
// Try to override file permission
if (e.code === 'EPERM') {
yield ioUtil.chmod(destFile, '0666');
yield ioUtil.unlink(destFile);
}
// other errors = it doesn't exist, no work to do
}
// Copy over symlink
const symlinkFull = yield ioUtil.readlink(srcFile);
yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
}
else if (!(yield ioUtil.exists(destFile)) || force) {
yield ioUtil.copyFile(srcFile, destFile);
}
});
}
//# sourceMappingURL=io.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,64 +0,0 @@
{
"_args": [
[
"@actions/io@1.0.1",
"E:\\python\\setup-php"
]
],
"_from": "@actions/io@1.0.1",
"_id": "@actions/io@1.0.1",
"_inBundle": false,
"_integrity": "sha512-rhq+tfZukbtaus7xyUtwKfuiCRXd1hWSfmJNEpFgBQJ4woqPEpsBw04awicjwz9tyG2/MVhAEMfVn664Cri5zA==",
"_location": "/@actions/io",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@actions/io@1.0.1",
"name": "@actions/io",
"escapedName": "@actions%2fio",
"scope": "@actions",
"rawSpec": "1.0.1",
"saveSpec": null,
"fetchSpec": "1.0.1"
},
"_requiredBy": [
"/@actions/tool-cache"
],
"_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz",
"_spec": "1.0.1",
"_where": "E:\\python\\setup-php",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"description": "Actions io lib",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/io",
"keywords": [
"github",
"actions",
"io"
],
"license": "MIT",
"main": "lib/io.js",
"name": "@actions/io",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/actions/toolkit.git"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "1.0.1"
}

View File

@ -1,7 +0,0 @@
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,82 +0,0 @@
# `@actions/tool-cache`
> Functions necessary for downloading and caching tools.
## Usage
#### Download
You can use this to download tools (or other files) from a download URL:
```js
const tc = require('@actions/tool-cache');
const node12Path = await tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz');
```
#### Extract
These can then be extracted in platform specific ways:
```js
const tc = require('@actions/tool-cache');
if (process.platform === 'win32') {
const node12Path = tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.zip');
const node12ExtractedFolder = await tc.extractZip(node12Path, 'path/to/extract/to');
// Or alternately
const node12Path = tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z');
const node12ExtractedFolder = await tc.extract7z(node12Path, 'path/to/extract/to');
}
else {
const node12Path = await tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz');
const node12ExtractedFolder = await tc.extractTar(node12Path, 'path/to/extract/to');
}
```
#### Cache
Finally, you can cache these directories in our tool-cache. This is useful if you want to switch back and forth between versions of a tool, or save a tool between runs for private runners (private runners are still in development but are on the roadmap).
You'll often want to add it to the path as part of this step:
```js
const tc = require('@actions/tool-cache');
const core = require('@actions/core');
const node12Path = await tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz');
const node12ExtractedFolder = await tc.extractTar(node12Path, 'path/to/extract/to');
const cachedPath = await tc.cacheDir(node12ExtractedFolder, 'node', '12.7.0');
core.addPath(cachedPath);
```
You can also cache files for reuse.
```js
const tc = require('@actions/tool-cache');
tc.cacheFile('path/to/exe', 'destFileName.exe', 'myExeName', '1.1.0');
```
#### Find
Finally, you can find directories and files you've previously cached:
```js
const tc = require('@actions/tool-cache');
const core = require('@actions/core');
const nodeDirectory = tc.find('node', '12.x', 'x64');
core.addPath(nodeDirectory);
```
You can even find all cached versions of a tool:
```js
const tc = require('@actions/tool-cache');
const allNodeVersions = tc.findAllVersions('node');
console.log(`Versions of node available: ${allNodeVersions}`);
```

View File

@ -1,79 +0,0 @@
export declare class HTTPError extends Error {
readonly httpStatusCode: number | undefined;
constructor(httpStatusCode: number | undefined);
}
/**
* Download a tool from an url and stream it into a file
*
* @param url url of tool to download
* @returns path to downloaded tool
*/
export declare function downloadTool(url: string): Promise<string>;
/**
* Extract a .7z file
*
* @param file path to the .7z file
* @param dest destination directory. Optional.
* @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
* problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
* gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
* bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
* interface, it is smaller than the full command line interface, and it does support long paths. At the
* time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
* Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
* to 7zr.exe can be pass to this function.
* @returns path to the destination directory
*/
export declare function extract7z(file: string, dest?: string, _7zPath?: string): Promise<string>;
/**
* Extract a tar
*
* @param file path to the tar
* @param dest destination directory. Optional.
* @param flags flags for the tar. Optional.
* @returns path to the destination directory
*/
export declare function extractTar(file: string, dest?: string, flags?: string): Promise<string>;
/**
* Extract a zip
*
* @param file path to the zip
* @param dest destination directory. Optional.
* @returns path to the destination directory
*/
export declare function extractZip(file: string, dest?: string): Promise<string>;
/**
* Caches a directory and installs it into the tool cacheDir
*
* @param sourceDir the directory to cache into tools
* @param tool tool name
* @param version version of the tool. semver format
* @param arch architecture of the tool. Optional. Defaults to machine architecture
*/
export declare function cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>;
/**
* Caches a downloaded file (GUID) and installs it
* into the tool cache with a given targetName
*
* @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
* @param targetFile the name of the file name in the tools directory
* @param tool tool name
* @param version version of the tool. semver format
* @param arch architecture of the tool. Optional. Defaults to machine architecture
*/
export declare function cacheFile(sourceFile: string, targetFile: string, tool: string, version: string, arch?: string): Promise<string>;
/**
* Finds the path to a tool version in the local installed tool cache
*
* @param toolName name of the tool
* @param versionSpec version of the tool
* @param arch optional arch. defaults to arch of computer
*/
export declare function find(toolName: string, versionSpec: string, arch?: string): string;
/**
* Finds the paths to all versions of a tool that are installed in the local tool cache
*
* @param toolName name of the tool
* @param arch optional arch. defaults to arch of computer
*/
export declare function findAllVersions(toolName: string, arch?: string): string[];

View File

@ -1,449 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = require("@actions/core");
const io = require("@actions/io");
const fs = require("fs");
const os = require("os");
const path = require("path");
const httpm = require("typed-rest-client/HttpClient");
const semver = require("semver");
const uuidV4 = require("uuid/v4");
const exec_1 = require("@actions/exec/lib/exec");
const assert_1 = require("assert");
class HTTPError extends Error {
constructor(httpStatusCode) {
super(`Unexpected HTTP response: ${httpStatusCode}`);
this.httpStatusCode = httpStatusCode;
Object.setPrototypeOf(this, new.target.prototype);
}
}
exports.HTTPError = HTTPError;
const IS_WINDOWS = process.platform === 'win32';
const userAgent = 'actions/tool-cache';
// On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
let tempDirectory = process.env['RUNNER_TEMP'] || '';
let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
// If directories not found, place them in common temp locations
if (!tempDirectory || !cacheRoot) {
let baseLocation;
if (IS_WINDOWS) {
// On windows use the USERPROFILE env variable
baseLocation = process.env['USERPROFILE'] || 'C:\\';
}
else {
if (process.platform === 'darwin') {
baseLocation = '/Users';
}
else {
baseLocation = '/home';
}
}
if (!tempDirectory) {
tempDirectory = path.join(baseLocation, 'actions', 'temp');
}
if (!cacheRoot) {
cacheRoot = path.join(baseLocation, 'actions', 'cache');
}
}
/**
* Download a tool from an url and stream it into a file
*
* @param url url of tool to download
* @returns path to downloaded tool
*/
function downloadTool(url) {
return __awaiter(this, void 0, void 0, function* () {
// Wrap in a promise so that we can resolve from within stream callbacks
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
try {
const http = new httpm.HttpClient(userAgent, [], {
allowRetries: true,
maxRetries: 3
});
const destPath = path.join(tempDirectory, uuidV4());
yield io.mkdirP(tempDirectory);
core.debug(`Downloading ${url}`);
core.debug(`Downloading ${destPath}`);
if (fs.existsSync(destPath)) {
throw new Error(`Destination file path ${destPath} already exists`);
}
const response = yield http.get(url);
if (response.message.statusCode !== 200) {
const err = new HTTPError(response.message.statusCode);
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
throw err;
}
const file = fs.createWriteStream(destPath);
file.on('open', () => __awaiter(this, void 0, void 0, function* () {
try {
const stream = response.message.pipe(file);
stream.on('close', () => {
core.debug('download complete');
resolve(destPath);
});
}
catch (err) {
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
reject(err);
}
}));
file.on('error', err => {
file.end();
reject(err);
});
}
catch (err) {
reject(err);
}
}));
});
}
exports.downloadTool = downloadTool;
/**
* Extract a .7z file
*
* @param file path to the .7z file
* @param dest destination directory. Optional.
* @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
* problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
* gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
* bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
* interface, it is smaller than the full command line interface, and it does support long paths. At the
* time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
* Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
* to 7zr.exe can be pass to this function.
* @returns path to the destination directory
*/
function extract7z(file, dest, _7zPath) {
return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
assert_1.ok(file, 'parameter "file" is required');
dest = dest || (yield _createExtractFolder(dest));
const originalCwd = process.cwd();
process.chdir(dest);
if (_7zPath) {
try {
const args = [
'x',
'-bb1',
'-bd',
'-sccUTF-8',
file
];
const options = {
silent: true
};
yield exec_1.exec(`"${_7zPath}"`, args, options);
}
finally {
process.chdir(originalCwd);
}
}
else {
const escapedScript = path
.join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
.replace(/'/g, "''")
.replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
const args = [
'-NoLogo',
'-Sta',
'-NoProfile',
'-NonInteractive',
'-ExecutionPolicy',
'Unrestricted',
'-Command',
command
];
const options = {
silent: true
};
try {
const powershellPath = yield io.which('powershell', true);
yield exec_1.exec(`"${powershellPath}"`, args, options);
}
finally {
process.chdir(originalCwd);
}
}
return dest;
});
}
exports.extract7z = extract7z;
/**
* Extract a tar
*
* @param file path to the tar
* @param dest destination directory. Optional.
* @param flags flags for the tar. Optional.
* @returns path to the destination directory
*/
function extractTar(file, dest, flags = 'xz') {
return __awaiter(this, void 0, void 0, function* () {
if (!file) {
throw new Error("parameter 'file' is required");
}
dest = dest || (yield _createExtractFolder(dest));
const tarPath = yield io.which('tar', true);
yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
return dest;
});
}
exports.extractTar = extractTar;
/**
* Extract a zip
*
* @param file path to the zip
* @param dest destination directory. Optional.
* @returns path to the destination directory
*/
function extractZip(file, dest) {
return __awaiter(this, void 0, void 0, function* () {
if (!file) {
throw new Error("parameter 'file' is required");
}
dest = dest || (yield _createExtractFolder(dest));
if (IS_WINDOWS) {
yield extractZipWin(file, dest);
}
else {
if (process.platform === 'darwin') {
yield extractZipDarwin(file, dest);
}
else {
yield extractZipNix(file, dest);
}
}
return dest;
});
}
exports.extractZip = extractZip;
function extractZipWin(file, dest) {
return __awaiter(this, void 0, void 0, function* () {
// build the powershell command
const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
// run powershell
const powershellPath = yield io.which('powershell');
const args = [
'-NoLogo',
'-Sta',
'-NoProfile',
'-NonInteractive',
'-ExecutionPolicy',
'Unrestricted',
'-Command',
command
];
yield exec_1.exec(`"${powershellPath}"`, args);
});
}
function extractZipNix(file, dest) {
return __awaiter(this, void 0, void 0, function* () {
const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', 'unzip');
yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
});
}
function extractZipDarwin(file, dest) {
return __awaiter(this, void 0, void 0, function* () {
const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', 'unzip-darwin');
yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
});
}
/**
* Caches a directory and installs it into the tool cacheDir
*
* @param sourceDir the directory to cache into tools
* @param tool tool name
* @param version version of the tool. semver format
* @param arch architecture of the tool. Optional. Defaults to machine architecture
*/
function cacheDir(sourceDir, tool, version, arch) {
return __awaiter(this, void 0, void 0, function* () {
version = semver.clean(version) || version;
arch = arch || os.arch();
core.debug(`Caching tool ${tool} ${version} ${arch}`);
core.debug(`source dir: ${sourceDir}`);
if (!fs.statSync(sourceDir).isDirectory()) {
throw new Error('sourceDir is not a directory');
}
// Create the tool dir
const destPath = yield _createToolPath(tool, version, arch);
// copy each child item. do not move. move can fail on Windows
// due to anti-virus software having an open handle on a file.
for (const itemName of fs.readdirSync(sourceDir)) {
const s = path.join(sourceDir, itemName);
yield io.cp(s, destPath, { recursive: true });
}
// write .complete
_completeToolPath(tool, version, arch);
return destPath;
});
}
exports.cacheDir = cacheDir;
/**
* Caches a downloaded file (GUID) and installs it
* into the tool cache with a given targetName
*
* @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
* @param targetFile the name of the file name in the tools directory
* @param tool tool name
* @param version version of the tool. semver format
* @param arch architecture of the tool. Optional. Defaults to machine architecture
*/
function cacheFile(sourceFile, targetFile, tool, version, arch) {
return __awaiter(this, void 0, void 0, function* () {
version = semver.clean(version) || version;
arch = arch || os.arch();
core.debug(`Caching tool ${tool} ${version} ${arch}`);
core.debug(`source file: ${sourceFile}`);
if (!fs.statSync(sourceFile).isFile()) {
throw new Error('sourceFile is not a file');
}
// create the tool dir
const destFolder = yield _createToolPath(tool, version, arch);
// copy instead of move. move can fail on Windows due to
// anti-virus software having an open handle on a file.
const destPath = path.join(destFolder, targetFile);
core.debug(`destination file ${destPath}`);
yield io.cp(sourceFile, destPath);
// write .complete
_completeToolPath(tool, version, arch);
return destFolder;
});
}
exports.cacheFile = cacheFile;
/**
* Finds the path to a tool version in the local installed tool cache
*
* @param toolName name of the tool
* @param versionSpec version of the tool
* @param arch optional arch. defaults to arch of computer
*/
function find(toolName, versionSpec, arch) {
if (!toolName) {
throw new Error('toolName parameter is required');
}
if (!versionSpec) {
throw new Error('versionSpec parameter is required');
}
arch = arch || os.arch();
// attempt to resolve an explicit version
if (!_isExplicitVersion(versionSpec)) {
const localVersions = findAllVersions(toolName, arch);
const match = _evaluateVersions(localVersions, versionSpec);
versionSpec = match;
}
// check for the explicit version in the cache
let toolPath = '';
if (versionSpec) {
versionSpec = semver.clean(versionSpec) || '';
const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
core.debug(`checking cache: ${cachePath}`);
if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
toolPath = cachePath;
}
else {
core.debug('not found');
}
}
return toolPath;
}
exports.find = find;
/**
* Finds the paths to all versions of a tool that are installed in the local tool cache
*
* @param toolName name of the tool
* @param arch optional arch. defaults to arch of computer
*/
function findAllVersions(toolName, arch) {
const versions = [];
arch = arch || os.arch();
const toolPath = path.join(cacheRoot, toolName);
if (fs.existsSync(toolPath)) {
const children = fs.readdirSync(toolPath);
for (const child of children) {
if (_isExplicitVersion(child)) {
const fullPath = path.join(toolPath, child, arch || '');
if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
versions.push(child);
}
}
}
}
return versions;
}
exports.findAllVersions = findAllVersions;
function _createExtractFolder(dest) {
return __awaiter(this, void 0, void 0, function* () {
if (!dest) {
// create a temp dir
dest = path.join(tempDirectory, uuidV4());
}
yield io.mkdirP(dest);
return dest;
});
}
function _createToolPath(tool, version, arch) {
return __awaiter(this, void 0, void 0, function* () {
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
core.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`;
yield io.rmRF(folderPath);
yield io.rmRF(markerPath);
yield io.mkdirP(folderPath);
return folderPath;
});
}
function _completeToolPath(tool, version, arch) {
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
const markerPath = `${folderPath}.complete`;
fs.writeFileSync(markerPath, '');
core.debug('finished caching tool');
}
function _isExplicitVersion(versionSpec) {
const c = semver.clean(versionSpec) || '';
core.debug(`isExplicit: ${c}`);
const valid = semver.valid(c) != null;
core.debug(`explicit? ${valid}`);
return valid;
}
function _evaluateVersions(versions, versionSpec) {
let version = '';
core.debug(`evaluating ${versions.length} versions`);
versions = versions.sort((a, b) => {
if (semver.gt(a, b)) {
return 1;
}
return -1;
});
for (let i = versions.length - 1; i >= 0; i--) {
const potential = versions[i];
const satisfied = semver.satisfies(potential, versionSpec);
if (satisfied) {
version = potential;
break;
}
}
if (version) {
core.debug(`matched: ${version}`);
}
else {
core.debug('match not found');
}
return version;
}
//# sourceMappingURL=tool-cache.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,79 +0,0 @@
{
"_args": [
[
"@actions/tool-cache@1.1.1",
"E:\\python\\setup-php"
]
],
"_from": "@actions/tool-cache@1.1.1",
"_id": "@actions/tool-cache@1.1.1",
"_inBundle": false,
"_integrity": "sha512-AILekrrj/L4N/5z5TGtUKVie4nKjxDioCgOEymyYxzPhGfjIxfE71tN2VTTpiICEWJ883rPRj2+WinTr1b6yVA==",
"_location": "/@actions/tool-cache",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@actions/tool-cache@1.1.1",
"name": "@actions/tool-cache",
"escapedName": "@actions%2ftool-cache",
"scope": "@actions",
"rawSpec": "1.1.1",
"saveSpec": null,
"fetchSpec": "1.1.1"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.1.1.tgz",
"_spec": "1.1.1",
"_where": "E:\\python\\setup-php",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"dependencies": {
"@actions/core": "^1.1.0",
"@actions/exec": "^1.0.1",
"@actions/io": "^1.0.1",
"semver": "^6.1.0",
"typed-rest-client": "^1.4.0",
"uuid": "^3.3.2"
},
"description": "Actions tool-cache lib",
"devDependencies": {
"@types/nock": "^10.0.3",
"@types/semver": "^6.0.0",
"@types/uuid": "^3.4.4",
"nock": "^10.0.6"
},
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib",
"scripts"
],
"gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
"keywords": [
"github",
"actions",
"exec"
],
"license": "MIT",
"main": "lib/tool-cache.js",
"name": "@actions/tool-cache",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/actions/toolkit.git"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "1.1.1"
}

View File

@ -1,60 +0,0 @@
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Source,
[Parameter(Mandatory = $true)]
[string]$Target)
# This script translates the output from 7zdec into UTF8. Node has limited
# built-in support for encodings.
#
# 7zdec uses the system default code page. The system default code page varies
# depending on the locale configuration. On an en-US box, the system default code
# page is Windows-1252.
#
# Note, on a typical en-US box, testing with the 'ç' character is a good way to
# determine whether data is passed correctly between processes. This is because
# the 'ç' character has a different code point across each of the common encodings
# on a typical en-US box, i.e.
# 1) the default console-output code page (IBM437)
# 2) the system default code page (i.e. CP_ACP) (Windows-1252)
# 3) UTF8
$ErrorActionPreference = 'Stop'
# Redefine the wrapper over STDOUT to use UTF8. Node expects UTF8 by default.
$stdout = [System.Console]::OpenStandardOutput()
$utf8 = New-Object System.Text.UTF8Encoding($false) # do not emit BOM
$writer = New-Object System.IO.StreamWriter($stdout, $utf8)
[System.Console]::SetOut($writer)
# All subsequent output must be written using [System.Console]::WriteLine(). In
# PowerShell 4, Write-Host and Out-Default do not consider the updated stream writer.
Set-Location -LiteralPath $Target
# Print the ##command.
$_7zdec = Join-Path -Path "$PSScriptRoot" -ChildPath "externals/7zdec.exe"
[System.Console]::WriteLine("##[command]$_7zdec x `"$Source`"")
# The $OutputEncoding variable instructs PowerShell how to interpret the output
# from the external command.
$OutputEncoding = [System.Text.Encoding]::Default
# Note, the output from 7zdec.exe needs to be iterated over. Otherwise PowerShell.exe
# will launch the external command in such a way that it inherits the streams.
& $_7zdec x $Source 2>&1 |
ForEach-Object {
if ($_ -is [System.Management.Automation.ErrorRecord]) {
[System.Console]::WriteLine($_.Exception.Message)
}
else {
[System.Console]::WriteLine($_)
}
}
[System.Console]::WriteLine("##[debug]7zdec.exe exit code '$LASTEXITCODE'")
[System.Console]::Out.Flush()
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

9
node_modules/fs/README.md generated vendored
View File

@ -1,9 +0,0 @@
# Security holding package
This package name is not currently in use, but was formerly occupied
by another package. To avoid malicious use, npm is hanging on to the
package name, but loosely, and we'll probably give it to you if you
want it.
You may adopt this package by contacting support@npmjs.com and
requesting the name.

48
node_modules/fs/package.json generated vendored
View File

@ -1,48 +0,0 @@
{
"_args": [
[
"fs@0.0.1-security",
"E:\\python\\setup-php"
]
],
"_from": "fs@0.0.1-security",
"_id": "fs@0.0.1-security",
"_inBundle": false,
"_integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=",
"_location": "/fs",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "fs@0.0.1-security",
"name": "fs",
"escapedName": "fs",
"rawSpec": "0.0.1-security",
"saveSpec": null,
"fetchSpec": "0.0.1-security"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"_spec": "0.0.1-security",
"_where": "E:\\python\\setup-php",
"author": "",
"bugs": {
"url": "https://github.com/npm/security-holder/issues"
},
"description": "This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.",
"homepage": "https://github.com/npm/security-holder#readme",
"keywords": [],
"license": "ISC",
"main": "index.js",
"name": "fs",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/security-holder.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.0.1-security"
}

70
node_modules/semver/CHANGELOG.md generated vendored
View File

@ -1,70 +0,0 @@
# changes log
## 6.2.0
* Coerce numbers to strings when passed to semver.coerce()
* Add `rtl` option to coerce from right to left
## 6.1.3
* Handle X-ranges properly in includePrerelease mode
## 6.1.2
* Do not throw when testing invalid version strings
## 6.1.1
* Add options support for semver.coerce()
* Handle undefined version passed to Range.test
## 6.1.0
* Add semver.compareBuild function
* Support `*` in semver.intersects
## 6.0
* Fix `intersects` logic.
This is technically a bug fix, but since it is also a change to behavior
that may require users updating their code, it is marked as a major
version increment.
## 5.7
* Add `minVersion` method
## 5.6
* Move boolean `loose` param to an options object, with
backwards-compatibility protection.
* Add ability to opt out of special prerelease version handling with
the `includePrerelease` option flag.
## 5.5
* Add version coercion capabilities
## 5.4
* Add intersection checking
## 5.3
* Add `minSatisfying` method
## 5.2
* Add `prerelease(v)` that returns prerelease components
## 5.1
* Add Backus-Naur for ranges
* Remove excessively cute inspection methods
## 5.0
* Remove AMD/Browserified build artifacts
* Fix ltr and gtr when using the `*` range
* Fix for range `*` with a prerelease identifier

Some files were not shown because too many files have changed in this diff Show More