diff --git a/.github/workflows/php-build.yml b/.github/workflows/php-build.yml deleted file mode 100644 index 1dfef3e..0000000 --- a/.github/workflows/php-build.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: PHP Build and Archive - -on: - workflow_call: - inputs: - cache_deps: - description: 'Whether to cache composer dependencies.' - default: true - required: false - type: boolean - composer_args: - description: 'The arguments to pass to composer when installing dependencies.' - default: '' - required: false - type: string - php_versions: - description: 'The PHP versions to create builds for (as JSON string array).' - default: '["latest"]' - required: false - type: string - upload_artifact: - description: 'Whether to upload the build archive(s) as artifact(s).' - default: true - required: false - type: boolean - upload_artifact_prefix: - description: > - 'The artifact name prefix to use when uploading artifacts, if enabled (the - final artifact name(s) will be a concatenation of prefix and PHP version(s)).' - default: 'build-archive-php' - required: false - type: string - -jobs: - build: - name: 'PHP ${{ matrix.php }}' - runs-on: ubuntu-latest - strategy: - matrix: - php: ${{ fromJSON(inputs.php_versions) }} - steps: - - uses: actions/checkout@v4 - - - name: 'Validate composer.json and composer.lock' - uses: php-actions/composer@v6 - with: - command: validate - php_version: ${{ matrix.php }} - - - 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: ${{ matrix.php }} - - - name: 'Create Build Archive' - run: | - mkdir /tmp/builds/ && tar -cvf /tmp/builds/build.tar ./ - - - name: 'Upload Build Archive' - if: ${{ inputs.upload_artifact }} - uses: actions/upload-artifact@v3 - with: - if-no-files-found: 'error' - name: '${{ inputs.upload_artifact_prefix }}-${{ matrix.php }}' - path: '/tmp/builds' - retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/php-test.yml b/.github/workflows/php-test.yml deleted file mode 100644 index 93bb409..0000000 --- a/.github/workflows/php-test.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: PHP Tests - -on: - workflow_call: - inputs: - download_artifact: - description: 'Whether to download the build archive(s).' - default: true - required: false - type: boolean - download_artifact_prefix: - description: 'The artifact name prefix to use when downloading artifacts, if enabled.' - default: 'build-archive-php' - required: false - type: string - download_test_files: - description: 'Whether to download files required for tests (artifact must be named test-files).' - default: false - required: false - type: boolean - php_versions: - description: 'The PHP versions to run tests for (as JSON string array).' - default: '["latest"]' - required: false - type: string - prepare_test_script: - description: 'The name of a bash script prepare the test environment in test-files artifact.' - default: '' - required: false - type: string - - # PHPStan options - phpstan_enable: - description: 'Whether to enable PHPStan.' - default: true - required: false - type: boolean - phpstan_config_file: - description: 'The location of the PHPStan configuration file (phpstan.neon).' - default: 'phpstan.neon' - required: false - type: string - phpstan_memory_limit: - description: 'The memory limit for PHPStan.' - default: '512M' - required: false - type: string - phpstan_php_version: - description: 'The PHP version to use with PHPStan.' - default: 'latest' - required: false - type: string - phpstan_version: - description: 'The version of PHPStan to use.' - default: 'latest' - required: false - type: string - - # PHPUnit options - phpunit_enable: - description: 'Whether to enable PHPUnit.' - default: true - required: false - type: boolean - phpunit_config_file: - description: 'The location of the PHPUnit configuration file (phpunit.xml.dist).' - default: 'phpunit.xml.dist' - required: false - type: string - phpunit_version: - description: 'The version of PHPUnit to use.' - default: 'latest' - required: false - type: string - -jobs: - php-test: - name: 'PHP ${{ matrix.php }}' - runs-on: ubuntu-latest - strategy: - matrix: - php: ${{ fromJSON(inputs.php_versions) }} - steps: - - name: 'Download PHP Build Archive' - if: ${{ inputs.download_artifact }} - uses: actions/download-artifact@v3 - with: - name: '${{ inputs.download_artifact_prefix }}-${{ matrix.php }}' - path: /tmp/builds - - - name: 'Extract Build Archive' - run: tar -xvf /tmp/builds/build.tar ./ - - - name: 'Download Required Test Files' - if: ${{ inputs.download_test_files }} - uses: actions/download-artifact@v3 - with: - name: test-files - path: ./ - - - name: 'Run Script to Prepare Test Environment' - if: ${{ inputs.prepare_test_script != '' }} - run: bash ./${{ inputs.prepare_test_script }} - - - name: 'PHPStan' - if: ${{ inputs.phpstan_enable && matrix.php == inputs.phpstan_php_version }} - uses: php-actions/phpstan@v3 - with: - configuration: ${{ inputs.phpstan_config_file }} - memory_limit: ${{ inputs.phpstan_memory_limit }} - php_version: ${{ inputs.phpstan_php_version }} - version: ${{ inputs.phpstan_version }} - - - name: 'PHPUnit' - if: ${{ inputs.phpunit_enable }} - uses: php-actions/phpunit@v3 - with: - configuration: ${{ inputs.phpunit_config_file }} - php_version: ${{ matrix.php }} - version: ${{ inputs.phpunit_version }}