From cf6a6e5df588fd00bf07c6a611251f04d8ada9a8 Mon Sep 17 00:00:00 2001 From: Adam Daley Date: Mon, 4 Dec 2023 20:16:43 +0000 Subject: [PATCH] Add PHP build and test composite actions --- .github/actions/php-build/action.yml | 38 ++++++++++++++++++++++++++++ .github/actions/php-test/action.yml | 0 2 files changed, 38 insertions(+) create mode 100644 .github/actions/php-build/action.yml create mode 100644 .github/actions/php-test/action.yml diff --git a/.github/actions/php-build/action.yml b/.github/actions/php-build/action.yml new file mode 100644 index 0000000..2e567a7 --- /dev/null +++ b/.github/actions/php-build/action.yml @@ -0,0 +1,38 @@ +name: 'PHP Build' +description: '' +inputs: + cache-deps: + description: '' + required: false + default: true + composer-args: + description: '' + required: false + default: '' + 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 }} \ No newline at end of file diff --git a/.github/actions/php-test/action.yml b/.github/actions/php-test/action.yml new file mode 100644 index 0000000..e69de29