Doctrine #385
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: Doctrine | |
on: | |
workflow_run: | |
workflows: [CI] | |
types: [completed] | |
workflow_dispatch: | |
inputs: | |
run_id: | |
description: Workflow run id | |
required: true | |
type: number | |
permissions: | |
contents: read | |
actions: read | |
checks: write | |
jobs: | |
test: | |
name: Doctrine tests | |
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
doctrine-branch: | |
- 2.19.x | |
- 3.2.x | |
php-branch: | |
- master | |
- PHP-8.4 | |
- PHP-8.3 | |
- PHP-8.2 | |
db-type: | |
- sqlite | |
- pgsql | |
- mysql | |
exclude: | |
- db-type: mysql # Errors re: collation | |
doctrine-branch: 3.2.x | |
- php-branch: master # Not ready yet | |
doctrine-branch: 2.19.x | |
env: | |
PHP_DIR: /opt/${{ matrix.php-branch }} | |
PHP: /opt/${{ matrix.php-branch }}/bin/php | |
services: | |
postgres: | |
image: ${{ ( matrix.db-type == 'pgsql' ) && 'postgres:latest' || '' }} | |
env: | |
POSTGRES_PASSWORD: secret | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
mysql: | |
image: ${{ ( matrix.db-type == 'mysql' ) && 'mysql:latest' || '' }} | |
env: | |
MYSQL_USER: user | |
MYSQL_PASSWORD: secret | |
MYSQL_DATABASE: doctrine_tests_tmp | |
MYSQL_ROOT_PASSWORD: secret | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 5s | |
--health-timeout 2s | |
--health-retries 5 | |
ports: | |
- 3306:3306 | |
steps: | |
- name: Setup | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -y -qq sqlite3 libicu74 | |
- name: Install PHP from artifact | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
name: ${{ matrix.php-branch }} | |
path: /opt/${{ matrix.php-branch }} | |
workflow: ${{ github.event.workflow.id || 'CI' }} | |
run_id: ${{ github.event.workflow_run.id || inputs.run_id }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: doctrine/orm | |
ref: ${{ matrix.doctrine-branch }} | |
- name: Checkout build configuration | |
uses: actions/checkout@v4 | |
with: | |
path: build | |
- name: Enable PHP and install Composer | |
run: build/php-composer.sh | |
- name: Copy build configuration | |
if: matrix.db-type != 'sqlite' | |
run: cp build/doctrine/phpunit-${{ matrix.db-type }}-${{ matrix.doctrine-branch }}.xml phpunit.xml | |
- name: Install dependencies with Composer | |
run: composer install | |
- name: Run tests | |
run: $PHP -d memory_limit=1G vendor/bin/phpunit --log-junit junit-${{ matrix.doctrine-branch }}-${{ matrix.php-branch }}-${{ matrix.db-type }}.xml | |
- name: Upload test report | |
uses: actions/upload-artifact@v4 | |
if: always() # always run even if the previous step fails | |
with: | |
name: test-results-${{ matrix.doctrine-branch }}-${{ matrix.php-branch }}-${{ matrix.db-type }} | |
path: 'junit-*.xml' | |
retention-days: 1 | |
report: | |
name: Collect results | |
runs-on: ubuntu-24.04 | |
needs: | |
- test | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: doctrine/orm | |
- name: Download Test Report | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
run_id: ${{ github.run_id }} | |
name: test-results-.* | |
name_is_regexp: true | |
if_no_artifact_found: warn | |
path: test-results | |
- name: Publish Test Report | |
uses: mbeccati/test-reporter@phpunit-support | |
with: | |
name: Doctrine Test results | |
path: '**/junit-*.xml' | |
reporter: java-junit | |
only-summary: true |