Skip to content

Commit 12316d2

Browse files
committed
Update ci
1 parent 325e540 commit 12316d2

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,22 @@ jobs:
2020
- uses: actions/checkout@v4
2121

2222
# PHP installation and setup using built-in tools
23-
- name: Setup PHP (Ubuntu/macOS)
24-
if: matrix.os != 'windows-latest'
23+
- name: Setup PHP (Ubuntu)
24+
if: matrix.os == 'ubuntu-latest'
2525
run: |
26-
sudo apt-get update || brew install [email protected]
27-
sudo apt-get install -y php8.2-cli php8.2-xml php8.2-curl || true
26+
sudo add-apt-repository ppa:ondrej/php
27+
sudo apt-get update
28+
sudo apt-get install -y php8.2 php8.2-cli php8.2-xml php8.2-curl php8.2-mbstring
29+
php -v
30+
shell: bash
31+
32+
- name: Setup PHP (macOS)
33+
if: matrix.os == 'macos-latest'
34+
run: |
35+
brew install [email protected]
36+
brew link [email protected] --force
2837
php -v
38+
shell: bash
2939

3040
- name: Setup PHP (Windows)
3141
if: matrix.os == 'windows-latest'
@@ -36,12 +46,18 @@ jobs:
3646
- name: Install Composer
3747
run: |
3848
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
39-
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
49+
if [ "$RUNNER_OS" == "Windows" ]; then
50+
php composer-setup.php
51+
mv composer.phar /usr/local/bin/composer
52+
else
53+
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
54+
fi
4055
php -r "unlink('composer-setup.php');"
56+
composer --version
4157
shell: bash
4258

4359
- name: Validate composer.json
44-
run: composer validate --strict
60+
run: composer validate
4561
shell: bash
4662

4763
- name: Cache Composer packages
@@ -57,7 +73,7 @@ jobs:
5773
shell: bash
5874

5975
- name: Run test suite
60-
run: vendor/bin/phpunit --coverage-text
76+
run: vendor/bin/phpunit
6177
shell: bash
6278

6379
- name: Verify binary installation
@@ -84,16 +100,18 @@ jobs:
84100

85101
- name: Setup PHP and tools
86102
run: |
103+
sudo add-apt-repository ppa:ondrej/php
87104
sudo apt-get update
88-
sudo apt-get install -y php8.2-cli php8.2-xml
89-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
105+
sudo apt-get install -y php8.2 php8.2-cli php8.2-xml php8.2-mbstring
106+
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
90107
composer global require phpstan/phpstan
108+
echo "${HOME}/.composer/vendor/bin" >> $GITHUB_PATH
91109
92110
- name: Install dependencies
93111
run: composer install --prefer-dist --no-progress
94112

95113
- name: Run PHPStan
96-
run: ~/.composer/vendor/bin/phpstan analyse src tests --level=5
114+
run: phpstan analyse src tests --level=5
97115

98116
code-style:
99117
name: Code Style
@@ -104,10 +122,12 @@ jobs:
104122

105123
- name: Setup PHP and tools
106124
run: |
125+
sudo add-apt-repository ppa:ondrej/php
107126
sudo apt-get update
108-
sudo apt-get install -y php8.2-cli php8.2-xml
109-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
127+
sudo apt-get install -y php8.2 php8.2-cli php8.2-xml php8.2-mbstring
128+
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
110129
composer global require friendsofphp/php-cs-fixer
130+
echo "${HOME}/.composer/vendor/bin" >> $GITHUB_PATH
111131
112132
- name: Check coding standards
113-
run: ~/.composer/vendor/bin/php-cs-fixer fix --dry-run --diff
133+
run: php-cs-fixer fix --dry-run --diff

0 commit comments

Comments
 (0)