Skip to content

Commit 3e0fedc

Browse files
committed
minor #237 Simply code-quality matrix (nicolas-grekas)
This PR was merged into the main branch. Discussion ---------- Simply code-quality matrix | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | - | License | MIT For the phpstan job, we don't need any matrix. We only care about what phpstan can report with latest deps. For the phpunit ones, we should always test with dev dependencies, like we're doing on symfony/symfony. https://github.com/symfony/ai/pull/237/files?w=1 Commits ------- 48f7dd9 Simply code-quality matrix
2 parents 90a5d10 + 48f7dd9 commit 3e0fedc

File tree

2 files changed

+28
-44
lines changed

2 files changed

+28
-44
lines changed

.github/workflows/code-quality.yaml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,50 +21,38 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php-version: [ '8.2', '8.3', '8.4']
25-
dependency-version: ['']
26-
symfony-version: ['']
27-
minimum-stability: ['stable']
28-
include:
29-
# lowest deps
30-
- php-version: '8.2'
31-
dependency-version: 'lowest'
32-
# LTS version of Symfony
33-
- php-version: '8.2'
34-
symfony-version: '6.4.*'
24+
php-version: [ '8.4' ]
3525
steps:
36-
- name: Checkout
37-
uses: actions/checkout@v4
26+
- name: Checkout
27+
uses: actions/checkout@v4
3828

3929
- name: Configure environment
4030
run: |
4131
echo COLUMNS=120 >> $GITHUB_ENV
42-
echo COMPOSER_MIN_STAB='composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} --ansi' >> $GITHUB_ENV
43-
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
32+
echo COMPOSER_UP='composer update --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
4433
echo PHPSTAN='vendor/bin/phpstan' >> $GITHUB_ENV
4534
4635
PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "examples" | sort | tr '\n' ' ')
4736
echo "Packages: $PACKAGES"
4837
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
4938
50-
- name: Setup PHP
51-
uses: shivammathur/setup-php@v2
52-
with:
53-
php-version: '8.2'
54-
tools: flex
39+
- name: Setup PHP
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: ${{ matrix.php-version }}
5543

56-
- name: Get composer cache directory
57-
id: composer-cache
58-
run: |
59-
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
44+
- name: Get composer cache directory
45+
id: composer-cache
46+
run: |
47+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6048
6149
- name: Cache packages dependencies
6250
uses: actions/cache@v4
6351
with:
6452
path: ${{ steps.composer-cache.outputs.dir }}
65-
key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}-${{ hashFiles('src/**/composer.json') }}
53+
key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ hashFiles('src/**/composer.json') }}
6654
restore-keys: |
67-
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}
55+
${{ runner.os }}-composer-packages-${{ matrix.php-version }}
6856
6957
- name: Install root dependencies
7058
uses: ramsey/composer-install@v3
@@ -76,4 +64,4 @@ jobs:
7664
run: |
7765
source .github/workflows/.utils.sh
7866
79-
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_MIN_STAB && $COMPOSER_UP && $PHPSTAN)'"
67+
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_UP && $PHPSTAN)'"

.github/workflows/unit-tests.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ jobs:
2626
php-version: ['8.2', '8.3', '8.4']
2727
dependency-version: ['']
2828
symfony-version: ['']
29-
minimum-stability: ['stable']
3029
include:
31-
# dev packages (probably not needed to have multiple such jobs)
32-
- minimum-stability: 'dev'
33-
php-version: '8.4'
3430
# lowest deps
3531
- php-version: '8.2'
3632
dependency-version: 'lowest'
@@ -40,14 +36,14 @@ jobs:
4036

4137
env:
4238
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=6.4' }}
39+
4340
steps:
4441
- uses: actions/checkout@v4
4542

4643
- name: Configure environment
4744
run: |
4845
echo COLUMNS=120 >> $GITHUB_ENV
49-
echo COMPOSER_MIN_STAB='composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} --ansi' >> $GITHUB_ENV
50-
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
46+
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
5147
echo PHPUNIT='vendor/bin/phpunit' >> $GITHUB_ENV
5248
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
5349
@@ -58,22 +54,22 @@ jobs:
5854
- name: Setup PHP
5955
uses: shivammathur/setup-php@v2
6056
with:
61-
php-version: ${{ matrix.php-version }}
62-
tools: flex
63-
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
57+
php-version: ${{ matrix.php-version }}
58+
tools: flex
59+
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
6460

65-
- name: Get composer cache directory
66-
id: composer-cache
67-
run: |
68-
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
61+
- name: Get composer cache directory
62+
id: composer-cache
63+
run: |
64+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6965
7066
- name: Cache packages dependencies
7167
uses: actions/cache@v4
7268
with:
7369
path: ${{ steps.composer-cache.outputs.dir }}
74-
key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}-${{ hashFiles('src/**/composer.json') }}
70+
key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ hashFiles('src/**/composer.json') }}
7571
restore-keys: |
76-
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}
72+
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}
7773
7874
- name: Install root dependencies
7975
uses: ramsey/composer-install@v3
@@ -83,6 +79,6 @@ jobs:
8379

8480
- name: Run packages tests
8581
run: |
86-
source .github/workflows/.utils.sh
82+
source .github/workflows/.utils.sh
8783
88-
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_MIN_STAB && $COMPOSER_UP && $PHPUNIT)'"
84+
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_UP && $PHPUNIT)'"

0 commit comments

Comments
 (0)