Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ PHP Code compiler - Phar executable compiling utility
- [Install](#install)
- [Requirements](#requirements)
- [Quick install](#quick-install)
- [Github Action](#github-action)
- [License](#license)

## Usage
Expand Down Expand Up @@ -136,6 +137,38 @@ _Add execution permissions to the binary_
chmod +x ${BINDIR}/phpcc
```

### Github Action

A [github action](actions/install/action.yaml) is available for integration in CI scripts.

The action will install PHP (in the desired version), and the `phpcc` binary.

Synopsis: use `yannoff/phpcc/actions/install@<release>`.

#### Integration example

_Installing phpcc version 1.2.4 / PHP 8.0_

```yaml
# ...
jobs:
job1:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install PHP & PHPCodeCompiler
uses: yannoff/phpcc/actions/[email protected]
with:
php-version: 8.0

- name: Compile ACME application
run: phpcc -q -e bin/acme.php -d src/Acme:php -d vendor/ -f LICENSE -o bin/acme

- name: Smoke test (show version)
run: bin/acme --version
```

## License

Licensed under the [MIT License](LICENSE).
35 changes: 35 additions & 0 deletions actions/install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# This file is part of the PHP Code Compiler project
#
# Copyright (c) Yannoff (https://github.com/yannoff)
#
# @project PHP Code Compiler (yannoff/phpcc)
# @homepage https://github.com/yannoff/phpcc
# @license https://github.com/yannoff/phpcc/blob/main/LICENSE
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.
#

name: Install PHP Code Compiler (phpcc)
author: Yannoff
description: Install PHP Environment & Download PHP Code Compiler binary (phpcc)

inputs:
php-version:
description: The PHP version to install
required: true

runs:
using: composite
steps:
- name: Install PHP Environment
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
coverage: none

- name: Download phpcc binary
id: phpcc
shell: bash
run: curl -SL -O https://github.com/yannoff/phpcc/releases/latest/download/phpcc && chmod +x ./phpcc && mv -v phpcc /usr/local/bin