Skip to content

Commit f636094

Browse files
committed
[CI] Parallelize Windows Unit tests
1 parent 5cdef70 commit f636094

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ jobs:
8080
echo "Packages: $PACKAGES"
8181
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
8282
83+
- name: Configure environment for Windows
84+
if: matrix.os == 'windows-latest'
85+
run: |
86+
# Install MSYS2
87+
choco install msys2 -y --no-progress
88+
89+
# Install "parallel" utility
90+
C:\\tools\\msys64\\usr\\bin\\bash -lc "pacman -S --noconfirm parallel"
91+
8392
- name: Setup PHP
8493
uses: shivammathur/setup-php@v2
8594
with:
@@ -108,8 +117,7 @@ jobs:
108117
- name: Build root packages
109118
run: php .github/build-packages.php
110119

111-
- name: Run packages tests (Unix)
112-
if: matrix.os != 'windows-latest'
120+
- name: Run packages tests
113121
run: |
114122
source .github/workflows/.utils.sh
115123
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} \
@@ -119,28 +127,6 @@ jobs:
119127
&& if [ {} = LiveComponent ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
120128
&& $PHPUNIT)'"
121129
122-
- name: Run packages tests (Windows)
123-
if: matrix.os == 'windows-latest'
124-
run: |
125-
source .github/workflows/.utils.sh
126-
127-
# parallel is not available on Windows, so we need to run the tests sequentially
128-
FAILED_PACKAGES=""
129-
for PACKAGE in $PACKAGES; do
130-
if ! PACKAGE="$PACKAGE" _run_task_sequential $PACKAGE \
131-
'(cd src/$PACKAGE \
132-
&& $COMPOSER_MIN_STAB \
133-
&& $COMPOSER_UP \
134-
&& if [ "$PACKAGE" = "LiveComponent" ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
135-
&& $PHPUNIT)'; then
136-
FAILED_PACKAGES="$FAILED_PACKAGES $PACKAGE"
137-
fi
138-
done
139-
140-
if [ -n "$FAILED_PACKAGES" ]; then
141-
echo "The following packages failed:$FAILED_PACKAGES"
142-
exit 1
143-
fi
144130
js:
145131
runs-on: ubuntu-latest
146132
strategy:

0 commit comments

Comments
 (0)