Skip to content

Commit 90d81e2

Browse files
committed
Update examples
1 parent 93cb314 commit 90d81e2

27 files changed

Lines changed: 367 additions & 303 deletions

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ Examples of using `setup-php` with various PHP frameworks and packages.
950950
| Framework/Package | Runs on | Workflow |
951951
|----------------------------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------|
952952
| Blackfire | `macOS`, `ubuntu` and `windows` | [blackfire.yml](./examples/blackfire.yml "GitHub Action using Blackfire") |
953-
| Blackfire Player | `macOS`, `ubuntu` and `windows` | [blackfire-player.yml](./examples/blackfire-player.yml "GitHub Action using Blackfire Player") |
953+
| Blackfire Player | `macOS` and `ubuntu` | [blackfire-player.yml](./examples/blackfire-player.yml "GitHub Action using Blackfire Player") |
954954
| CakePHP with `MySQL` and `Redis` | `ubuntu` | [cakephp-mysql.yml](./examples/cakephp-mysql.yml "GitHub Action for CakePHP with MySQL and Redis") |
955955
| CakePHP with `PostgreSQL` and `Redis` | `ubuntu` | [cakephp-postgres.yml](./examples/cakephp-postgres.yml "GitHub Action for CakePHP with Postgres and Redis") |
956956
| CakePHP without services | `macOS`, `ubuntu` and `windows` | [cakephp.yml](./examples/cakephp.yml "GitHub Action for CakePHP without services") |
@@ -970,8 +970,9 @@ Examples of using `setup-php` with various PHP frameworks and packages.
970970
| Symfony with `MySQL` | `ubuntu` | [symfony-mysql.yml](./examples/symfony-mysql.yml "GitHub Action for Symfony with MySQL") |
971971
| Symfony with `PostgreSQL` | `ubuntu` | [symfony-postgres.yml](./examples/symfony-postgres.yml "GitHub Action for Symfony with PostgreSQL") |
972972
| Symfony without services | `macOS`, `ubuntu` and `windows` | [symfony.yml](./examples/symfony.yml "GitHub Action for Symfony without services") |
973-
| Yii2 Starter Kit with `MySQL` | `ubuntu` | [yii2-mysql.yml](./examples/yii2-mysql.yml "GitHub Action for Yii2 Starter Kit with MySQL") |
974-
| Yii2 Starter Kit with `PostgreSQL` | `ubuntu` | [yii2-postgres.yml](./examples/yii2-postgres.yml "GitHub Action for Yii2 Starter Kit with PostgreSQL") |
973+
| Yii3 web application with `MySQL` | `ubuntu` | [yii3-mysql.yml](./examples/yii3-mysql.yml "GitHub Action for Yii3 web application with MySQL") |
974+
| Yii3 web application with `PostgreSQL` | `ubuntu` | [yii3-postgres.yml](./examples/yii3-postgres.yml "GitHub Action for Yii3 web application with PostgreSQL") |
975+
| Yii3 web application | `ubuntu` and `windows` | [yii3.yml](./examples/yii3.yml "GitHub Action for Yii3 web application") |
975976

976977
## :bookmark: Versioning
977978

examples/bedrock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
php-versions: ['7.4', '8.0', '8.1']
11+
php-versions: ['8.3', '8.4', '8.5']
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v6

examples/blackfire-player.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on: [push, pull_request]
44
jobs:
55
blackfire-player:
66
name: Blackfire (PHP ${{ matrix.php-versions }})
7+
defaults:
8+
run:
9+
shell: bash
710
# Add your Blackfire credentials securely using GitHub Secrets
811
env:
912
BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
@@ -14,9 +17,9 @@ jobs:
1417
strategy:
1518
fail-fast: false
1619
matrix:
17-
operating-system: [ubuntu-latest, windows-latest, macos-latest]
18-
php-versions: ['7.4', '8.0', '8.1']
19-
# blackfire-player supports PHP >= 5.5
20+
operating-system: [ubuntu-latest, macos-latest]
21+
php-versions: ['8.3', '8.4', '8.5']
22+
# Blackfire Player supports PHP 8.5 and is available on Ubuntu and macOS.
2023
steps:
2124
- name: Checkout
2225
uses: actions/checkout@v6
@@ -31,6 +34,14 @@ jobs:
3134
tools: blackfire, blackfire-player
3235
coverage: none
3336

