From adef20e0a1a5ac22a2633bcd22266766f786817b Mon Sep 17 00:00:00 2001 From: Dmytro Klyman Date: Tue, 12 Dec 2023 14:46:23 +0100 Subject: [PATCH] Simplify the CI validation workflow --- .github/workflows/ci.yml | 132 +++------------------------------------ 1 file changed, 9 insertions(+), 123 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93da6155..67d6aaf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,79 +57,20 @@ jobs: - name: PHPStan checks run: composer stan - cs-check: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - php-version: [ - '7.4', - '8.2', - ] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: mbstring, intl, pdo_mysql - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Composer cache - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Composer install - run: | - composer --version - if [[ ${{ matrix.php-version }} == '8.2' ]]; then - composer update laminas/laminas-servicemanager laminas/laminas-stdlib laminas/laminas-filter --prefer-stable --optimize-autoloader - else - composer install --prefer-dist --no-interaction --optimize-autoloader - fi - - name: CodeStyle checks run: composer cs-check - prefer-lowest: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - php-version: [ - '7.4' - ] - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: mbstring, intl, pdo_mysql - - - name: Get Composer Cache Directory - id: composer-cache + - name: Run tests run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" + if [[ ${{ matrix.php-version }} == '7.4' ]]; then + XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml + else + composer test + fi - - name: Composer cache - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + - name: Code Coverage Report + if: success() && matrix.php-version == '7.4' + uses: codecov/codecov-action@v1 - name: Composer require spryker-sdk/composer-prefer-lowest package run: composer require --dev spryker-sdk/composer-prefer-lowest @@ -142,58 +83,3 @@ jobs: - name: Validate prefer lowest run: vendor/bin/validate-prefer-lowest -m - - tests: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - php-version: [ - '7.4', - '8.2', - ] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: mbstring, intl, pdo_mysql - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Composer cache - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Composer install - run: | - composer --version - if [[ ${{ matrix.php-version }} == '8.2' ]]; then - composer update laminas/laminas-servicemanager laminas/laminas-stdlib laminas/laminas-filter --prefer-stable --optimize-autoloader - else - composer install --prefer-dist --no-interaction --optimize-autoloader - fi - - - name: Run tests - run: | - if [[ ${{ matrix.php-version }} == '7.4' ]]; then - XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml - else - composer test - fi - - - name: Code Coverage Report - if: success() && matrix.php-version == '7.4' - uses: codecov/codecov-action@v1