Add TestDox custom Composer script and improved tests for that use an… #2004
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: Main | |
on: | |
push: | |
branches: [ main, develop, wip ] | |
paths-ignore: | |
- .idea/** | |
- docs/** | |
pull_request: | |
branches: [ develop ] | |
paths-ignore: | |
- .idea/** | |
- docs/** | |
schedule: | |
# Every Monday at 00:00:00 UTC. | |
# @see https://crontab.cronhub.io/ | |
- cron: "0 0 * * 1" | |
jobs: | |
static_analysis: | |
name: "Static Analysis" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Set up PHP" | |
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action | |
with: | |
php-version: "8.1" | |
coverage: none | |
- name: "Checkout code" | |
uses: actions/checkout@v3 # https://github.com/marketplace/actions/checkout | |
- name: "Install dependencies" | |
uses: ramsey/composer-install@v2 # https://github.com/marketplace/actions/install-composer-dependencies | |
- name: "Run all static analysis tools" | |
run: "composer static" | |
testdox: | |
name: "TestDox" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Set up PHP" | |
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action | |
with: | |
php-version: "8.1" | |
ini-values: assert.active=1, assert.exception=1, zend.assertions=1 | |
coverage: none | |
- name: "Checkout code" | |
uses: actions/checkout@v3 # https://github.com/marketplace/actions/checkout | |
- name: "Install dependencies" | |
uses: ramsey/composer-install@v2 # https://github.com/marketplace/actions/install-composer-dependencies | |
- name: "Run tests with TestDox" | |
run: "composer dox" | |
tests: | |
name: "Test: ${{ matrix.os }} / deps-${{ matrix.dependencies }}" | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
php: [ "8.1" ] | |
dependencies: [ lowest, highest ] | |
steps: | |
- name: "Debugging info" | |
run: "rsync --version | head -1" | |
if: ${{ runner.os != 'Windows' }} | |
- name: "Set up PHP w/ Coverage" | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' }} | |
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action | |
with: | |
php-version: "${{ matrix.php }}" | |
ini-values: assert.active=1, assert.exception=1, zend.assertions=1 | |
- name: "Set up PHP w/o Coverage" | |
if: ${{ !( matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' ) }} | |
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action | |
with: | |
php-version: "${{ matrix.php }}" | |
coverage: none | |
ini-values: assert.active=1, assert.exception=1, zend.assertions=1 | |
- name: "PHP info" | |
run: "php -i" | |
- name: "Checkout code" | |
uses: actions/checkout@v3 # https://github.com/marketplace/actions/checkout | |
- name: "Install dependencies" | |
uses: ramsey/composer-install@v2 # https://github.com/marketplace/actions/install-composer-dependencies | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: "Run core tests with coverage" | |
run: "composer test" | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' }} | |
# There's no reason to generate coverage data on multiple jobs--the result should be the same. | |
- name: "Run core tests without coverage" | |
run: "./vendor/bin/phpunit --no-coverage --exclude-group=windows_only" | |
if: ${{ runner.os != 'Windows' && !( matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' ) }} | |
- name: "Run Windows tests" | |
run: "./vendor/bin/phpunit --no-coverage --exclude-group=no_windows" | |
if: ${{ runner.os == 'Windows' }} | |
performance: | |
name: "Performance" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Set up PHP" | |
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action | |
with: | |
php-version: "8.1" | |
coverage: none | |
- name: "Checkout code" | |
uses: actions/checkout@v3 # https://github.com/marketplace/actions/checkout | |
- name: "Install dependencies" | |
uses: ramsey/composer-install@v2 # https://github.com/marketplace/actions/install-composer-dependencies | |
- name: "Run performance tests" | |
run: "composer phpbench -- --progress=plain --ansi" |