From a6415c71aeb96d60ea7e8c7a2310bda8d098fbcc Mon Sep 17 00:00:00 2001 From: Adam Daley Date: Sun, 26 Nov 2023 23:55:19 +0000 Subject: [PATCH] Update php-test.yml --- .github/workflows/php-test.yml | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/php-test.yml b/.github/workflows/php-test.yml index be10523..30b9dd7 100644 --- a/.github/workflows/php-test.yml +++ b/.github/workflows/php-test.yml @@ -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 @@ -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: