mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-03-22 15:45:54 +07:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea13793c13 | ||
|
|
fd580061e0 | ||
|
|
90d81e2adc | ||
|
|
93cb3149d2 |
5
.github/workflows/publish.yml
vendored
5
.github/workflows/publish.yml
vendored
@@ -16,6 +16,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout release
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
@@ -30,7 +31,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20.x'
|
||||
node-version: '24.x'
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Install dependencies and add lib
|
||||
@@ -42,8 +43,6 @@ jobs:
|
||||
- name: Publish to NPM
|
||||
if: "!contains(github.event.inputs.skip, 'skip-npm')"
|
||||
run: npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Change to GitHub Packages registry
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
@@ -950,7 +950,7 @@ Examples of using `setup-php` with various PHP frameworks and packages.
|
||||
| Framework/Package | Runs on | Workflow |
|
||||
|----------------------------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------|
|
||||
| Blackfire | `macOS`, `ubuntu` and `windows` | [blackfire.yml](./examples/blackfire.yml "GitHub Action using Blackfire") |
|
||||
| Blackfire Player | `macOS`, `ubuntu` and `windows` | [blackfire-player.yml](./examples/blackfire-player.yml "GitHub Action using Blackfire Player") |
|
||||
| Blackfire Player | `macOS` and `ubuntu` | [blackfire-player.yml](./examples/blackfire-player.yml "GitHub Action using Blackfire Player") |
|
||||
| CakePHP with `MySQL` and `Redis` | `ubuntu` | [cakephp-mysql.yml](./examples/cakephp-mysql.yml "GitHub Action for CakePHP with MySQL and Redis") |
|
||||
| CakePHP with `PostgreSQL` and `Redis` | `ubuntu` | [cakephp-postgres.yml](./examples/cakephp-postgres.yml "GitHub Action for CakePHP with Postgres and Redis") |
|
||||
| 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.
|
||||
| Symfony with `MySQL` | `ubuntu` | [symfony-mysql.yml](./examples/symfony-mysql.yml "GitHub Action for Symfony with MySQL") |
|
||||
| Symfony with `PostgreSQL` | `ubuntu` | [symfony-postgres.yml](./examples/symfony-postgres.yml "GitHub Action for Symfony with PostgreSQL") |
|
||||
| Symfony without services | `macOS`, `ubuntu` and `windows` | [symfony.yml](./examples/symfony.yml "GitHub Action for Symfony without services") |
|
||||
| Yii2 Starter Kit with `MySQL` | `ubuntu` | [yii2-mysql.yml](./examples/yii2-mysql.yml "GitHub Action for Yii2 Starter Kit with MySQL") |
|
||||
| Yii2 Starter Kit with `PostgreSQL` | `ubuntu` | [yii2-postgres.yml](./examples/yii2-postgres.yml "GitHub Action for Yii2 Starter Kit with PostgreSQL") |
|
||||
| Yii3 web application with `MySQL` | `ubuntu` | [yii3-mysql.yml](./examples/yii3-mysql.yml "GitHub Action for Yii3 web application with MySQL") |
|
||||
| Yii3 web application with `PostgreSQL` | `ubuntu` | [yii3-postgres.yml](./examples/yii3-postgres.yml "GitHub Action for Yii3 web application with PostgreSQL") |
|
||||
| Yii3 web application | `ubuntu` and `windows` | [yii3.yml](./examples/yii3.yml "GitHub Action for Yii3 web application") |
|
||||
|
||||
## :bookmark: Versioning
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
@@ -4,6 +4,9 @@ on: [push, pull_request]
|
||||
jobs:
|
||||
blackfire-player:
|
||||
name: Blackfire (PHP ${{ matrix.php-versions }})
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
# Add your Blackfire credentials securely using GitHub Secrets
|
||||
env:
|
||||
BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
|
||||
@@ -14,9 +17,9 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
# blackfire-player supports PHP >= 5.5
|
||||
operating-system: [ubuntu-latest, macos-latest]
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
# Blackfire Player supports PHP 8.5 and is available on Ubuntu and macOS.
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -31,6 +34,14 @@ jobs:
|
||||
tools: blackfire, blackfire-player
|
||||
coverage: none
|
||||
|
||||
# Refer to https://blackfire.io/docs/player/index#usage
|
||||
- name: Start local endpoint
|
||||
run: |
|
||||
php -S 127.0.0.1:8080 > "$RUNNER_TEMP/blackfire-player.log" 2>&1 &
|
||||
sleep 5
|
||||
|
||||
- name: Validate scenario
|
||||
run: blackfire-player validate scenario.bkf
|
||||
|
||||
# Refer to https://docs.blackfire.io/builds-cookbooks/player
|
||||
- name: Play the scenario
|
||||
run: blackfire-player run scenario.bkf
|
||||
run: blackfire-player run scenario.bkf --endpoint=http://127.0.0.1:8080
|
||||
|
||||
@@ -15,8 +15,8 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
# Blackfire supports PHP >= 5.3 on Ubuntu and macOS, and PHP >= 5.4 on Windows
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
# Blackfire supports the current PHP releases on Ubuntu, macOS, and Windows.
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -26,12 +26,24 @@ jobs:
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
# Setup Blackfire extension and CLI
|
||||
extensions: blackfire
|
||||
# Setup Blackfire extension and CLI.
|
||||
extensions: blackfire, :xdebug
|
||||
tools: blackfire
|
||||
# Disable Xdebug and PCOV coverage drivers
|
||||
coverage: none
|
||||
|
||||
# Refer to https://blackfire.io/docs/cookbooks/profiling-cli
|
||||
- name: Profile
|
||||
run: blackfire run php my-script.php
|
||||
shell: bash
|
||||
run: |
|
||||
set +e
|
||||
output=$(blackfire run php my-script.php 2>&1)
|
||||
exit_code=$?
|
||||
printf '%s\n' "$output"
|
||||
if [ "$exit_code" -ne 0 ]; then
|
||||
if printf '%s' "$output" | grep -q "upgrade your subscription"; then
|
||||
echo "Blackfire profiling reached the repository quota limit; treating this as a known non-fatal condition."
|
||||
exit 0
|
||||
fi
|
||||
exit "$exit_code"
|
||||
fi
|
||||
|
||||
@@ -6,7 +6,8 @@ jobs:
|
||||
tests:
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.4', '8.5']
|
||||
# The latest cakephp/app release resolves dev dependencies that require PHP 8.4+.
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
@@ -37,7 +38,7 @@ jobs:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
# You can also use ext-apcu or ext-memcached instead of ext-redis
|
||||
# Install memcached if using ext-memcached
|
||||
extensions: mbstring, intl, redis, pdo_mysql
|
||||
extensions: mbstring, intl, redis, apcu, pdo_mysql
|
||||
coverage: pcov
|
||||
|
||||
# Local MySQL service in GitHub hosted environments is disabled by default.
|
||||
@@ -61,14 +62,15 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
composer run-script post-install-cmd
|
||||
composer run-script post-install-cmd --no-interaction
|
||||
|
||||
# Add a step to run migrations if required
|
||||
- name: Test with phpunit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
env:
|
||||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||
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\""
|
||||
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\""
|
||||
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\""
|
||||
|
||||
coding-standard:
|
||||
name: Coding Standard
|
||||
@@ -81,7 +83,7 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.5'
|
||||
extensions: mbstring, intl
|
||||
|
||||
- name: Get composer cache directory
|
||||
@@ -114,7 +116,7 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.5'
|
||||
extensions: mbstring, intl
|
||||
tools: phpstan
|
||||
|
||||
@@ -132,7 +134,9 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
run: |
|
||||
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
composer run-script post-install-cmd --no-interaction
|
||||
|
||||
- name: Static Analysis using PHPStan
|
||||
run: phpstan analyse --no-progress src/
|
||||
|
||||
@@ -5,8 +5,10 @@ on: [push, pull_request]
|
||||
jobs:
|
||||
tests:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.4', '8.5']
|
||||
# The latest cakephp/app release resolves dev dependencies that require PHP 8.4+.
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
@@ -37,7 +39,7 @@ jobs:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
# You can also use ext-apcu or ext-memcached instead of ext-redis
|
||||
# Install memcached if using ext-memcached
|
||||
extensions: mbstring, intl, redis, pdo_pgsql
|
||||
extensions: mbstring, intl, redis, apcu, pdo_pgsql
|
||||
coverage: pcov
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
@@ -61,14 +63,15 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
composer run-script post-install-cmd
|
||||
composer run-script post-install-cmd --no-interaction
|
||||
|
||||
# Add a step to run migrations if required
|
||||
- name: Test with phpunit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
env:
|
||||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||
DB_DSN: postgres://postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres
|
||||
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres?encoding=UTF8
|
||||
DATABASE_TEST_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres?encoding=UTF8
|
||||
|
||||
coding-standard:
|
||||
name: Coding Standard
|
||||
@@ -81,8 +84,8 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
extensions: mbstring, intl
|
||||
php-version: '8.5'
|
||||
extensions: mbstring, intl, apcu
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
@@ -114,8 +117,8 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
extensions: mbstring, intl
|
||||
php-version: '8.5'
|
||||
extensions: mbstring, intl, apcu
|
||||
tools: phpstan
|
||||
|
||||
- name: Get composer cache directory
|
||||
@@ -132,7 +135,9 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
run: |
|
||||
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
composer run-script post-install-cmd --no-interaction
|
||||
|
||||
- name: Static Analysis using PHPStan
|
||||
run: phpstan analyse --no-progress src/
|
||||
|
||||
@@ -7,7 +7,8 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.4', '8.5']
|
||||
# The latest cakephp/app release resolves dev dependencies that require PHP 8.4+.
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -23,6 +24,7 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
@@ -37,7 +39,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
composer run-script post-install-cmd
|
||||
composer run-script post-install-cmd --no-interaction
|
||||
|
||||
- name: Test with phpunit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
@@ -53,10 +55,11 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.5'
|
||||
extensions: mbstring, intl
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
@@ -85,12 +88,13 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.5'
|
||||
extensions: mbstring, intl
|
||||
tools: phpstan
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
@@ -103,7 +107,9 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
run: |
|
||||
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
composer run-script post-install-cmd --no-interaction
|
||||
|
||||
- name: Static Analysis using PHPStan
|
||||
run: phpstan analyse --no-progress src/
|
||||
|
||||
@@ -6,7 +6,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -17,12 +17,13 @@ jobs:
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: mbstring, intl, curl, dom
|
||||
extensions: mbstring, intl, curl, dom, sqlite3, pdo_sqlite
|
||||
coverage: xdebug
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v5
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# GitHub Action for Laminas framework MVC projects
|
||||
name: Testing Zend Framework
|
||||
name: Testing Laminas MVC
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.1', '8.2', '8.3']
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -21,6 +21,7 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
|
||||
@@ -6,11 +6,13 @@ jobs:
|
||||
name: Laravel (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DB_CONNECTION: mysql
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_DATABASE: laravel
|
||||
DB_USERNAME: root
|
||||
DB_PASSWORD: password
|
||||
BROADCAST_DRIVER: log
|
||||
CACHE_DRIVER: redis
|
||||
BROADCAST_CONNECTION: log
|
||||
CACHE_STORE: redis
|
||||
QUEUE_CONNECTION: redis
|
||||
SESSION_DRIVER: redis
|
||||
|
||||
@@ -34,7 +36,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
QUEUE_CONNECTION: redis
|
||||
SESSION_DRIVER: redis
|
||||
DB_CONNECTION: pgsql
|
||||
DB_HOST: localhost
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_PASSWORD: postgres
|
||||
DB_USERNAME: postgres
|
||||
DB_DATABASE: postgres
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -81,11 +81,11 @@ jobs:
|
||||
- name: Run Migration
|
||||
run: php artisan migrate -v
|
||||
env:
|
||||
DB_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||
|
||||
- name: Test with phpunit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
env:
|
||||
DB_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -24,6 +24,7 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||
|
||||
- name: Test with phpunit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
run: vendor/bin/phpunit --coverage-text --coverage-filter app
|
||||
env:
|
||||
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
QUEUE_CONNECTION: redis
|
||||
SESSION_DRIVER: redis
|
||||
DB_CONNECTION: pgsql
|
||||
DB_HOST: localhost
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_PASSWORD: postgres
|
||||
DB_USERNAME: postgres
|
||||
DB_DATABASE: postgres
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: mbstring, dom, fileinfo, pgsql
|
||||
coverage: xdebug
|
||||
coverage: none
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
@@ -81,11 +81,11 @@ jobs:
|
||||
- name: Run Migration
|
||||
run: php artisan migrate -v
|
||||
env:
|
||||
DB_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||
|
||||
- name: Test with phpunit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
run: vendor/bin/phpunit
|
||||
env:
|
||||
DB_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -24,6 +24,7 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
@@ -42,4 +43,4 @@ jobs:
|
||||
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||
|
||||
- name: Test with phpunit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
run: vendor/bin/phpunit --coverage-text --coverage-filter app
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
env:
|
||||
DB_ADAPTER: mysql
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_NAME: phalcon
|
||||
DB_NAME: vokuro
|
||||
DB_USERNAME: root
|
||||
DB_PASSWORD: password
|
||||
CODECEPTION_URL: 127.0.0.1
|
||||
@@ -20,11 +20,11 @@ jobs:
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
image: mysql:5.7
|
||||
env:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
MYSQL_DATABASE: phalcon
|
||||
MYSQL_DATABASE: vokuro
|
||||
ports:
|
||||
- 3306/tcp
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
@@ -32,8 +32,6 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.2', '7.3', '7.4']
|
||||
# For phalcon 3.x, use
|
||||
# php-versions: ['7.0', '7.1', '7.2', '7.3']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -43,7 +41,7 @@ jobs:
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
# Use phalcon3 for the phalcon 3.x.
|
||||
# Use phalcon4 for the latest compatible Vokuro sample release.
|
||||
extensions: mbstring, dom, zip, phalcon4, mysql
|
||||
coverage: xdebug
|
||||
|
||||
@@ -73,7 +71,6 @@ jobs:
|
||||
|
||||
- name: Run Migration
|
||||
run: |
|
||||
if [ ! -e phinx.yml ]; then vendor/bin/phinx init; fi
|
||||
vendor/bin/phinx migrate
|
||||
vendor/bin/phinx seed:run
|
||||
env:
|
||||
|
||||
@@ -11,21 +11,18 @@ jobs:
|
||||
env:
|
||||
DB_ADAPTER: pgsql
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_NAME: postgres
|
||||
DB_NAME: vokuro
|
||||
DB_USERNAME: postgres
|
||||
DB_PASSWORD: postgres
|
||||
CODECEPTION_URL: 127.0.0.1
|
||||
CODECEPTION_PORT: 8888
|
||||
DB_CONNECTION: pgsql
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
POSTGRES_DB: vokuro
|
||||
ports:
|
||||
- 5432/tcp
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||
@@ -33,8 +30,6 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.2', '7.3', '7.4']
|
||||
# For phalcon 3.x, use
|
||||
# php-versions: ['7.0', '7.1', '7.2', '7.3']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -44,41 +39,40 @@ jobs:
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
# Use phalcon3 for the phalcon 3.x
|
||||
extensions: mbstring, dom, zip, phalcon4, pgsql
|
||||
coverage: xdebug
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start postgresql service
|
||||
# run: sudo systemctl start postgresql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-security-blocking
|
||||
|
||||
- name: Prepare the application
|
||||
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||
run: |
|
||||
php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||
mkdir -p var/cache/acl var/cache/metaData var/cache/session var/cache/volt var/logs
|
||||
chmod -R 777 var/cache var/logs
|
||||
|
||||
- name: Run Migration
|
||||
run: |
|
||||
if [ ! -e phinx.yml ]; then vendor/bin/phinx init; fi
|
||||
vendor/bin/phinx migrate
|
||||
vendor/bin/phinx seed:run
|
||||
env:
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
(cd public && nohup php -S $CODECEPTION_URL:$CODECEPTION_PORT > phalcon.log 2>&1 &)
|
||||
(cd public && nohup php -S $CODECEPTION_URL:$CODECEPTION_PORT > vokuro.log 2>&1 &)
|
||||
vendor/bin/codecept build
|
||||
vendor/bin/codecept run
|
||||
env:
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
|
||||
@@ -8,8 +8,8 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
node-versions: ['16']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
node-versions: ['20']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -53,17 +53,10 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install yarn dependencies
|
||||
run: yarn -V
|
||||
run: yarn install --frozen-lockfile --non-interactive
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Yarn test and build
|
||||
run: |
|
||||
yarn run test
|
||||
yarn run build
|
||||
yarn run rmdist
|
||||
yarn run "build:production"
|
||||
|
||||
- name: PHP test
|
||||
run: composer test
|
||||
- name: Yarn build
|
||||
run: yarn build
|
||||
|
||||
@@ -6,7 +6,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.3', '8.4', '8.5']
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -22,6 +22,7 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
|
||||
@@ -5,11 +5,13 @@ jobs:
|
||||
symfony:
|
||||
name: Symfony (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
APP_ENV: test
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
image: mysql:8.4
|
||||
env:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||
MYSQL_ROOT_PASSWORD: symfony
|
||||
@@ -20,7 +22,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.4', '8.5', '8.6']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -30,7 +32,6 @@ jobs:
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: phpunit-bridge
|
||||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql
|
||||
coverage: xdebug
|
||||
|
||||
@@ -53,18 +54,17 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Run Migration
|
||||
- name: Prepare database
|
||||
run: |
|
||||
composer require --dev symfony/orm-pack
|
||||
php bin/console doctrine:schema:update --force || echo "No migrations found or schema update failed"
|
||||
php bin/console doctrine:migrations:migrate || echo "No migrations found or migration failed"
|
||||
php bin/console doctrine:database:create --if-not-exists --no-interaction
|
||||
php bin/console doctrine:schema:create --no-interaction
|
||||
php bin/console doctrine:fixtures:load --no-interaction
|
||||
env:
|
||||
DATABASE_URL: mysql://root:symfony@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/symfony
|
||||
|
||||
- name: Install PHPUnit
|
||||
run: simple-phpunit install
|
||||
DATABASE_URL: mysql://root:symfony@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/symfony?serverVersion=8.4&charset=utf8mb4
|
||||
|
||||
- name: Run tests
|
||||
run: simple-phpunit --coverage-text
|
||||
run: php bin/phpunit --coverage-text
|
||||
env:
|
||||
DATABASE_URL: mysql://root:symfony@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/symfony?serverVersion=8.4&charset=utf8mb4
|
||||
|
||||
@@ -5,11 +5,13 @@ jobs:
|
||||
symfony:
|
||||
name: Symfony (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
APP_ENV: test
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
@@ -20,7 +22,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.4', '8.5', '8.6']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -30,8 +32,7 @@ jobs:
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: phpunit-bridge
|
||||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql
|
||||
extensions: mbstring, xml, ctype, iconv, intl, pdo_pgsql, pgsql
|
||||
coverage: xdebug
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
@@ -55,16 +56,15 @@ jobs:
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Run Migration
|
||||
- name: Prepare database
|
||||
run: |
|
||||
composer require --dev symfony/orm-pack
|
||||
php bin/console doctrine:schema:update --force || echo "No migrations found or schema update failed"
|
||||
php bin/console doctrine:migrations:migrate || echo "No migrations found or migration failed"
|
||||
php bin/console doctrine:database:create --if-not-exists --no-interaction
|
||||
php bin/console doctrine:schema:create --no-interaction
|
||||
php bin/console doctrine:fixtures:load --no-interaction
|
||||
env:
|
||||
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8
|
||||
|
||||
- name: Install PHPUnit
|
||||
run: simple-phpunit install
|
||||
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/postgres?serverVersion=16.0.0&charset=utf8
|
||||
|
||||
- name: Run tests
|
||||
run: simple-phpunit --coverage-text
|
||||
run: php bin/phpunit --coverage-text
|
||||
env:
|
||||
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/postgres?serverVersion=16.0.0&charset=utf8
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.4', '8.5', '8.6']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -19,12 +19,12 @@ jobs:
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: phpunit-bridge
|
||||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
|
||||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, zip
|
||||
coverage: xdebug
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
@@ -39,8 +39,5 @@ jobs:
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Install PHPUnit
|
||||
run: simple-phpunit install
|
||||
|
||||
- name: Run tests
|
||||
run: simple-phpunit --coverage-text
|
||||
run: ./bin/phpunit --coverage-text
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
# GitHub Action for Yii Framework with MySQL
|
||||
name: Testing Yii2 with MySQL
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
yii:
|
||||
name: Yii2 (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DB_USERNAME: root
|
||||
DB_PASSWORD: yii
|
||||
TEST_DB_USERNAME: root
|
||||
TEST_DB_PASSWORD: yii
|
||||
DB_CHARSET: utf8
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
env:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||
MYSQL_ROOT_PASSWORD: yii
|
||||
MYSQL_DATABASE: yii
|
||||
ports:
|
||||
- 3306/tcp
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set Node.js 10.x
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 10.x
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: mbstring, intl, gd, imagick, zip, dom, mysql
|
||||
coverage: xdebug
|
||||
|
||||
# Local MySQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start mysql service
|
||||
# run: sudo systemctl start mysql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Prepare the application
|
||||
run: |
|
||||
php -r "file_exists('.env') || copy('.env.dist', '.env');"
|
||||
php console/yii app/setup
|
||||
npm install --development
|
||||
npm run build
|
||||
env:
|
||||
DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
|
||||
TEST_DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
vendor/bin/codecept build
|
||||
php tests/bin/yii app/setup --interactive=0
|
||||
nohup php -S localhost:8080 > yii.log 2>&1 &
|
||||
vendor/bin/codecept run
|
||||
env:
|
||||
DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
|
||||
TEST_DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
|
||||
@@ -1,86 +0,0 @@
|
||||
# GitHub Action for Yii Framework with PostgreSQL
|
||||
name: Testing Yii2 with PostgreSQL
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
yii:
|
||||
name: Yii2 (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DB_USERNAME: postgres
|
||||
DB_PASSWORD: postgres
|
||||
TEST_DB_USERNAME: postgres
|
||||
TEST_DB_PASSWORD: postgres
|
||||
DB_CHARSET: utf8
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- 5432/tcp
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set Node.js 10.x
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 10.x
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: mbstring, intl, gd, imagick, zip, dom, pgsql
|
||||
coverage: xdebug
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start postgresql service
|
||||
# run: sudo systemctl start postgresql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Prepare the application
|
||||
run: |
|
||||
php -r "file_exists('.env') || copy('.env.dist', '.env');"
|
||||
php console/yii app/setup
|
||||
npm install --development
|
||||
npm run build
|
||||
env:
|
||||
DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
|
||||
TEST_DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
vendor/bin/codecept build
|
||||
php tests/bin/yii app/setup --interactive=0
|
||||
nohup php -S localhost:8080 > yii.log 2>&1 &
|
||||
vendor/bin/codecept run
|
||||
env:
|
||||
DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
|
||||
TEST_DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
|
||||
78
examples/yii3-mysql.yml
Normal file
78
examples/yii3-mysql.yml
Normal file
@@ -0,0 +1,78 @@
|
||||
# GitHub Action for Yii3 web application with MySQL
|
||||
# Tested with https://github.com/yiisoft/app
|
||||
name: Testing Yii3 with MySQL
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
yii:
|
||||
name: Yii3 (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
APP_C3: true
|
||||
APP_ENV: test
|
||||
APP_DEBUG: false
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.4
|
||||
env:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
MYSQL_DATABASE: app
|
||||
ports:
|
||||
- 3306/tcp
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['8.4', '8.5']
|
||||
# The latest yiisoft/app release resolves Symfony 8.0 packages that require PHP 8.4+.
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: fileinfo, intl, pdo_mysql
|
||||
ini-values: date.timezone='UTC', register_argc_argv=On
|
||||
coverage: none
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Run migrations
|
||||
run: php yii migrate:up --no-interaction
|
||||
env:
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||
DB_NAME: app
|
||||
DB_USERNAME: root
|
||||
DB_PASSWORD: password
|
||||
|
||||
- name: Run codeception build
|
||||
run: vendor/bin/codecept build
|
||||
|
||||
- name: Run tests with Codeception
|
||||
run: vendor/bin/codecept run
|
||||
env:
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||
DB_NAME: app
|
||||
DB_USERNAME: root
|
||||
DB_PASSWORD: password
|
||||
78
examples/yii3-postgres.yml
Normal file
78
examples/yii3-postgres.yml
Normal file
@@ -0,0 +1,78 @@
|
||||
# GitHub Action for Yii3 web application with PostgreSQL
|
||||
# Tested with https://github.com/yiisoft/app
|
||||
name: Testing Yii3 with PostgreSQL
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
yii:
|
||||
name: Yii3 (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
APP_C3: true
|
||||
APP_ENV: test
|
||||
APP_DEBUG: false
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: app
|
||||
ports:
|
||||
- 5432/tcp
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['8.4', '8.5']
|
||||
# The latest yiisoft/app release resolves Symfony 8.0 packages that require PHP 8.4+.
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: fileinfo, intl, pdo_pgsql
|
||||
ini-values: date.timezone='UTC', register_argc_argv=On
|
||||
coverage: none
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Run migrations
|
||||
run: php yii migrate:up --no-interaction
|
||||
env:
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
DB_NAME: app
|
||||
DB_USERNAME: postgres
|
||||
DB_PASSWORD: postgres
|
||||
|
||||
- name: Run codeception build
|
||||
run: vendor/bin/codecept build
|
||||
|
||||
- name: Run tests with Codeception
|
||||
run: vendor/bin/codecept run
|
||||
env:
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
DB_NAME: app
|
||||
DB_USERNAME: postgres
|
||||
DB_PASSWORD: postgres
|
||||
53
examples/yii3.yml
Normal file
53
examples/yii3.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
# GitHub Action for Yii3 web application
|
||||
# Tested with https://github.com/yiisoft/app
|
||||
name: Testing Yii3
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
yii:
|
||||
name: Yii3 (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
env:
|
||||
APP_C3: true
|
||||
APP_ENV: test
|
||||
APP_DEBUG: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest]
|
||||
php-versions: ['8.4', '8.5']
|
||||
# The latest yiisoft/app release resolves Symfony 8.0 packages that require PHP 8.4+.
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: fileinfo, intl
|
||||
ini-values: date.timezone='UTC', register_argc_argv=On
|
||||
coverage: none
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
shell: bash
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Run codeception build
|
||||
run: vendor/bin/codecept build
|
||||
|
||||
- name: Run tests with Codeception
|
||||
run: vendor/bin/codecept run
|
||||
19
package-lock.json
generated
19
package-lock.json
generated
@@ -82,7 +82,6 @@
|
||||
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.29.0",
|
||||
"@babel/generator": "^7.29.0",
|
||||
@@ -1521,7 +1520,6 @@
|
||||
"integrity": "sha512-qeu4rTHR3/IaFORbD16gmjq9+rEs9fGKdX0kF6BKSfi+gCuG3RCKLlSBYzn/bGsY9Tj7KE/DAQStbp8AHJGHEQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@typescript-eslint/scope-manager": "8.57.0",
|
||||
@@ -1551,7 +1549,6 @@
|
||||
"integrity": "sha512-XZzOmihLIr8AD1b9hL9ccNMzEMWt/dE2u7NyTY9jJG6YNiNthaD5XtUHVF2uCXZ15ng+z2hT3MVuxnUYhq6k1g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.57.0",
|
||||
"@typescript-eslint/types": "8.57.0",
|
||||
@@ -1701,7 +1698,6 @@
|
||||
"integrity": "sha512-5iIHvpD3CZe06riAsbNxxreP+MuYgVUsV0n4bwLH//VJmgtt54sQeY2GszntJ4BjYCpMzrfVh2SBnUQTtys2lQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.57.0",
|
||||
@@ -2043,7 +2039,6 @@
|
||||
"integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -2312,7 +2307,6 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"baseline-browser-mapping": "^2.9.0",
|
||||
"caniuse-lite": "^1.0.30001759",
|
||||
@@ -2665,7 +2659,6 @@
|
||||
"integrity": "sha512-COV33RzXZkqhG9P2rZCFl9ZmJ7WL+gQSCRzE7RhkbclbQPtLAWReL7ysA0Sh4c8Im2U9ynybdR56PV0XcKvqaQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.8.0",
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
@@ -2722,7 +2715,6 @@
|
||||
"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"eslint-config-prettier": "bin/cli.js"
|
||||
},
|
||||
@@ -2799,7 +2791,6 @@
|
||||
"integrity": "sha512-rM9K8UBHcWKpzQzStn1YRN2T5NvdeIfSVoKu/lKF41znQXHAUcBbYXe5wd6GNjZjTrP7viQ49n1D83x/2gYgIw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@package-json/types": "^0.0.12",
|
||||
"@typescript-eslint/types": "^8.56.0",
|
||||
@@ -3192,9 +3183,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/flatted": {
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.1.tgz",
|
||||
"integrity": "sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ==",
|
||||
"version": "3.4.2",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
|
||||
"integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
@@ -3573,7 +3564,6 @@
|
||||
"integrity": "sha512-AkXIIFcaazymvey2i/+F94XRnM6TsVLZDhBMLsd1Sf/W0wzsvvpjeyUrCZD6HGG4SDYPgDJDBKeiJTBb10WzMg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@jest/core": "30.3.0",
|
||||
"@jest/types": "30.3.0",
|
||||
@@ -4640,7 +4630,6 @@
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -4743,7 +4732,6 @@
|
||||
"integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
@@ -5286,7 +5274,6 @@
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
|
||||
Reference in New Issue
Block a user