Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions:
contents: read

Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions:
contents: read

Expand Down Expand Up @@ -81,7 +85,7 @@ jobs:
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
coverage: ${{ matrix.calculate-code-coverage == true && 'xdebug' || 'none' }}
extensions: ctype, json, mbstring, pdo_pgsql
tools: composer

Expand All @@ -93,9 +97,10 @@ jobs:
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-php-${{ matrix.php }}-pg-${{ matrix.postgres }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
${{ runner.os }}-php-${{ matrix.php }}-pg-${{ matrix.postgres }}-
${{ runner.os }}-php-${{ matrix.php }}-

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
Expand Down Expand Up @@ -125,7 +130,12 @@ jobs:
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres_doctrine_test -c "SELECT PostGIS_Version();"

- name: Run integration test suite
run: composer run-integration-tests
run: |
if [ "${{ matrix.calculate-code-coverage }}" = "true" ]; then
XDEBUG_MODE=coverage composer run-integration-tests
else
composer run-integration-tests -- --no-coverage
fi
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions:
contents: read

Expand Down Expand Up @@ -63,7 +67,7 @@ jobs:
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
coverage: ${{ matrix.calculate-code-coverage == true && 'xdebug' || 'none' }}
extensions: ctype, json, mbstring
tools: composer

Expand All @@ -72,9 +76,10 @@ jobs:
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-php-${{ matrix.php }}-orm-${{ matrix.doctrine-orm }}-lexer-${{ matrix.doctrine-lexer }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
${{ runner.os }}-php-${{ matrix.php }}-orm-${{ matrix.doctrine-orm }}-lexer-${{ matrix.doctrine-lexer }}-
${{ runner.os }}-php-${{ matrix.php }}-

- name: Install Doctrine Lexer dependency
run: |
Expand Down Expand Up @@ -105,7 +110,12 @@ jobs:
continue-on-error: ${{ matrix.continue-on-error || false }}

- name: Run unit test suite
run: composer run-unit-tests
run: |
if [ "${{ matrix.calculate-code-coverage }}" = "true" ]; then
XDEBUG_MODE=coverage composer run-unit-tests
else
composer run-unit-tests -- --no-coverage
fi

- name: Upload coverage results to Coveralls
if: matrix.calculate-code-coverage == true
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
tests:
override:
- php-scrutinizer-run
- command: composer run-unit-tests
- command: XDEBUG_MODE=coverage composer run-unit-tests
coverage:
file: var/logs/test-coverage/unit/clover.xml
format: clover
Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,11 @@
"phpstan": [
"phpstan analyse --configuration=./ci/phpstan/config.neon"
],
"phpunit": [
"XDEBUG_MODE=coverage phpunit"
],
"phpunit:unit": [
"@phpunit --configuration=./ci/phpunit/config-unit.xml"
"phpunit --configuration=./ci/phpunit/config-unit.xml"
],
"phpunit:integration": [
"@phpunit --configuration=./ci/phpunit/config-integration.xml"
"phpunit --configuration=./ci/phpunit/config-integration.xml"
],
"rector": [
"rector --config=./ci/rector/config.php --ansi --no-progress-bar"
Expand Down
Loading