Merge pull request #9227 from samsonasik/refactor-enable-rector-code-… #12359
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHPUnit | |
on: | |
push: | |
branches: | |
- develop | |
- '4.*' | |
paths: | |
- 'app/**.php' | |
- 'system/**.php' | |
- 'tests/**.php' | |
- 'spark' | |
- composer.json | |
- phpunit.xml.dist | |
- .github/workflows/test-phpunit.yml | |
- .github/workflows/reusable-phpunit-test.yml | |
pull_request: | |
branches: | |
- develop | |
- '4.*' | |
paths: | |
- 'app/**.php' | |
- 'system/**.php' | |
- 'tests/**.php' | |
- 'spark' | |
- composer.json | |
- phpunit.xml.dist | |
- .github/workflows/test-phpunit.yml | |
- .github/workflows/reusable-phpunit-test.yml | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
# Any environment variables set in an env context defined at the workflow level | |
# in the caller workflow are not propagated to the called workflow. | |
coverage-php-version: | |
name: Setup PHP Version for Code Coverage | |
runs-on: ubuntu-22.04 | |
outputs: | |
version: ${{ steps.coverage-php-version.outputs.version }} | |
steps: | |
- id: coverage-php-version | |
run: | | |
echo "version=8.2" >> $GITHUB_OUTPUT | |
sanity-tests: | |
name: Others | |
needs: coverage-php-version | |
strategy: | |
matrix: | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
include: | |
- php-version: '8.3' | |
composer-option: '--ignore-platform-req=php' | |
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo | |
with: | |
job-name: Sanity Tests | |
php-version: ${{ matrix.php-version }} | |
job-id: sanity-tests | |
group-name: Others | |
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
extra-extensions: imagick, redis, memcached | |
extra-composer-options: ${{ matrix.composer-option }} | |
database-live-tests: | |
name: DatabaseLive | |
needs: | |
- coverage-php-version | |
- sanity-tests | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
db-platform: | |
- MySQLi | |
- OCI8 | |
- Postgre | |
- SQLSRV | |
- SQLite3 | |
mysql-version: | |
- '8.0' | |
include: | |
- php-version: '8.1' | |
db-platform: MySQLi | |
mysql-version: '5.7' | |
- php-version: '8.3' | |
composer-option: '--ignore-platform-req=php' | |
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo | |
with: | |
job-name: '' | |
php-version: ${{ matrix.php-version }} | |
job-id: database-live-tests | |
db-platform: ${{ matrix.db-platform }} | |
mysql-version: ${{ matrix.mysql-version }} | |
group-name: DatabaseLive | |
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
extra-extensions: mysqli, oci8, pgsql, sqlsrv, sqlite3 | |
extra-composer-options: ${{ matrix.composer-option }} | |
separate-process-tests: | |
name: SeparateProcess | |
needs: | |
- coverage-php-version | |
- sanity-tests | |
strategy: | |
matrix: | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
include: | |
- php-version: '8.3' | |
composer-option: '--ignore-platform-req=php' | |
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo | |
with: | |
job-name: '' | |
php-version: ${{ matrix.php-version }} | |
job-id: separate-process-tests | |
group-name: SeparateProcess | |
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
enable-coverage: true # needs xdebug for assertHeaderEmitted() tests | |
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
extra-extensions: mysqli, oci8, pgsql, sqlsrv-5.10.1, sqlite3 | |
extra-composer-options: ${{ matrix.composer-option }} | |
cache-live-tests: | |
name: CacheLive | |
needs: | |
- coverage-php-version | |
- sanity-tests | |
strategy: | |
matrix: | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
include: | |
- php-version: '8.3' | |
composer-option: '--ignore-platform-req=php' | |
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo | |
with: | |
job-name: Cache Live Tests | |
php-version: ${{ matrix.php-version }} | |
job-id: cache-live-tests | |
group-name: CacheLive | |
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} | |
extra-extensions: redis, memcached | |
extra-composer-options: ${{ matrix.composer-option }} | |
coveralls: | |
name: Upload coverage results to Coveralls | |
if: github.repository_owner == 'codeigniter4' | |
needs: | |
- coverage-php-version | |
- sanity-tests | |
- cache-live-tests | |
- database-live-tests | |
- separate-process-tests | |
uses: ./.github/workflows/reusable-coveralls.yml # @TODO Extract to codeigniter4/.github repo | |
with: | |
php-version: ${{ needs.coverage-php-version.outputs.version }} |