mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-01 12:43:17 +07:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
e763fddf01 | |||
3cd5c7fd3a | |||
988cef62da | |||
be3ee05178 |
@ -378,6 +378,7 @@ If this action helped you.
|
||||
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
|
||||
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages")
|
||||
- [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds for MacOS")
|
||||
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions for MacOS")
|
||||
- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Nightly PHP package")
|
||||
|
||||
## :bookmark_tabs: Further Reading
|
||||
|
@ -85,12 +85,15 @@ describe('Extension tests', () => {
|
||||
|
||||
it('checking addExtensionOnDarwin', async () => {
|
||||
let darwin: string = await extensions.addExtension(
|
||||
'Xdebug, pcov, sqlite, ast-beta',
|
||||
'Xdebug, pcov, grpc, protobuf, swoole, sqlite, ast-beta',
|
||||
'7.2',
|
||||
'darwin'
|
||||
);
|
||||
expect(darwin).toContain('add_brew_extension xdebug');
|
||||
expect(darwin).toContain('add_brew_extension pcov');
|
||||
expect(darwin).toContain('add_brew_extension grpc');
|
||||
expect(darwin).toContain('add_brew_extension protobuf');
|
||||
expect(darwin).toContain('add_brew_extension swoole');
|
||||
expect(darwin).toContain('sudo pecl install -f sqlite3');
|
||||
expect(darwin).toContain('add_unstable_extension ast beta extension');
|
||||
|
||||
|
12
dist/index.js
vendored
12
dist/index.js
vendored
@ -2696,13 +2696,13 @@ async function addExtensionDarwin(extension_csv, version, pipe) {
|
||||
' ' +
|
||||
ext_prefix;
|
||||
return;
|
||||
// match 5.6xdebug, 7.0xdebug...7.4xdebug, 8.0xdebug
|
||||
case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension):
|
||||
command = 'add_brew_extension xdebug';
|
||||
break;
|
||||
// match 7.1pcov...7.4pcov, 8.0pcov
|
||||
// match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole
|
||||
// match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf
|
||||
// match 7.1pcov to 8.0pcov
|
||||
case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|swoole)/.test(version_extension):
|
||||
case /(5\.6|7\.[0-4])(grpc|protobuf)/.test(version_extension):
|
||||
case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension):
|
||||
command = 'add_brew_extension pcov';
|
||||
command = 'add_brew_extension ' + extension_name;
|
||||
break;
|
||||
// match 5.6redis
|
||||
case /5\.6redis/.test(version_extension):
|
||||
|
1543
package-lock.json
generated
1543
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-php",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.2",
|
||||
"private": false,
|
||||
"description": "Setup PHP for use with GitHub Actions",
|
||||
"main": "dist/index.js",
|
||||
@ -30,22 +30,22 @@
|
||||
"fs": "0.0.1-security"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.0",
|
||||
"@types/node": "^14.0.13",
|
||||
"@typescript-eslint/eslint-plugin": "^3.3.0",
|
||||
"@typescript-eslint/parser": "^3.3.0",
|
||||
"@types/jest": "^26.0.3",
|
||||
"@types/node": "^14.0.14",
|
||||
"@typescript-eslint/eslint-plugin": "^3.5.0",
|
||||
"@typescript-eslint/parser": "^3.5.0",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"eslint": "^7.2.0",
|
||||
"eslint": "^7.3.1",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-import": "^2.21.2",
|
||||
"eslint-plugin-jest": "^23.13.2",
|
||||
"eslint-plugin-import": "^2.22.0",
|
||||
"eslint-plugin-jest": "^23.17.1",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"husky": "^4.2.5",
|
||||
"jest": "^26.0.1",
|
||||
"jest-circus": "^26.0.1",
|
||||
"jest": "^26.1.0",
|
||||
"jest-circus": "^26.1.0",
|
||||
"prettier": "^2.0.5",
|
||||
"ts-jest": "^26.1.0",
|
||||
"typescript": "^3.9.5"
|
||||
"ts-jest": "^26.1.1",
|
||||
"typescript": "^3.9.6"
|
||||
},
|
||||
"husky": {
|
||||
"skipCI": true,
|
||||
|
@ -50,13 +50,13 @@ export async function addExtensionDarwin(
|
||||
' ' +
|
||||
ext_prefix;
|
||||
return;
|
||||
// match 5.6xdebug, 7.0xdebug...7.4xdebug, 8.0xdebug
|
||||
case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension):
|
||||
command = 'add_brew_extension xdebug';
|
||||
break;
|
||||
// match 7.1pcov...7.4pcov, 8.0pcov
|
||||
// match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole
|
||||
// match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf
|
||||
// match 7.1pcov to 8.0pcov
|
||||
case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|swoole)/.test(version_extension):
|
||||
case /(5\.6|7\.[0-4])(grpc|protobuf)/.test(version_extension):
|
||||
case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension):
|
||||
command = 'add_brew_extension pcov';
|
||||
command = 'add_brew_extension ' + extension_name;
|
||||
break;
|
||||
// match 5.6redis
|
||||
case /5\.6redis/.test(version_extension):
|
||||
|
@ -163,21 +163,8 @@ add_pecl() {
|
||||
add_log "$tick" "PECL" "Added"
|
||||
}
|
||||
|
||||
# Function to fetch updated formulas
|
||||
update_formulae() {
|
||||
brew_dir=$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
|
||||
for formula in httpd pkg-config apr apr-util argon2 aspell autoconf bison curl-openssl freetds freetype gettext glib gmp icu4c jpeg krb5 libffi libpng libpq libsodium libzip oniguruma openldap openssl@1.1 re2c sqlite tidyp unixodbc webp; do
|
||||
sudo curl -o "$brew_dir"/"$formula".rb -sSL https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/"$formula".rb &
|
||||
to_wait+=( $! )
|
||||
done
|
||||
wait "${to_wait[@]}"
|
||||
}
|
||||
|
||||
# Function to setup PHP and composer
|
||||
setup_php() {
|
||||
if [ "$version" = "8.0" ]; then
|
||||
update_formulae
|
||||
fi
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
|
||||
brew tap --shallow shivammathur/homebrew-php
|
||||
brew install shivammathur/php/php@"$version"
|
||||
|
@ -238,6 +238,10 @@ existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
|
||||
# Setup PHP
|
||||
step_log "Setup PHP"
|
||||
sudo mkdir -p /var/run /run/php
|
||||
. /etc/lsb-release
|
||||
if [ "$DISTRIB_RELEASE" = "20.04" ]; then
|
||||
LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y
|
||||
fi
|
||||
|
||||
if [ "$existing_version" != "$version" ]; then
|
||||
if [ ! -e "/usr/bin/php$version" ]; then
|
||||
|
Reference in New Issue
Block a user