34-
# Refer to https://blackfire.io/docs/player/index#usage
37+
- name: Start local endpoint
38+
run: |
39+
php -S 127.0.0.1:8080 > "$RUNNER_TEMP/blackfire-player.log" 2>&1 &
40+
sleep 5
41+
42+
- name: Validate scenario
43+
run: blackfire-player validate scenario.bkf
44+
45+
# Refer to https://docs.blackfire.io/builds-cookbooks/player
3546
- name: Play the scenario
36-
run: blackfire-player run scenario.bkf
47+
run: blackfire-player run scenario.bkf --endpoint=http://127.0.0.1:8080

examples/blackfire.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
operating-system: [ubuntu-latest, windows-latest, macos-latest]
18-
php-versions: ['7.4', '8.0', '8.1']
19-
# Blackfire supports PHP >= 5.3 on Ubuntu and macOS, and PHP >= 5.4 on Windows
18+
php-versions: ['8.3', '8.4', '8.5']
19+
# Blackfire supports the current PHP releases on Ubuntu, macOS, and Windows.
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v6
@@ -26,12 +26,24 @@ jobs:
2626
uses: shivammathur/setup-php@v2
2727
with:
2828
php-version: ${{ matrix.php-versions }}
29-
# Setup Blackfire extension and CLI
30-
extensions: blackfire
29+
# Setup Blackfire extension and CLI.
30+
extensions: blackfire, :xdebug
3131
tools: blackfire
3232
# Disable Xdebug and PCOV coverage drivers
3333
coverage: none
3434

3535
# Refer to https://blackfire.io/docs/cookbooks/profiling-cli
3636
- name: Profile
37-
run: blackfire run php my-script.php
37+
shell: bash
38+
run: |
39+
set +e
40+
output=$(blackfire run php my-script.php 2>&1)
41+
exit_code=$?
42+
printf '%s\n' "$output"
43+
if [ "$exit_code" -ne 0 ]; then
44+
if printf '%s' "$output" | grep -q "upgrade your subscription"; then
45+
echo "Blackfire profiling reached the repository quota limit; treating this as a known non-fatal condition."
46+
exit 0
47+
fi
48+
exit "$exit_code"
49+
fi

examples/cakephp-mysql.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ jobs:
66
tests:
77
strategy:
88
matrix:
9-
php-versions: ['7.4', '8.0', '8.1']
9+
php-versions: ['8.4', '8.5']
10+
# The latest cakephp/app release resolves dev dependencies that require PHP 8.4+.
1011
runs-on: ubuntu-latest
1112

1213
# Docs: https://docs.github.com/en/actions/using-containerized-services
@@ -37,7 +38,7 @@ jobs:
3738
php-version: ${{ matrix.php-versions }}
3839
# You can also use ext-apcu or ext-memcached instead of ext-redis
3940
# Install memcached if using ext-memcached
40-
extensions: mbstring, intl, redis, pdo_mysql
41+
extensions: mbstring, intl, redis, apcu, pdo_mysql
4142
coverage: pcov
4243

4344
# Local MySQL service in GitHub hosted environments is disabled by default.
@@ -61,14 +62,15 @@ jobs:
6162
- name: Install dependencies
6263
run: |
6364
composer install --no-progress --prefer-dist --optimize-autoloader
64-
composer run-script post-install-cmd
65+
composer run-script post-install-cmd --no-interaction
6566
6667
# Add a step to run migrations if required
6768
- name: Test with phpunit
6869
run: vendor/bin/phpunit --coverage-text
6970
env:
7071
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
71-
DB_DSN: "mysql://root:password@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/cakephp?init[]=SET sql_mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\""
72+
DATABASE_URL: "mysql://root:password@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/cakephp?init[]=SET sql_mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\""
73+
DATABASE_TEST_URL: "mysql://root:password@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/cakephp?init[]=SET sql_mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\""
7274

7375
coding-standard:
7476
name: Coding Standard
@@ -81,7 +83,7 @@ jobs:
8183
- name: Setup PHP
8284
uses: shivammathur/setup-php@v2
8385
with:
84-
php-version: '8.1'
86+
php-version: '8.5'
8587
extensions: mbstring, intl
8688

