Skip to content

Commit

Permalink
minor #330 Use Flex tool from setup-php action to lock Symfony versio…
Browse files Browse the repository at this point in the history
…n (mbabker)

This PR was merged into the 1.11 branch.

Discussion
----------

The `shivammathur/setup-php` action provides Flex as a global tool when setting up the environment.  So instead of installing it through an extra step, we can use the resources the action already provides.

Next, setting the `SYMFONY_REQUIRE` env var is the same as writing the `extra.symfony.require` key in `composer.json`.

All told, we can avoid a couple of extra Composer commands by using resources that are already available.  It's a minor optimization, but it's one nonetheless.

Commits
-------

f35d551 Use Flex tool from setup-php action to lock Symfony version
  • Loading branch information
GSadee authored Sep 5, 2022
2 parents 8cd068a + f35d551 commit 14d11ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
php-version: "${{ matrix.php }}"
extensions: intl
tools: symfony
tools: flex,symfony
coverage: none

-
Expand Down Expand Up @@ -92,12 +92,10 @@ jobs:
${{ runner.os }}-php-${{ matrix.php }}-composer-
-
name: Restrict Symfony version
if: matrix.symfony != ''
name: Configure global composer
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"
-
name: Restrict Sylius version
Expand All @@ -107,6 +105,8 @@ jobs:
-
name: Install PHP dependencies
run: composer install --no-interaction
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

-
name: Get Yarn cache directory
Expand Down

0 comments on commit 14d11ea

Please sign in to comment.