Skip to content

Commit

Permalink
Simplify the CI validation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroKlymanSpryker committed Dec 12, 2023
1 parent 367a51d commit adef20e
Showing 1 changed file with 9 additions and 123 deletions.
132 changes: 9 additions & 123 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit adef20e

Please sign in to comment.