Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Nov 17, 2020
1 parent ac6e635 commit d5adfa5
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
- [Flags](#flags)
- [Basic Setup](#basic-setup)
- [Matrix Setup](#matrix-setup)
- [Multi-Arch Setup](#multi-arch-setup)
- [Nightly Build Setup](#nightly-build-setup)
- [Self Hosted Setup](#self-hosted-setup)
- [Local Testing Setup](#local-testing-setup)
Expand Down Expand Up @@ -106,6 +107,8 @@ The action supports both `GitHub-hosted` runners and `self-hosted` runners on th

## :heavy_plus_sign: PHP Extension Support

- Extensions enabled by default after `setup-php` runs can be found on the [wiki](https://github.com/shivammathur/setup-php/wiki).

- On `ubuntu` by default extensions which are available as a package can be installed. PECL extensions if not available as a package can be installed by specifying `pecl` in the tools input.

```yaml
Expand Down Expand Up @@ -165,7 +168,7 @@ The action supports both `GitHub-hosted` runners and `self-hosted` runners on th
extensions: intl-67.1
```

- These extensions have custom support - `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`, and `blackfire`, `ioncube`, `oci8`, `pdo_oci`, `phalcon3` and `phalcon4` on all supported OS.
- These extensions have custom support - `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`, and `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_oci`, `phalcon3` and `phalcon4` on all supported OS.

- By default, extensions which cannot be added or removed gracefully leave an error message in the logs, the action is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.

Expand Down Expand Up @@ -404,6 +407,37 @@ jobs:
tools: php-cs-fixer, phpunit
```

### Multi-Arch Setup

> Setup PHP on multiple architecture on Ubuntu GitHub Runners.

- `PHP 5.6` to `PHP 7.4` are supported by `setup-php` on multiple architecture on `Ubuntu`.
- For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `spc` utility.
- Using `spc` you can run `setup-php` on both `i386` and `amd64` containers as opposed to [default syntax](#basic-setup), which only supports `amd64`.
- Currently, for `Arm` based setup, you will need [self-hosted runners](#self-hosted-setup).

```yaml
jobs:
run:
runs-on: ubuntu-latest
container: shivammathur/node:latest-${{ matrix.arch }}
strategy:
matrix:
arch: ["amd64", "i386"]
steps:
- name: Install PHP
run: |
# Update spc (See https://github.com/shivammathur/spc for options)
spc -U
# Install PHP
spc --php-version "7.4" \
--extensions "mbstring, intl" \
--ini-values "post_max_size=256M, short_open_tag=On" \
--coverage "xdebug" \
--tools "php-cs-fixer, phpunit"
```

### Nightly Build Setup

> Setup a nightly build of `PHP 8.0` or `PHP 8.1`.
Expand Down Expand Up @@ -462,6 +496,7 @@ jobs:
**Notes**
- Do not setup multiple self-hosted runners on a single server instance as parallel workflow will conflict with each other.
- Do not setup self-hosted runners on the side on your development environment or your production server.
- Avoid using the same labels for your `self-hosted` runners which are used by `GitHub-hosted` runners.

### Local Testing Setup

Expand Down Expand Up @@ -579,12 +614,17 @@ If your project uses composer, you can persist the composer's internal cache dir

**Notes**
- Please do not cache `vendor` directory using `action/cache` as that will have side effects.
- 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.

- If you do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
```yaml
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
```

- If you support a range of `composer` dependencies and use `prefer-lowest` and `prefer-stable` options, you can store them in your matrix and add them to the keys.
```yaml
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.prefer }}-
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
```

### Cache Node.js Dependencies

If your project has node.js dependencies, you can persist NPM or yarn cache directory. The cached files are available across check-runs and will reduce the workflow execution time.
Expand Down

0 comments on commit d5adfa5

Please sign in to comment.