Compare commits

..

4 Commits
1.9.1 ... 1.9.2

8 changed files with 808 additions and 806 deletions

View File

@ -378,6 +378,7 @@ If this action helped you.
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows") - [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages") - [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages")
- [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds for MacOS") - [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds for MacOS")
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions for MacOS")
- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Nightly PHP package") - [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Nightly PHP package")
## :bookmark_tabs: Further Reading ## :bookmark_tabs: Further Reading

View File

@ -85,12 +85,15 @@ describe('Extension tests', () => {
it('checking addExtensionOnDarwin', async () => { it('checking addExtensionOnDarwin', async () => {
let darwin: string = await extensions.addExtension( let darwin: string = await extensions.addExtension(
'Xdebug, pcov, sqlite, ast-beta', 'Xdebug, pcov, grpc, protobuf, swoole, sqlite, ast-beta',
'7.2', '7.2',
'darwin' 'darwin'
); );
expect(darwin).toContain('add_brew_extension xdebug'); expect(darwin).toContain('add_brew_extension xdebug');
expect(darwin).toContain('add_brew_extension pcov'); 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('sudo pecl install -f sqlite3');
expect(darwin).toContain('add_unstable_extension ast beta extension'); expect(darwin).toContain('add_unstable_extension ast beta extension');

12
dist/index.js vendored
View File

@ -2696,13 +2696,13 @@ async function addExtensionDarwin(extension_csv, version, pipe) {
' ' + ' ' +
ext_prefix; ext_prefix;
return; return;
// match 5.6xdebug, 7.0xdebug...7.4xdebug, 8.0xdebug // match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole
case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension): // match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf
command = 'add_brew_extension xdebug'; // match 7.1pcov to 8.0pcov
break; case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|swoole)/.test(version_extension):
// match 7.1pcov...7.4pcov, 8.0pcov case /(5\.6|7\.[0-4])(grpc|protobuf)/.test(version_extension):
case /(7\.[1-4]|8\.[0-9])pcov/.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; break;
// match 5.6redis // match 5.6redis
case /5\.6redis/.test(version_extension): case /5\.6redis/.test(version_extension):

1543
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "1.9.1", "version": "1.9.2",
"private": false, "private": false,
"description": "Setup PHP for use with GitHub Actions", "description": "Setup PHP for use with GitHub Actions",
"main": "dist/index.js", "main": "dist/index.js",
@ -30,22 +30,22 @@
"fs": "0.0.1-security" "fs": "0.0.1-security"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^26.0.0", "@types/jest": "^26.0.3",
"@types/node": "^14.0.13", "@types/node": "^14.0.14",
"@typescript-eslint/eslint-plugin": "^3.3.0", "@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.3.0", "@typescript-eslint/parser": "^3.5.0",
"@zeit/ncc": "^0.22.3", "@zeit/ncc": "^0.22.3",
"eslint": "^7.2.0", "eslint": "^7.3.1",
"eslint-config-prettier": "^6.11.0", "eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.21.2", "eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.13.2", "eslint-plugin-jest": "^23.17.1",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"husky": "^4.2.5", "husky": "^4.2.5",
"jest": "^26.0.1", "jest": "^26.1.0",
"jest-circus": "^26.0.1", "jest-circus": "^26.1.0",
"prettier": "^2.0.5", "prettier": "^2.0.5",
"ts-jest": "^26.1.0", "ts-jest": "^26.1.1",
"typescript": "^3.9.5" "typescript": "^3.9.6"
}, },
"husky": { "husky": {
"skipCI": true, "skipCI": true,

View File

@ -50,13 +50,13 @@ export async function addExtensionDarwin(
' ' + ' ' +
ext_prefix; ext_prefix;
return; return;
// match 5.6xdebug, 7.0xdebug...7.4xdebug, 8.0xdebug // match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole
case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension): // match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf
command = 'add_brew_extension xdebug'; // match 7.1pcov to 8.0pcov
break; case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|swoole)/.test(version_extension):
// match 7.1pcov...7.4pcov, 8.0pcov case /(5\.6|7\.[0-4])(grpc|protobuf)/.test(version_extension):
case /(7\.[1-4]|8\.[0-9])pcov/.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; break;
// match 5.6redis // match 5.6redis
case /5\.6redis/.test(version_extension): case /5\.6redis/.test(version_extension):

View File

@ -163,21 +163,8 @@ add_pecl() {
add_log "$tick" "PECL" "Added" 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 # Function to setup PHP and composer
setup_php() { setup_php() {
if [ "$version" = "8.0" ]; then
update_formulae
fi
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
brew tap --shallow shivammathur/homebrew-php brew tap --shallow shivammathur/homebrew-php
brew install shivammathur/php/php@"$version" brew install shivammathur/php/php@"$version"

View File

@ -238,6 +238,10 @@ existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
# Setup PHP # Setup PHP
step_log "Setup PHP" step_log "Setup PHP"
sudo mkdir -p /var/run /run/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 [ "$existing_version" != "$version" ]; then
if [ ! -e "/usr/bin/php$version" ]; then if [ ! -e "/usr/bin/php$version" ]; then