11name : Unit Tests
22
3+ defaults :
4+ run :
5+ shell : bash
6+
37on :
48 push :
59 paths-ignore :
@@ -18,14 +22,15 @@ concurrency:
1822
1923jobs :
2024 php :
21- runs-on : ubuntu-latest
25+ runs-on : ${{ matrix.os || ' ubuntu-latest' }}
2226 strategy :
2327 fail-fast : false
2428 matrix :
2529 php-version : ['8.1', '8.2', '8.3', '8.4']
2630 dependency-version : ['']
2731 symfony-version : ['']
2832 minimum-stability : ['stable']
33+ os : ['']
2934 include :
3035 # dev packages (probably not needed to have multiple such jobs)
3136 - minimum-stability : ' dev'
3641 # LTS version of Symfony
3742 - php-version : ' 8.1'
3843 symfony-version : ' 6.4.*'
44+ - php-version : ' 8.1'
45+ symfony-version : ' 6.4.*'
46+ os : ' windows-latest'
3947
4048 env :
4149 SYMFONY_REQUIRE : ${{ matrix.symfony-version || '>=5.4' }}
6270 echo "Packages: $PACKAGES"
6371 echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
6472
73+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
74+ apt-get install -y parallel
75+ fi
76+
6577 - name : Setup PHP
6678 uses : shivammathur/setup-php@v2
6779 with :
@@ -78,13 +90,24 @@ jobs:
7890 run : |
7991 source .github/workflows/.utils.sh
8092
81- echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} \
82- '(cd src/{} \
83- && $COMPOSER_MIN_STAB \
84- && $COMPOSER_UP \
85- && if [ {} = LiveComponent ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
86- && $PHPUNIT)'"
87-
93+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
94+ # parallel is not available on Windows, so we need to run the tests sequentially
95+ for PACKAGE in $PACKAGES; do
96+ _run_task $PACKAGE \
97+ '(cd src/$PACKAGE \
98+ && $COMPOSER_MIN_STAB \
99+ && $COMPOSER_UP \
100+ && if [ $PACKAGE = LiveComponent ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
101+ && $PHPUNIT)'
102+ done
103+ else
104+ echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} \
105+ '(cd src/{} \
106+ && $COMPOSER_MIN_STAB \
107+ && $COMPOSER_UP \
108+ && if [ {} = LiveComponent ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
109+ && $PHPUNIT)'"
110+ fi
88111 js :
89112 runs-on : ubuntu-latest
90113 steps :
0 commit comments