mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
commit
7b8bf7af6a
@ -70,11 +70,11 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
|||||||
|
|
||||||
## :wrench: Tools Support
|
## :wrench: Tools Support
|
||||||
|
|
||||||
The latest version of the following tools can be setup globally using the `tools` input
|
The latest version of the following tools can be setup globally using the `tools` input.
|
||||||
|
|
||||||
`composer`, `codeception`, `deployer`, `pecl`, `phinx`, `phpcbf`, `phpcpd`, `php-cs-fixer`, `phpcs`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`
|
`composer`, `codeception`, `deployer`, `pecl`, `phinx`, `phpcbf`, `phpcpd`, `php-cs-fixer`, `phpcs`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
uses: shivammathur/setup-php@v1
|
uses: shivammathur/setup-php@v1
|
||||||
with:
|
with:
|
||||||
php-version: '7.4'
|
php-version: '7.4'
|
||||||
@ -236,7 +236,7 @@ You can persist composer's internal cache directory using the [`action/cache`](h
|
|||||||
|
|
||||||
In the above example, if you support a range of `composer` dependencies and do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
|
In the above example, if you support a range of `composer` dependencies and do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -20,6 +20,9 @@ jest.mock('../src/install', () => ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
let script = 'initial script ' + filename + version + os_version;
|
let script = 'initial script ' + filename + version + os_version;
|
||||||
|
if (tools_csv) {
|
||||||
|
script += 'add_tool';
|
||||||
|
}
|
||||||
if (extension_csv) {
|
if (extension_csv) {
|
||||||
script += 'install extensions';
|
script += 'install extensions';
|
||||||
}
|
}
|
||||||
@ -29,9 +32,6 @@ jest.mock('../src/install', () => ({
|
|||||||
if (coverage_driver) {
|
if (coverage_driver) {
|
||||||
script += 'set coverage driver';
|
script += 'set coverage driver';
|
||||||
}
|
}
|
||||||
if (tools_csv) {
|
|
||||||
script += 'add_tool';
|
|
||||||
}
|
|
||||||
|
|
||||||
return script;
|
return script;
|
||||||
}
|
}
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -2042,6 +2042,7 @@ function build(filename, version, os_version) {
|
|||||||
tools_csv = 'pecl, ' + tools_csv;
|
tools_csv = 'pecl, ' + tools_csv;
|
||||||
}
|
}
|
||||||
let script = yield utils.readScript(filename, version, os_version);
|
let script = yield utils.readScript(filename, version, os_version);
|
||||||
|
script += yield tools.addTools(tools_csv, os_version);
|
||||||
if (extension_csv) {
|
if (extension_csv) {
|
||||||
script += yield extensions.addExtension(extension_csv, version, os_version);
|
script += yield extensions.addExtension(extension_csv, version, os_version);
|
||||||
}
|
}
|
||||||
@ -2051,7 +2052,6 @@ function build(filename, version, os_version) {
|
|||||||
if (coverage_driver) {
|
if (coverage_driver) {
|
||||||
script += yield coverage.addCoverage(coverage_driver, version, os_version);
|
script += yield coverage.addCoverage(coverage_driver, version, os_version);
|
||||||
}
|
}
|
||||||
script += yield tools.addTools(tools_csv, os_version);
|
|
||||||
return yield utils.writeScript(filename, script);
|
return yield utils.writeScript(filename, script);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,8 @@ export async function build(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let script: string = await utils.readScript(filename, version, os_version);
|
let script: string = await utils.readScript(filename, version, os_version);
|
||||||
|
script += await tools.addTools(tools_csv, os_version);
|
||||||
|
|
||||||
if (extension_csv) {
|
if (extension_csv) {
|
||||||
script += await extensions.addExtension(extension_csv, version, os_version);
|
script += await extensions.addExtension(extension_csv, version, os_version);
|
||||||
}
|
}
|
||||||
@ -43,7 +45,6 @@ export async function build(
|
|||||||
if (coverage_driver) {
|
if (coverage_driver) {
|
||||||
script += await coverage.addCoverage(coverage_driver, version, os_version);
|
script += await coverage.addCoverage(coverage_driver, version, os_version);
|
||||||
}
|
}
|
||||||
script += await tools.addTools(tools_csv, os_version);
|
|
||||||
|
|
||||||
return await utils.writeScript(filename, script);
|
return await utils.writeScript(filename, script);
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
||||||
find /etc/apt/sources.list.d -type f -name 'ondrej-ubuntu-php*.list' -exec sudo DEBIAN_FRONTEND=noninteractive apt-fast update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1
|
find /etc/apt/sources.list.d -type f -name 'ondrej-ubuntu-php*.list' -exec sudo DEBIAN_FRONTEND=noninteractive apt-fast update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1
|
||||||
curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | sudo bash
|
curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | sudo bash
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev
|
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-psr
|
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-psr
|
||||||
for tool in php-config phpize; do
|
|
||||||
if [ -e "/usr/bin/$tool$2" ]; then
|
|
||||||
sudo update-alternatives --set $tool /usr/bin/"$tool$2"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! "$(apt-cache search php"$2"-psr)" ]; then
|
if [ ! "$(apt-cache search php"$2"-psr)" ]; then
|
||||||
|
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev
|
||||||
|
for tool in php-config phpize; do
|
||||||
|
if [ -e "/usr/bin/$tool$2" ]; then
|
||||||
|
sudo update-alternatives --set $tool /usr/bin/"$tool$2"
|
||||||
|
fi
|
||||||
|
done
|
||||||
cd ~ && git clone --depth=1 https://github.com/jbboehr/php-psr.git
|
cd ~ && git clone --depth=1 https://github.com/jbboehr/php-psr.git
|
||||||
cd php-psr && sudo /usr/bin/phpize"$2"
|
cd php-psr && sudo /usr/bin/phpize"$2"
|
||||||
./configure --with-php-config=/usr/bin/php-config"$2"
|
./configure --with-php-config=/usr/bin/php-config"$2"
|
||||||
|
Loading…
Reference in New Issue
Block a user