8789
- name: Get composer cache directory
@@ -114,7 +116,7 @@ jobs:
114116
- name: Setup PHP
115117
uses: shivammathur/setup-php@v2
116118
with:
117-
php-version: '8.1'
119+
php-version: '8.5'
118120
extensions: mbstring, intl
119121
tools: phpstan
120122

@@ -132,7 +134,9 @@ jobs:
132134
restore-keys: ${{ runner.os }}-composer-
133135

134136
- name: Install dependencies
135-
run: composer install --no-progress --prefer-dist --optimize-autoloader
137+
run: |
138+
composer install --no-progress --prefer-dist --optimize-autoloader
139+
composer run-script post-install-cmd --no-interaction
136140
137141
- name: Static Analysis using PHPStan
138142
run: phpstan analyse --no-progress src/

examples/cakephp-postgres.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ on: [push, pull_request]
55
jobs:
66
tests:
77
strategy:
8+
fail-fast: false
89
matrix:
9-
php-versions: ['7.4', '8.0', '8.1']
10+
php-versions: ['8.4', '8.5']
11+
# The latest cakephp/app release resolves dev dependencies that require PHP 8.4+.
1012
runs-on: ubuntu-latest
1113

1214
# Docs: https://docs.github.com/en/actions/using-containerized-services
@@ -37,7 +39,7 @@ jobs:
3739
php-version: ${{ matrix.php-versions }}
3840
# You can also use ext-apcu or ext-memcached instead of ext-redis
3941
# Install memcached if using ext-memcached
40-
extensions: mbstring, intl, redis, pdo_pgsql
42+
extensions: mbstring, intl, redis, apcu, pdo_pgsql
4143
coverage: pcov
4244

4345
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
@@ -61,14 +63,15 @@ jobs:
6163
- name: Install dependencies
6264
run: |
6365
composer install --no-progress --prefer-dist --optimize-autoloader
64-
composer run-script post-install-cmd
66+
composer run-script post-install-cmd --no-interaction
6567
6668
# Add a step to run migrations if required
6769
- name: Test with phpunit
6870
run: vendor/bin/phpunit --coverage-text
6971
env:
7072
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
71-
DB_DSN: postgres://postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres
73+
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres?encoding=UTF8
74+
DATABASE_TEST_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres?encoding=UTF8
7275

7376
coding-standard:
7477
name: Coding Standard
@@ -81,8 +84,8 @@ jobs:
8184
- name: Setup PHP
8285
uses: shivammathur/setup-php@v2
8386
with:
84-
php-version: '8.1'
85-
extensions: mbstring, intl
87+
php-version: '8.5'
88+
extensions: mbstring, intl, apcu
8689

8790
- name: Get composer cache directory
8891
id: composer-cache
@@ -114,8 +117,8 @@ jobs:
114117
- name: Setup PHP
115118
uses: shivammathur/setup-php@v2
116119
with:
117-
php-version: '8.1'
118-
extensions: mbstring, intl
120+
php-version: '8.5'
121+
extensions: mbstring, intl, apcu
119122
tools: phpstan
120123

121124
- name: Get composer cache directory
@@ -132,7 +135,9 @@ jobs:
132135
restore-keys: ${{ runner.os }}-composer-
133136

134137
- name: Install dependencies
135-
run: composer install --no-progress --prefer-dist --optimize-autoloader
138+
run: |
139+
composer install --no-progress --prefer-dist --optimize-autoloader
140+
composer run-script post-install-cmd --no-interaction
136141
137142
- name: Static Analysis using PHPStan
138143
run: phpstan analyse --no-progress src/

examples/cakephp.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ jobs:
77
strategy:
88
matrix:
99
operating-system: [ubuntu-latest, windows-latest, macos-latest]
10-
php-versions: ['7.4', '8.0', '8.1']
10+
php-versions: ['8.4', '8.5']
11+
# The latest cakephp/app release resolves dev dependencies that require PHP 8.4+.
1112
runs-on: ${{ matrix.operating-system }}
1213
steps:
1314
- name: Checkout
@@ -23,6 +24,7 @@ jobs:
2324

2425
- name: Get composer cache directory
2526
id: composer-cache
27+
shell: bash
2628
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
2729

