Skip to content

Commit 44b7f7b

Browse files
committed
minor #1152 [CI] Use REQUIRED_PHP_EXTENSIONS env instead of --ignore-platform-req (OskarStark)
This PR was merged into the main branch. Discussion ---------- [CI] Use `REQUIRED_PHP_EXTENSIONS` env instead of `--ignore-platform-req` | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | -- | License | MIT - Add REQUIRED_PHP_EXTENSIONS env to code-quality and deptrac workflows - Install mongodb and redis extensions via setup-php instead of ignoring platform requirements - Remove --ignore-platform-req=ext-mongodb from all composer commands - Standardize all workflows to use 'mongodb, redis' extensions Commits ------- 66a3d58 Use REQUIRED_PHP_EXTENSIONS env instead of --ignore-platform-req
2 parents 363dc0c + 66a3d58 commit 44b7f7b

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.github/workflows/code-quality.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

17+
env:
18+
REQUIRED_PHP_EXTENSIONS: 'mongodb, redis'
19+
1720
jobs:
1821
phpstan:
1922
name: PHPStan
@@ -29,7 +32,7 @@ jobs:
2932
- name: Configure environment
3033
run: |
3134
echo COLUMNS=120 >> $GITHUB_ENV
32-
echo COMPOSER_UP='composer update --no-progress --no-interaction --no-scripts --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
35+
echo COMPOSER_UP='composer update --no-progress --no-interaction --no-scripts --ansi' >> $GITHUB_ENV
3336
echo PHPSTAN='vendor/bin/phpstan' >> $GITHUB_ENV
3437
3538
PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -not -path "*/Bridge/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "examples" | sort | tr '\n' ' ')
@@ -40,6 +43,7 @@ jobs:
4043
uses: shivammathur/setup-php@v2
4144
with:
4245
php-version: ${{ matrix.php-version }}
46+
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
4347

4448
- name: Get composer cache directory
4549
id: composer-cache

.github/workflows/deptrac.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

17+
env:
18+
REQUIRED_PHP_EXTENSIONS: 'mongodb, redis'
19+
1720
jobs:
1821
deptrac:
1922
name: deptrac
@@ -25,12 +28,13 @@ jobs:
2528
- name: Configure environment
2629
run: |
2730
echo COLUMNS=120 >> $GITHUB_ENV
28-
echo COMPOSER_UP='composer update --prefer-lowest --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
31+
echo COMPOSER_UP='composer update --prefer-lowest --no-progress --no-interaction --ansi' >> $GITHUB_ENV
2932
3033
- name: Setup PHP
3134
uses: shivammathur/setup-php@v2
3235
with:
3336
php-version: '8.5'
37+
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
3438

3539
- name: Get composer cache directory
3640
id: composer-cache

.github/workflows/integration-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Configure environment
4848
run: |
4949
echo COLUMNS=120 >> $GITHUB_ENV
50-
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest --prefer-stable' || '' }} --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
50+
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest --prefer-stable' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV
5151
echo PHPUNIT='vendor/bin/phpunit' >> $GITHUB_ENV
5252
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
5353

.github/workflows/unit-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
env:
18-
REQUIRED_PHP_EXTENSIONS: 'mongodb'
18+
REQUIRED_PHP_EXTENSIONS: 'mongodb, redis'
1919

2020
jobs:
2121
php:
@@ -46,7 +46,7 @@ jobs:
4646
- name: Configure environment
4747
run: |
4848
echo COLUMNS=120 >> $GITHUB_ENV
49-
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest --prefer-stable' || '' }} --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
49+
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest --prefer-stable' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV
5050
echo PHPUNIT='vendor/bin/phpunit' >> $GITHUB_ENV
5151
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
5252

0 commit comments

Comments
 (0)