Skip to content

Commit d25b71c

Browse files
committed
chore: use step env instead of global env
1 parent 2cfbe75 commit d25b71c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

.github/workflows/phpunit.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ on:
1818
- 'phpunit*'
1919
- '.github/workflows/phpunit.yml'
2020

21-
env:
22-
COMPOSER_UPDATE_FLAGS: ""
23-
2421
jobs:
2522
main:
2623
name: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }} - ${{ matrix.dependencies }}
@@ -147,17 +144,15 @@ jobs:
147144
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
148145
restore-keys: ${{ runner.os }}-composer-
149146

150-
- name: Handle lowest dependencies update
151-
if: contains(matrix.dependencies, 'lowest')
152-
run: echo "COMPOSER_UPDATE_FLAGS=$COMPOSER_UPDATE_FLAGS --prefer-lowest" >> $GITHUB_ENV
153-
154147
- name: Install dependencies
155148
run: |
156149
if [ -f composer.lock ]; then
157150
composer install ${{ env.COMPOSER_UPDATE_FLAGS }} --no-progress --no-interaction --prefer-dist --optimize-autoloader
158151
else
159152
composer update ${{ env.COMPOSER_UPDATE_FLAGS }} --no-progress --no-interaction --prefer-dist --optimize-autoloader
160153
fi
154+
env:
155+
COMPOSER_UPDATE_FLAGS: ${{ matrix.dependencies == 'lowest' && '--prefer-lowest' || '' }}
161156

162157
- name: Test with PHPUnit
163158
run: vendor/bin/phpunit --verbose --coverage-text --testsuite main

0 commit comments

Comments
 (0)