Skip to content

Commit

Permalink
Update php-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
admdly committed Nov 27, 2023
1 parent a5a798c commit a6415c7
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
default: '["latest"]'
required: false
type: string
phpstan_php_version:
description: 'The PHP version to use with PHPStan (if enabled)'
default: latest
required: false
type: string
download_artifact:
description: 'Whether to download the build archive (filename format e.g. build-archive-php8.1)'
default: true
Expand All @@ -43,31 +48,42 @@ jobs:
uses: actions/download-artifact@v3
with:
name: build-archive-php${{ matrix.php }}
path: /tmp/build
path: /tmp/builds

- name: Extract Build Archive
run: tar -xvf /tmp/builds/build.tar ./

- name: Prepare Build for Tests
- name: Download Files Required for Tests
if: ${{ inputs.prepare_script != '' }}
run: bash ${{ inputs.prepare_script }}
uses: actions/download-artifact@v3
with:
name: test-files
path: /tmp/test_files

- name: 'Run Script to Prepare Test Environment'
if: ${{ inputs.prepare_script != '' }}
run: |
bash /tmp/test_files/${{ inputs.prepare_script }}
mv /tmp/test_files/phpstan.neon ./
mv /tmp/test_files/phpstan-baseline.neon ./
mv /tmp/test_files/phpunit.xml.dist ./
- name: PHPStan
if: ${{ inputs.enable_phpstan }}
if: ${{ inputs.enable_phpstan && matrix.php == inputs.phpstan_php_version }}
id: phpstan
uses: php-actions/phpstan@v3
with:
configuration: phpstan.neon
memory_limit: 512M
php_version: ${{ matrix.php }}
version: composer
php_version: ${{ inputs.phpstan_php_version }}
version: latest

- name: PHPUnit
if: ${{ inputs.enable_phpunit }}
id: phpunit
uses: php-actions/phpstan@v3
with:
version: composer
version: 10
php_version: ${{ matrix.php }}
configuration: phpunit.xml.dist
env:
Expand Down

0 comments on commit a6415c7

Please sign in to comment.