Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 408433a

Browse files
committed
Add CI for macOS
1 parent 4b6e29d commit 408433a

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

.github/workflows/unit-tests.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212

1313
tests:
1414
name: Tests
15-
runs-on: Ubuntu-20.04
1615

1716
env:
1817
extensions: amqp,apcu,igbinary,intl,mbstring,memcached,redis-5.3.4
@@ -21,15 +20,24 @@ jobs:
2120
matrix:
2221
include:
2322
- php: '7.2'
23+
os: ubuntu-20.04
2424
- php: '7.4'
25+
os: ubuntu-20.04
26+
- php: '8.0'
27+
os: macos-11
2528
- php: '8.0'
2629
mode: high-deps
30+
os: ubuntu-20.04
2731
- php: '8.1'
2832
mode: low-deps
33+
os: ubuntu-20.04
2934
- php: '8.2'
3035
mode: experimental
36+
os: ubuntu-20.04
3137
fail-fast: false
3238

39+
runs-on: "${{ matrix.os }}"
40+
3341
steps:
3442
- name: Checkout
3543
uses: actions/checkout@v2
@@ -50,6 +58,11 @@ jobs:
5058
extensions: "${{ env.extensions }}"
5159
tools: flex
5260

61+
- name: Install Homebrew packages
62+
if: "matrix.os == 'macos-11'"
63+
run: |
64+
brew install parallel
65+
5366
- name: Configure environment
5467
run: |
5568
git config --global user.email ""
@@ -61,11 +74,11 @@ jobs:
6174
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
6275
6376
echo COLUMNS=120 >> $GITHUB_ENV
64-
echo PHPUNIT="$(readlink -f ./phpunit) --exclude-group tty,benchmark,intl-data" >> $GITHUB_ENV
77+
echo PHPUNIT="$(pwd)/phpunit --exclude-group tty,benchmark,intl-data" >> $GITHUB_ENV
6578
echo COMPOSER_UP='composer update --no-progress --ansi' >> $GITHUB_ENV
6679
6780
SYMFONY_VERSIONS=$(git ls-remote -q --heads | cut -f2 | grep -o '/[1-9][0-9]*\.[0-9].*' | sort -V)
68-
SYMFONY_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -P -o '[0-9]+\.[0-9]+')
81+
SYMFONY_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | cut -d "'" -f2 | cut -d '.' -f 1-2)
6982
SYMFONY_FEATURE_BRANCH=$(curl -s https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json | jq -r '.versions."dev-name"')
7083
7184
# Install the phpunit-bridge from a PR if required
@@ -111,9 +124,9 @@ jobs:
111124
112125
# Skip the phpunit-bridge on bugfix-branches when not in *-deps mode
113126
if [[ ! "${{ matrix.mode }}" = *-deps && $SYMFONY_VERSION != $SYMFONY_FEATURE_BRANCH ]]; then
114-
echo COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' -printf '%h ') >> $GITHUB_ENV
127+
echo COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' | xargs dirname -) >> $GITHUB_ENV
115128
else
116-
echo COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h ') >> $GITHUB_ENV
129+
echo COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist | xargs dirname -) >> $GITHUB_ENV
117130
fi
118131
119132
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
@@ -135,7 +148,7 @@ jobs:
135148
echo "::endgroup::"
136149
137150
- name: Patch return types
138-
if: "matrix.php == '8.1' && ! matrix.mode"
151+
if: "matrix.php == '8.1' && ! matrix.mode && matrix.os == 'ubuntu-20.04'"
139152
run: |
140153
sed -i 's/"\*\*\/Tests\/"//' composer.json
141154
composer install -q --optimize-autoloader

0 commit comments

Comments
 (0)