Skip to content

Commit 7b8bf7a

Browse files
authored
Merge pull request #134 from shivammathur/develop
1.7.0 Hotfix
2 parents 0c9f8a8 + 0ac6f76 commit 7b8bf7a

File tree

5 files changed

+25
-24
lines changed

5 files changed

+25
-24
lines changed

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<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>
1111
<a href="https://codecov.io/gh/shivammathur/setup-php" title="Code coverage"><img alt="Codecov Code Coverage" src="https://codecov.io/gh/shivammathur/setup-php/branch/master/graph/badge.svg"></a>
1212
<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"></a>
13-
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg"></a>
13+
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg"></a>
1414
</p>
1515

1616
Setup PHP with required extensions, php.ini configuration, code-coverage support and tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross platform interface to setup 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.
@@ -62,19 +62,19 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
6262
|macOS X Catalina 10.15|`macOS-latest` or `macOS-10.15`|
6363

6464
## :heavy_plus_sign: PHP Extension Support
65-
- On `ubuntu` by default extensions which are available as a package can be installed. If the extension is not available as a package but it is on `PECL`, it can be installed by specifying `pecl` in the tools input.
65+
- On `ubuntu` by default extensions which are available as a package can be installed. If the extension is not available as a package but it is on `PECL`, it can be installed by specifying `pecl` in the tools input.
6666
- On `windows` extensions which have `windows` binary on `PECL` can be installed.
6767
- On `macOS` extensions which are on `PECL` can be installed.
6868
- Extensions which are installed along with PHP if specified are enabled.
6969
- Extensions which cannot be installed gracefully leave an error message in the logs, the action is not interrupted.
7070

7171
## :wrench: Tools Support
7272

73-
The latest version of the following tools can be setup globally using the `tools` input
73+
The latest version of the following tools can be setup globally using the `tools` input.
7474

7575
`composer`, `codeception`, `deployer`, `pecl`, `phinx`, `phpcbf`, `phpcpd`, `php-cs-fixer`, `phpcs`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`
7676

77-
```yml
77+
```yaml
7878
uses: shivammathur/setup-php@v1
7979
with:
8080
php-version: '7.4'
@@ -93,7 +93,7 @@ Runs on all [PHP versions supported](#tada-php-support "List of PHP versions sup
9393
```yaml
9494
uses: shivammathur/setup-php@v1
9595
with:
96-
php-version: '7.4'
96+
php-version: '7.4'
9797
coverage: xdebug
9898
```
9999

@@ -115,7 +115,7 @@ with:
115115

116116
### Disable coverage
117117

118-
Specify `coverage: none` to disable both `Xdebug` and `PCOV`.
118+
Specify `coverage: none` to disable both `Xdebug` and `PCOV`.
119119
Consider disabling the coverage using this PHP action for these reasons.
120120

121121
- You are not generating coverage reports while testing.
@@ -141,7 +141,7 @@ Inputs supported by this GitHub Action.
141141

142142
See [action.yml](action.yml "Metadata for this GitHub Action") and usage below for more info.
143143

144-
### Basic Setup
144+
### Basic Setup
145145

146146
> Setup a particular PHP version.
147147

@@ -166,9 +166,9 @@ steps:
166166

167167
```yaml
168168
jobs:
169-
run:
169+
run:
170170
runs-on: ${{ matrix.operating-system }}
171-
strategy:
171+
strategy:
172172
matrix:
173173
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
174174
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
@@ -187,7 +187,7 @@ jobs:
187187
tools: php-cs-fixer, phpunit #optional, setup tools globally
188188
```
189189

190-
### Experimental Setup
190+
### Experimental Setup
191191

192192
> Setup a nightly build of `PHP 8.0.0-dev` from the [master branch](https://github.com/php/php-src/tree/master "Master branch on PHP source repository") of PHP.
193193

@@ -223,10 +223,10 @@ You can persist composer's internal cache directory using the [`action/cache`](h
223223
id: composer-cache
224224
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
225225
226-
- name: Cache dependencies
226+
- name: Cache dependencies
227227
uses: actions/cache@v1
228228
with:
229-
path: ${{ steps.composer-cache.outputs.dir }}
229+
path: ${{ steps.composer-cache.outputs.dir }}
230230
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
231231
restore-keys: ${{ runner.os }}-composer-
232232
@@ -236,7 +236,7 @@ You can persist composer's internal cache directory using the [`action/cache`](h
236236

237237
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.
238238

239-
```yml
239+
```yaml
240240
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
241241
```
242242

__tests__/install.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jest.mock('../src/install', () => ({
2020
}
2121

2222
let script = 'initial script ' + filename + version + os_version;
23+
if (tools_csv) {
24+
script += 'add_tool';
25+
}
2326
if (extension_csv) {
2427
script += 'install extensions';
2528
}
@@ -29,9 +32,6 @@ jest.mock('../src/install', () => ({
2932
if (coverage_driver) {
3033
script += 'set coverage driver';
3134
}
32-
if (tools_csv) {
33-
script += 'add_tool';
34-
}
3535

3636
return script;
3737
}

dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2042,6 +2042,7 @@ function build(filename, version, os_version) {
20422042
tools_csv = 'pecl, ' + tools_csv;
20432043
}
20442044
let script = yield utils.readScript(filename, version, os_version);
2045+
script += yield tools.addTools(tools_csv, os_version);
20452046
if (extension_csv) {
20462047
script += yield extensions.addExtension(extension_csv, version, os_version);
20472048
}
@@ -2051,7 +2052,6 @@ function build(filename, version, os_version) {
20512052
if (coverage_driver) {
20522053
script += yield coverage.addCoverage(coverage_driver, version, os_version);
20532054
}
2054-
script += yield tools.addTools(tools_csv, os_version);
20552055
return yield utils.writeScript(filename, script);
20562056
});
20572057
}

src/install.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export async function build(
3434
}
3535

3636
let script: string = await utils.readScript(filename, version, os_version);
37+
script += await tools.addTools(tools_csv, os_version);
38+
3739
if (extension_csv) {
3840
script += await extensions.addExtension(extension_csv, version, os_version);
3941
}
@@ -43,7 +45,6 @@ export async function build(
4345
if (coverage_driver) {
4446
script += await coverage.addCoverage(coverage_driver, version, os_version);
4547
}
46-
script += await tools.addTools(tools_csv, os_version);
4748

4849
return await utils.writeScript(filename, script);
4950
}

src/scripts/ext/phalcon.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
22
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
33
curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | sudo bash
4-
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev
54
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-psr
6-
for tool in php-config phpize; do
7-
if [ -e "/usr/bin/$tool$2" ]; then
8-
sudo update-alternatives --set $tool /usr/bin/"$tool$2"
9-
fi
10-
done
115

126
if [ ! "$(apt-cache search php"$2"-psr)" ]; then
7+
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev
8+
for tool in php-config phpize; do
9+
if [ -e "/usr/bin/$tool$2" ]; then
10+
sudo update-alternatives --set $tool /usr/bin/"$tool$2"
11+
fi
12+
done
1313
cd ~ && git clone --depth=1 https://github.com/jbboehr/php-psr.git
1414
cd php-psr && sudo /usr/bin/phpize"$2"
1515
./configure --with-php-config=/usr/bin/php-config"$2"

0 commit comments

Comments
 (0)