Skip to content

Commit

Permalink
Update PHP build and test composite actions
Browse files Browse the repository at this point in the history
  • Loading branch information
admdly committed Dec 5, 2023
1 parent 8ce538e commit 5431bcb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/actions/php-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: 'PHP Build'
description: ''
inputs:
cache-deps:
description: ''
description: 'Whether to cache composer dependencies.'
required: false
default: true
composer-args:
description: ''
description: 'The arguments to pass to composer when installing dependencies.'
required: false
default: ''
php-version:
description: ''
description: 'The PHP version.'
required: false
default: 'latest'
runs:
Expand Down
34 changes: 34 additions & 0 deletions .github/actions/php-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'PHP Test'
description: ''
inputs:
cache-deps:
description: ''
required: false
default: true
php-version:
description: ''
required: false
default: 'latest'
runs:
using: 'composite'
steps:
- name: 'Validate composer.json and composer.lock'
uses: php-actions/composer@v6
with:
command: validate
php_version: ${{ inputs.php-version }}

- name: 'Cache Composer Dependencies'
id: composer-cache
if: ${{ inputs.cache-deps }}
uses: actions/cache@v3
with:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
path: './src/vendor'

- name: 'Install Composer Dependencies'
if: ${{ steps.composer-cache.outputs.cache-hit != 'true' }}
uses: php-actions/composer@v6
with:
args: ${{ inputs.composer-args }}
php_version: ${{ inputs.php-version }}
7 changes: 1 addition & 6 deletions .github/workflows/php-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
path: './src/vendor'

- name: 'Install Composer Dependencies'
if: ${{ steps.composer-cache.outputs.cache-hit != 'true' }}
uses: php-actions/composer@v6
with:
args: ${{ inputs.composer_args }}
php_version: ${{ matrix.php }}


- name: 'Create Build Archive'
run: |
Expand Down

0 comments on commit 5431bcb

Please sign in to comment.