2830
- name: Cache composer dependencies
@@ -37,7 +39,7 @@ jobs:
3739
- name: Install dependencies
3840
run: |
3941
composer install --no-progress --prefer-dist --optimize-autoloader
40-
composer run-script post-install-cmd
42+
composer run-script post-install-cmd --no-interaction
4143
4244
- name: Test with phpunit
4345
run: vendor/bin/phpunit --coverage-text
@@ -53,10 +55,11 @@ jobs:
5355
- name: Setup PHP
5456
uses: shivammathur/setup-php@v2
5557
with:
56-
php-version: '8.1'
58+
php-version: '8.5'
5759
extensions: mbstring, intl
5860
- name: Get composer cache directory
5961
id: composer-cache
62+
shell: bash
6063
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6164

6265
- name: Cache composer dependencies
@@ -85,12 +88,13 @@ jobs:
8588
- name: Setup PHP
8689
uses: shivammathur/setup-php@v2
8790
with:
88-
php-version: '8.1'
91+
php-version: '8.5'
8992
extensions: mbstring, intl
9093
tools: phpstan
9194

9295
- name: Get composer cache directory
9396
id: composer-cache
97+
shell: bash
9498
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
9599

96100
- name: Cache composer dependencies
@@ -103,7 +107,9 @@ jobs:
103107
restore-keys: ${{ runner.os }}-composer-
104108

105109
- name: Install dependencies
106-
run: composer install --no-progress --prefer-dist --optimize-autoloader
110+
run: |
111+
composer install --no-progress --prefer-dist --optimize-autoloader
112+
composer run-script post-install-cmd --no-interaction
107113
108114
- name: Static Analysis using PHPStan
109115
run: phpstan analyse --no-progress src/

examples/codeigniter.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
operating-system: [ubuntu-latest, windows-latest, macos-latest]
9-
php-versions: ['7.4', '8.0', '8.1']
9+
php-versions: ['8.3', '8.4', '8.5']
1010
runs-on: ${{ matrix.operating-system }}
1111
steps:
1212
- name: Checkout
@@ -17,12 +17,13 @@ jobs:
1717
uses: shivammathur/setup-php@v2
1818
with:
1919
php-version: ${{ matrix.php-versions }}
20-
extensions: mbstring, intl, curl, dom
20+
extensions: mbstring, intl, curl, dom, sqlite3, pdo_sqlite
2121
coverage: xdebug
2222

2323
- name: Get composer cache directory
2424
id: composer-cache
25-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
25+
shell: bash
26+
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
2627

2728
- name: Cache composer dependencies
2829
uses: actions/cache@v5

examples/laminas-mvc.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# GitHub Action for Laminas framework MVC projects
2-
name: Testing Zend Framework
2+
name: Testing Laminas MVC
33
on: [push, pull_request]
44
jobs:
55
build:
66
strategy:
77
matrix:
88
operating-system: [ubuntu-latest, windows-latest, macos-latest]
9-
php-versions: ['7.4', '8.0', '8.1']
9+
php-versions: ['8.1', '8.2', '8.3']
1010
runs-on: ${{ matrix.operating-system }}
1111
steps:
1212
- name: Checkout
@@ -21,6 +21,7 @@ jobs:
2121

2222
- name: Get composer cache directory
2323
id: composer-cache
24+
shell: bash
2425
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
2526

2627
- name: Cache composer dependencies

examples/laravel-mysql.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ jobs:
66
name: Laravel (PHP ${{ matrix.php-versions }})
77
runs-on: ubuntu-latest
88
env:
9+
DB_CONNECTION: mysql
10+
DB_HOST: 127.0.0.1
911
DB_DATABASE: laravel
1012
DB_USERNAME: root
1113
DB_PASSWORD: password
12-
BROADCAST_DRIVER: log
13-
CACHE_DRIVER: redis
14+
BROADCAST_CONNECTION: log
15+
CACHE_STORE: redis
1416
QUEUE_CONNECTION: redis
1517
SESSION_DRIVER: redis
1618

@@ -34,7 +36,7 @@ jobs:
3436
strategy:
3537
fail-fast: false
3638
matrix:
37-
php-versions: ['7.4', '8.0', '8.1']
39+
php-versions: ['8.3', '8.4', '8.5']
3840
steps:
3941
- name: Checkout
4042
uses: actions/checkout@v6

0 commit comments

Comments
 (0)