diff --git a/README.md b/README.md index a18b5aae..548777eb 100644 --- a/README.md +++ b/README.md @@ -835,6 +835,7 @@ Examples of using `setup-php` with various PHP Frameworks and Packages. |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")| |CodeIgniter|`macOS`, `ubuntu` and `windows`|[codeigniter.yml](./examples/codeigniter.yml "GitHub Action for CodeIgniter")| +|Laminas MVC|`macOS`, `ubuntu` and `windows`|[laminas-mvc.yml](./examples/laminas-mvc.yml "GitHub Action for Laminas Framework MVC Projects")| |Laravel with `MySQL` and `Redis`|`ubuntu`|[laravel-mysql.yml](./examples/laravel-mysql.yml "GitHub Action for Laravel with MySQL and Redis")| |Laravel with `PostgreSQL` and `Redis`|`ubuntu`|[laravel-postgres.yml](./examples/laravel-postgres.yml "GitHub Action for Laravel with PostgreSQL and Redis")| |Laravel without services|`macOS`, `ubuntu` and `windows`|[laravel.yml](./examples/laravel.yml "GitHub Action for Laravel without services")| @@ -851,7 +852,6 @@ Examples of using `setup-php` with various PHP Frameworks and Packages. |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")| -|Zend Framework|`macOS`, `ubuntu` and `windows`|[zend-framework.yml](./examples/zend-framework.yml "GitHub Action for Zend Framework")| ## :bookmark: Versioning diff --git a/examples/bedrock.yml b/examples/bedrock.yml index 10e19899..817c6c3d 100644 --- a/examples/bedrock.yml +++ b/examples/bedrock.yml @@ -8,17 +8,21 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.1', '7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} @@ -26,7 +30,9 @@ jobs: # 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: PHP test - run: composer test \ No newline at end of file + run: composer test diff --git a/examples/blackfire-player.yml b/examples/blackfire-player.yml index 88d1153b..8cd1529f 100644 --- a/examples/blackfire-player.yml +++ b/examples/blackfire-player.yml @@ -15,17 +15,22 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] # blackfire-player supports PHP >= 5.5 steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: blackfire - tools: blackfire, blackfire-player #Setup Blackfire client, agent and player + # Setup Blackfire CLI and player + tools: blackfire, blackfire-player coverage: none + + # Refer to https://blackfire.io/docs/player/index#usage - name: Play the scenario - run: blackfire-player run scenario.bkf # Refer to https://blackfire.io/docs/player/index#usage + run: blackfire-player run scenario.bkf diff --git a/examples/blackfire.yml b/examples/blackfire.yml index 2f467832..5cbeab7c 100644 --- a/examples/blackfire.yml +++ b/examples/blackfire.yml @@ -15,17 +15,23 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.2', '7.3', '7.4'] - # Blackfire supports PHP >= 5.3 on ubuntu and macos and PHP >= 5.4 on windows + php-versions: ['7.4', '8.0', '8.1'] + # Blackfire supports PHP >= 5.3 on Ubuntu and macOS, and PHP >= 5.4 on Windows steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} + # Setup Blackfire extension and CLI extensions: blackfire - tools: blackfire #Setup Blackfire cli + 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 # Refer to https://blackfire.io/docs/cookbooks/profiling-cli + run: blackfire run php my-script.php diff --git a/examples/cakephp-mysql.yml b/examples/cakephp-mysql.yml index eb630e48..8a1224cd 100644 --- a/examples/cakephp-mysql.yml +++ b/examples/cakephp-mysql.yml @@ -6,11 +6,11 @@ jobs: tests: strategy: matrix: - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] runs-on: ubuntu-latest services: mysql: - image: mysql:5.7 + image: mysql:latest env: MYSQL_ALLOW_EMPTY_PASSWORD: false MYSQL_ROOT_PASSWORD: password @@ -18,6 +18,7 @@ jobs: ports: - 3306/tcp options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + redis: image: redis ports: @@ -26,6 +27,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -34,11 +37,14 @@ jobs: # Install memcached if using ext-memcached extensions: mbstring, intl, redis, pdo_mysql coverage: pcov + - name: Start mysql service run: sudo systemctl start mysql + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -47,10 +53,12 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: | composer install --no-progress --prefer-dist --optimize-autoloader 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 @@ -64,14 +72,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '8.1' extensions: mbstring, intl + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -80,8 +92,10 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: PHP CodeSniffer run: composer cs-check @@ -91,15 +105,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '8.1' extensions: mbstring, intl tools: phpstan + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -108,7 +126,9 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Static Analysis using PHPStan - run: phpstan analyse --no-progress src/ \ No newline at end of file + run: phpstan analyse --no-progress src/ diff --git a/examples/cakephp-postgres.yml b/examples/cakephp-postgres.yml index b8fb4da6..fb460671 100644 --- a/examples/cakephp-postgres.yml +++ b/examples/cakephp-postgres.yml @@ -6,11 +6,11 @@ jobs: tests: strategy: matrix: - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] runs-on: ubuntu-latest services: postgres: - image: postgres:10.8 + image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -18,6 +18,7 @@ jobs: ports: - 5432/tcp options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 + redis: image: redis ports: @@ -26,6 +27,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -34,9 +37,11 @@ jobs: # Install memcached if using ext-memcached extensions: mbstring, intl, redis, pdo_pgsql coverage: pcov + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -45,10 +50,12 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: | composer install --no-progress --prefer-dist --optimize-autoloader 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 @@ -62,14 +69,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '8.1' extensions: mbstring, intl + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -78,8 +89,10 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: PHP CodeSniffer run: composer cs-check @@ -89,15 +102,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '8.1' extensions: mbstring, intl tools: phpstan + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -106,7 +122,9 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Static Analysis using PHPStan - run: phpstan analyse --no-progress src/ \ No newline at end of file + run: phpstan analyse --no-progress src/ diff --git a/examples/cakephp.yml b/examples/cakephp.yml index 178cd939..ef6d8ff7 100644 --- a/examples/cakephp.yml +++ b/examples/cakephp.yml @@ -7,20 +7,24 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] runs-on: ${{ matrix.operating-system }} steps: - name: Checkout uses: actions/checkout@v2 + + # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, intl, pdo_sqlite, pdo_mysql - coverage: pcov #optional + coverage: pcov + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -29,10 +33,12 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: | composer install --no-progress --prefer-dist --optimize-autoloader composer run-script post-install-cmd --no-interaction + - name: Test with phpunit run: vendor/bin/phpunit --coverage-text @@ -42,14 +48,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '8.1' extensions: mbstring, intl - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -58,8 +67,10 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: PHP CodeSniffer run: composer cs-check @@ -69,15 +80,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '8.1' extensions: mbstring, intl tools: phpstan + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -86,7 +101,9 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Static Analysis using PHPStan run: phpstan analyse --no-progress src/ diff --git a/examples/codeigniter.yml b/examples/codeigniter.yml index 47b7828c..6421edd9 100644 --- a/examples/codeigniter.yml +++ b/examples/codeigniter.yml @@ -6,20 +6,24 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] runs-on: ${{ matrix.operating-system }} steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, intl, curl, dom - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -28,7 +32,9 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Test with phpunit - run: vendor/bin/phpunit --coverage-text \ No newline at end of file + run: vendor/bin/phpunit --coverage-text diff --git a/examples/zend-framework.yml b/examples/laminas-mvc.yml similarity index 64% rename from examples/zend-framework.yml rename to examples/laminas-mvc.yml index c1659dfb..7d976d2e 100644 --- a/examples/zend-framework.yml +++ b/examples/laminas-mvc.yml @@ -1,4 +1,4 @@ -# GitHub Action for Zend Framework +# GitHub Action for Laminas framework MVC projects name: Testing Zend Framework on: [push, pull_request] jobs: @@ -6,20 +6,23 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] runs-on: ${{ matrix.operating-system }} steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, bcmath, curl, intl - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -28,9 +31,9 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies - run: | - composer install --no-progress --prefer-dist --optimize-autoloader - composer require --dev phpunit/phpunit squizlabs/php_codesniffer zendframework/zend-test + run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Test with phpunit - run: vendor/bin/phpunit --coverage-text \ No newline at end of file + run: vendor/bin/phpunit --coverage-text diff --git a/examples/laravel-mysql.yml b/examples/laravel-mysql.yml index baf06c78..7ec2bdfc 100644 --- a/examples/laravel-mysql.yml +++ b/examples/laravel-mysql.yml @@ -15,7 +15,7 @@ jobs: SESSION_DRIVER: redis services: mysql: - image: mysql:5.7 + image: mysql:latest env: MYSQL_ALLOW_EMPTY_PASSWORD: false MYSQL_ROOT_PASSWORD: password @@ -23,6 +23,7 @@ jobs: ports: - 3306/tcp options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + redis: image: redis ports: @@ -31,21 +32,26 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, dom, fileinfo, mysql - coverage: xdebug #optional + coverage: xdebug + - name: Start mysql service run: sudo systemctl start mysql + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -54,21 +60,26 @@ jobs: # 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.example', '.env');" php artisan key:generate + - name: Clear Config run: php artisan config:clear + - name: Run Migration run: php artisan migrate -v env: DB_PORT: ${{ job.services.mysql.ports['3306'] }} REDIS_PORT: ${{ job.services.redis.ports['6379'] }} + - name: Test with phpunit run: vendor/bin/phpunit --coverage-text env: DB_PORT: ${{ job.services.mysql.ports['3306'] }} - REDIS_PORT: ${{ job.services.redis.ports['6379'] }} \ No newline at end of file + REDIS_PORT: ${{ job.services.redis.ports['6379'] }} diff --git a/examples/laravel-postgres.yml b/examples/laravel-postgres.yml index 0fd9ec8f..e11b45c7 100644 --- a/examples/laravel-postgres.yml +++ b/examples/laravel-postgres.yml @@ -17,7 +17,7 @@ jobs: DB_DATABASE: postgres services: postgres: - image: postgres:10.8 + image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -25,6 +25,7 @@ jobs: ports: - 5432/tcp options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 + redis: image: redis ports: @@ -33,19 +34,23 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, dom, fileinfo, pgsql - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -54,21 +59,26 @@ jobs: # 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.example', '.env');" php artisan key:generate + - name: Clear Config run: php artisan config:clear + - name: Run Migration run: php artisan migrate -v env: 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] }} - REDIS_PORT: ${{ job.services.redis.ports['6379'] }} \ No newline at end of file + REDIS_PORT: ${{ job.services.redis.ports['6379'] }} diff --git a/examples/laravel.yml b/examples/laravel.yml index 565b7e0d..7ea09298 100644 --- a/examples/laravel.yml +++ b/examples/laravel.yml @@ -9,19 +9,23 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, dom, fileinfo - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -30,13 +34,17 @@ jobs: # 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.example', '.env');" php artisan key:generate + - name: Clear Config run: php artisan config:clear + - name: Test with phpunit - run: vendor/bin/phpunit --coverage-text \ No newline at end of file + run: vendor/bin/phpunit --coverage-text diff --git a/examples/lumen-mysql.yml b/examples/lumen-mysql.yml index 55d9de24..e9b6dbed 100644 --- a/examples/lumen-mysql.yml +++ b/examples/lumen-mysql.yml @@ -15,7 +15,7 @@ jobs: SESSION_DRIVER: redis services: mysql: - image: mysql:5.7 + image: mysql:latest env: MYSQL_ALLOW_EMPTY_PASSWORD: false MYSQL_ROOT_PASSWORD: password @@ -23,6 +23,7 @@ jobs: ports: - 3306/tcp options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + redis: image: redis ports: @@ -31,21 +32,26 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, dom, fileinfo, mysql - coverage: xdebug #optional + coverage: xdebug + - name: Start mysql service run: sudo systemctl start mysql + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -54,21 +60,26 @@ jobs: # 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 composer require predis/predis illuminate/redis + - name: Prepare the application run: php -r "file_exists('.env') || copy('.env.example', '.env');" + - name: Register Redis as service provider run: sed -i '$i\$app->register(Illuminate\\Redis\\RedisServiceProvider::class);' bootstrap/app.php + - name: Run Migration run: php artisan migrate -v env: DB_PORT: ${{ job.services.mysql.ports['3306'] }} REDIS_PORT: ${{ job.services.redis.ports['6379'] }} + - name: Test with phpunit run: vendor/bin/phpunit --coverage-text env: DB_PORT: ${{ job.services.mysql.ports['3306'] }} - REDIS_PORT: ${{ job.services.redis.ports['6379'] }} \ No newline at end of file + REDIS_PORT: ${{ job.services.redis.ports['6379'] }} diff --git a/examples/lumen-postgres.yml b/examples/lumen-postgres.yml index 5971f950..90fb92c7 100644 --- a/examples/lumen-postgres.yml +++ b/examples/lumen-postgres.yml @@ -17,7 +17,7 @@ jobs: DB_DATABASE: postgres services: postgres: - image: postgres:10.8 + image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -25,6 +25,7 @@ jobs: ports: - 5432/tcp options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 + redis: image: redis ports: @@ -33,19 +34,23 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, dom, fileinfo, pgsql - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -54,19 +59,24 @@ jobs: # 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 composer require predis/predis illuminate/redis + - name: Prepare the application run: php -r "file_exists('.env') || copy('.env.example', '.env');" + - name: Register Redis as service provider run: sed -i '$i\$app->register(Illuminate\\Redis\\RedisServiceProvider::class);' bootstrap/app.php + - name: Run Migration run: php artisan migrate -v env: 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: diff --git a/examples/lumen.yml b/examples/lumen.yml index 903f998a..dfdf1adb 100644 --- a/examples/lumen.yml +++ b/examples/lumen.yml @@ -9,19 +9,23 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, dom, fileinfo, mysql - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -30,9 +34,12 @@ jobs: # 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.example', '.env');" + - name: Test with phpunit - run: vendor/bin/phpunit --coverage-text \ No newline at end of file + run: vendor/bin/phpunit --coverage-text diff --git a/examples/phalcon-mysql.yml b/examples/phalcon-mysql.yml index 6914048f..ca85666a 100644 --- a/examples/phalcon-mysql.yml +++ b/examples/phalcon-mysql.yml @@ -18,7 +18,7 @@ jobs: CODECEPTION_PORT: 8888 services: mysql: - image: mysql:5.7 + image: mysql:latest env: MYSQL_ALLOW_EMPTY_PASSWORD: false MYSQL_ROOT_PASSWORD: password @@ -30,22 +30,28 @@ 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'] + # For phalcon 3.x, use + # php-versions: ['7.0', '7.1', '7.2', '7.3'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, dom, zip, phalcon4, mysql #use phalcon3 for the phalcon 3.x. - coverage: xdebug #optional + # Use phalcon3 for the phalcon 3.x. + extensions: mbstring, dom, zip, phalcon4, mysql + coverage: xdebug + - name: Start mysql service run: sudo systemctl start mysql + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -54,10 +60,13 @@ jobs: # 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.example', '.env');" + - name: Run Migration run: | if [ ! -e phinx.yml ]; then vendor/bin/phinx init; fi @@ -65,10 +74,11 @@ jobs: vendor/bin/phinx seed:run env: DB_PORT: ${{ job.services.mysql.ports['3306'] }} + - name: Run Tests run: | (cd public && nohup php -S $CODECEPTION_URL:$CODECEPTION_PORT > phalcon.log 2>&1 &) vendor/bin/codecept build vendor/bin/codecept run env: - DB_PORT: ${{ job.services.mysql.ports['3306'] }} \ No newline at end of file + DB_PORT: ${{ job.services.mysql.ports['3306'] }} diff --git a/examples/phalcon-postgres.yml b/examples/phalcon-postgres.yml index 44b12706..8a2662ec 100644 --- a/examples/phalcon-postgres.yml +++ b/examples/phalcon-postgres.yml @@ -19,7 +19,7 @@ jobs: DB_CONNECTION: pgsql services: postgres: - image: postgres:10.8 + image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -31,17 +31,21 @@ 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'] + # For phalcon 3.x, use + # php-versions: ['7.0', '7.1', '7.2', '7.3'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, dom, zip, phalcon4, pgsql #use phalcon3 for the phalcon 3.x - coverage: xdebug #optional + # Use phalcon3 for the phalcon 3.x + extensions: mbstring, dom, zip, phalcon4, pgsql + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" diff --git a/examples/sage.yml b/examples/sage.yml index 9086393b..0ec0a64a 100644 --- a/examples/sage.yml +++ b/examples/sage.yml @@ -8,33 +8,41 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.1', '7.2', '7.3', '7.4'] - node-versions: ['8', '10'] + php-versions: ['7.4', '8.0', '8.1'] + node-versions: [16'] steps: - name: Checkout uses: actions/checkout@v2 + - name: Setup Node.js uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-versions }} - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring + - name: Check node versions run: node -v + - name: Get yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: ${{ runner.os }}-yarn- + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -43,15 +51,19 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install yarn dependencies run: yarn -V + - 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 \ No newline at end of file + run: composer test diff --git a/examples/slim-framework.yml b/examples/slim-framework.yml index c07f4364..a70644f5 100644 --- a/examples/slim-framework.yml +++ b/examples/slim-framework.yml @@ -6,20 +6,24 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] runs-on: ${{ matrix.operating-system }} steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, simplexml, dom - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -28,7 +32,9 @@ jobs: # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Test with phpunit - run: vendor/bin/phpunit --coverage-text \ No newline at end of file + run: vendor/bin/phpunit --coverage-text diff --git a/examples/symfony-mysql.yml b/examples/symfony-mysql.yml index b15ffebf..a68a8f7c 100644 --- a/examples/symfony-mysql.yml +++ b/examples/symfony-mysql.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest services: mysql: - image: mysql:5.7 + image: mysql:latest env: MYSQL_ALLOW_EMPTY_PASSWORD: false MYSQL_ROOT_PASSWORD: symfony @@ -18,22 +18,27 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + 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 #optional + coverage: xdebug + - name: Start mysql service run: sudo systemctl start mysql + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -42,8 +47,10 @@ jobs: # 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 Migration run: | composer require --dev symfony/orm-pack @@ -51,7 +58,9 @@ jobs: php bin/console doctrine:migrations:migrate || echo "No migrations found or migration failed" env: DATABASE_URL: mysql://root:symfony@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/symfony + - name: Install PHPUnit run: simple-phpunit install + - name: Run tests run: simple-phpunit --coverage-text diff --git a/examples/symfony-postgres.yml b/examples/symfony-postgres.yml index e0ec60f8..fab3d9d7 100644 --- a/examples/symfony-postgres.yml +++ b/examples/symfony-postgres.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres:10.8 + image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -18,20 +18,24 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} tools: phpunit-bridge extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -40,8 +44,10 @@ jobs: # 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 Migration run: | composer require --dev symfony/orm-pack @@ -49,7 +55,9 @@ jobs: php bin/console doctrine:migrations:migrate || echo "No migrations found or migration failed" 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 + - name: Run tests run: simple-phpunit --coverage-text diff --git a/examples/symfony.yml b/examples/symfony.yml index 6d4e28b5..721a1ae9 100644 --- a/examples/symfony.yml +++ b/examples/symfony.yml @@ -9,20 +9,24 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ['7.3', '7.4'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} tools: phpunit-bridge extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite - coverage: xdebug #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -31,9 +35,12 @@ jobs: # 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: Install PHPUnit run: simple-phpunit install + - name: Run tests run: simple-phpunit --coverage-text diff --git a/examples/yii2-mysql.yml b/examples/yii2-mysql.yml index 94975780..0ceea32c 100644 --- a/examples/yii2-mysql.yml +++ b/examples/yii2-mysql.yml @@ -13,7 +13,7 @@ jobs: DB_CHARSET: utf8 services: mysql: - image: mysql:5.7 + image: mysql:latest env: MYSQL_ALLOW_EMPTY_PASSWORD: false MYSQL_ROOT_PASSWORD: yii @@ -24,25 +24,31 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0'] steps: - name: Checkout uses: actions/checkout@v2 + - name: Set Node.js 10.x uses: actions/setup-node@v1 with: node-version: 10.x - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # 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 #optional + coverage: xdebug + - name: Start mysql service run: sudo systemctl start mysql + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -51,8 +57,10 @@ jobs: # 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');" @@ -62,6 +70,7 @@ jobs: 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 @@ -70,4 +79,4 @@ jobs: 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 \ No newline at end of file + TEST_DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii diff --git a/examples/yii2-postgres.yml b/examples/yii2-postgres.yml index c12ff7d5..4932aa55 100644 --- a/examples/yii2-postgres.yml +++ b/examples/yii2-postgres.yml @@ -13,7 +13,7 @@ jobs: DB_CHARSET: utf8 services: postgres: - image: postgres:10.8 + image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -24,23 +24,28 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4'] + php-versions: ['7.4', '8.0'] steps: - name: Checkout uses: actions/checkout@v2 + - name: Set Node.js 10.x uses: actions/setup-node@v1 with: node-version: 10.x - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + + # 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 #optional + coverage: xdebug + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies uses: actions/cache@v2 with: @@ -49,8 +54,10 @@ jobs: # 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');" @@ -60,6 +67,7 @@ jobs: 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 @@ -68,4 +76,4 @@ jobs: 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 \ No newline at end of file + TEST_DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres