mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-11-04 17:06:37 +07:00 
			
		
		
		
	Switch to apt-fast
This commit is contained in:
		@ -40,10 +40,10 @@ describe('Extension tests', () => {
 | 
				
			|||||||
      'linux'
 | 
					      'linux'
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    expect(linux).toContain(
 | 
					    expect(linux).toContain(
 | 
				
			||||||
      'sudo DEBIAN_FRONTEND=noninteractive apt install -y php7.2-xdebug'
 | 
					      'sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php7.2-xdebug'
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    expect(linux).toContain(
 | 
					    expect(linux).toContain(
 | 
				
			||||||
      'sudo DEBIAN_FRONTEND=noninteractive apt install -y php7.2-pcov'
 | 
					      'sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php7.2-pcov'
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    linux = await extensions.addExtension('xdebug, pcov', '7.4', 'linux');
 | 
					    linux = await extensions.addExtension('xdebug, pcov', '7.4', 'linux');
 | 
				
			||||||
 | 
				
			|||||||
@ -172,7 +172,7 @@ function addExtensionLinux(extension_csv, version) {
 | 
				
			|||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                    default:
 | 
					                    default:
 | 
				
			||||||
                        install_command =
 | 
					                        install_command =
 | 
				
			||||||
                            'sudo DEBIAN_FRONTEND=noninteractive apt install -y php' +
 | 
					                            'sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php' +
 | 
				
			||||||
                                version +
 | 
					                                version +
 | 
				
			||||||
                                '-' +
 | 
					                                '-' +
 | 
				
			||||||
                                extension +
 | 
					                                extension +
 | 
				
			||||||
 | 
				
			|||||||
@ -165,7 +165,7 @@ export async function addExtensionLinux(
 | 
				
			|||||||
        break;
 | 
					        break;
 | 
				
			||||||
      default:
 | 
					      default:
 | 
				
			||||||
        install_command =
 | 
					        install_command =
 | 
				
			||||||
          'sudo DEBIAN_FRONTEND=noninteractive apt install -y php' +
 | 
					          'sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php' +
 | 
				
			||||||
          version +
 | 
					          version +
 | 
				
			||||||
          '-' +
 | 
					          '-' +
 | 
				
			||||||
          extension +
 | 
					          extension +
 | 
				
			||||||
 | 
				
			|||||||
@ -23,11 +23,10 @@ step_log "Setup PHP and Composer"
 | 
				
			|||||||
if [ "$existing_version" != "$1" ]; then
 | 
					if [ "$existing_version" != "$1" ]; then
 | 
				
			||||||
	if [ ! -e "/usr/bin/php$1" ]; then
 | 
						if [ ! -e "/usr/bin/php$1" ]; then
 | 
				
			||||||
		sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1
 | 
							sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1
 | 
				
			||||||
		sudo DEBIAN_FRONTEND=noninteractive apt update -y >/dev/null 2>&1
 | 
					 | 
				
			||||||
		if [ "$1" != "7.4" ]; then
 | 
							if [ "$1" != "7.4" ]; then
 | 
				
			||||||
		  sudo DEBIAN_FRONTEND=noninteractive apt install -y php"$1" curl php"$1"-curl >/dev/null 2>&1
 | 
							  sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1" curl php"$1"-curl >/dev/null 2>&1
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
		  sudo DEBIAN_FRONTEND=noninteractive apt install -y php"$1" php"$1"-dev curl php"$1"-curl >/dev/null 2>&1
 | 
							  sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1" php"$1"-dev curl php"$1"-curl >/dev/null 2>&1
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
		status="Installed PHP$version"
 | 
							status="Installed PHP$version"
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user