Skip to content

Commit 09814d5

Browse files
committed
minor symfony#42007 [GHA] Clarify some bits in the deps=high script (wouterj)
This PR was merged into the 4.4 branch. Discussion ---------- [GHA] Clarify some bits in the deps=high script | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix - | License | MIT | Doc PR | I had some difficulty understanding how flipped tests worked. Luckily, `@nicolas`-grekas was available to answer some questions. However, I'm sure that I've forgotten the logic in about a week time, so I think it's worth clarifying the code a bit (but feel free to close if it's just me). Commits ------- ff08dca [GHA] Clarify some bits in the deps=high script
2 parents 57e3c5f + ff08dca commit 09814d5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/unit-tests.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,24 +184,26 @@ jobs:
184184
# matrix.mode = high-deps
185185
echo "$COMPONENTS" | xargs -n1 | parallel -j +3 "_run_tests {} 'cd {} && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
186186
187+
# get a list of the patched components (relies on .github/build-packages.php being called in the previous step)
187188
(cd src/Symfony/Component/HttpFoundation; mv composer.bak composer.json)
188-
COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
189+
PATCHED_COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
189190
190-
if [[ $COMPONENTS && $SYMFONY_VERSION = *.4 ]]; then
191+
# for x.4 branches, checkout and test previous major with the patched components (only for patched components)
192+
if [[ $PATCHED_COMPONENTS && $SYMFONY_VERSION = *.4 ]]; then
191193
export FLIP='^'
192194
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
193195
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"
194196
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
195197
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
196198
git fetch --depth=2 origin $SYMFONY_VERSION
197199
git checkout -m FETCH_HEAD
198-
COMPONENTS=$(echo "$COMPONENTS" | xargs dirname | xargs -n1 -I{} bash -c "[ -e '{}/phpunit.xml.dist' ] && echo '{}'" | sort || true)
200+
PATCHED_COMPONENTS=$(echo "$PATCHED_COMPONENTS" | xargs dirname | xargs -n1 -I{} bash -c "[ -e '{}/phpunit.xml.dist' ] && echo '{}'" | sort || true)
199201
(cd src/Symfony/Component/HttpFoundation; composer require --dev --no-update mongodb/mongodb)
200-
if [[ $COMPONENTS ]]; then
202+
if [[ $PATCHED_COMPONENTS ]]; then
201203
echo "::group::install phpunit"
202204
./phpunit install
203205
echo "::endgroup::"
204-
echo "$COMPONENTS" | parallel -j +3 "_run_tests {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
206+
echo "$PATCHED_COMPONENTS" | parallel -j +3 "_run_tests {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
205207
fi
206208
fi
207209

0 commit comments

Comments
 (0)