From 3fe4c34d62fb13ff69efd10a2fafda4433b251a7 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Sat, 31 Oct 2020 13:25:13 -0300 Subject: [PATCH] Update GitHub actions (#239) --- .github/workflows/{ci-linux.yml => build.yml} | 25 +++--- .github/workflows/ci-windows.yml | 76 ------------------- README.md | 3 +- 3 files changed, 11 insertions(+), 93 deletions(-) rename .github/workflows/{ci-linux.yml => build.yml} (69%) delete mode 100644 .github/workflows/ci-windows.yml diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/build.yml similarity index 69% rename from .github/workflows/ci-linux.yml rename to .github/workflows/build.yml index 43b27b9..848b870 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/build.yml @@ -2,11 +2,11 @@ on: - pull_request - push -name: ci-linux +name: build jobs: tests: - name: PHP ${{ matrix.php-version }} + name: PHP ${{ matrix.php }} env: extensions: curl, dom, gd, imagick, intl, json, mbstring, libxml, xml, xmlwriter key: cache-v1 @@ -17,8 +17,9 @@ jobs: matrix: os: - ubuntu-latest + - windows-latest - php-version: + php: - "5.6" - "7.0" - "7.1" @@ -34,7 +35,7 @@ jobs: id: cache-env uses: shivammathur/cache-extensions@v1 with: - php-version: ${{ matrix.php-version }} + php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} key: ${{ env.key }} @@ -48,7 +49,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-version }} + php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} ini-values: date.timezone='UTC' coverage: xdebug @@ -61,21 +62,15 @@ jobs: uses: actions/cache@v1 with: path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} + key: php${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} restore-keys: | - php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + php${{ matrix.php }}-composer-${{ matrix.dependencies }}- - name: Install dependencies with composer php PHP [5.6 - 7.4] run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader - - name: Run tests with codeception with coverage on Linux PHP [5.6 - 7.4] + - name: Run tests with codeception run: | sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 & - vendor/bin/codecept run --coverage --coverage-xml - - - name: Upload code coverage scrutinizer on Linux PHP 7.4 - if: matrix.php-version == '7.4' - run: | - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml \ No newline at end of file + vendor/bin/codecept run \ No newline at end of file diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml deleted file mode 100644 index 40a2a0c..0000000 --- a/.github/workflows/ci-windows.yml +++ /dev/null @@ -1,76 +0,0 @@ -on: - - pull_request - - push - -name: ci-windows - -jobs: - tests: - name: PHP ${{ matrix.php-version }} - env: - extensions: curl, dom, gd, intl, json, mbstring, libxml, xml, xmlwriter - key: cache-v1 - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: - - windows-latest - - php-version: - - "5.6" - - "7.0" - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup cache environment - id: cache-env - uses: shivammathur/cache-extensions@v1 - with: - php-version: ${{ matrix.php-version }} - extensions: ${{ env.extensions }} - key: ${{ env.key }} - - - name: Cache extensions - uses: actions/cache@v1 - with: - path: ${{ steps.cache-env.outputs.dir }} - key: ${{ steps.cache-env.outputs.key }} - restore-keys: ${{ steps.cache-env.outputs.key }} - - - name: Install PHP with extensions - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: ${{ env.extensions }} - ini-values: date.timezone='UTC' - coverage: xdebug - tools: composer:v2, pecl - - - name: Determine composer cache directory on Windows - run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer" - - - name: Cache dependencies installed with composer - uses: actions/cache@v1 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} - restore-keys: | - php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- - - - name: Install dependencies with composer php PHP [5.6 - 7.4] - run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader - - - name: Run tests with codeception on Windows PHP [5.6 - 7.4] - run: | - sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php - php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 & - vendor/bin/codecept run - shell: bash \ No newline at end of file diff --git a/README.md b/README.md index 7674e3b..6db290b 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,7 @@ features to your application. [![Latest Stable Version](https://img.shields.io/packagist/v/yiisoft/yii2-app-basic.svg)](https://packagist.org/packages/yiisoft/yii2-app-basic) [![Total Downloads](https://img.shields.io/packagist/dt/yiisoft/yii2-app-basic.svg)](https://packagist.org/packages/yiisoft/yii2-app-basic) -[![ci-linux](https://github.com/yiisoft/yii2-app-basic/workflows/ci-linux/badge.svg)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Aci-linux) -[![ci-windows](https://github.com/yiisoft/yii2-app-basic/workflows/ci-windows/badge.svg)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Aci-windows) +[![build](https://github.com/yiisoft/yii2-app-basic/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Abuild) DIRECTORY STRUCTURE -------------------