Skip to content

Commit

Permalink
[TASK] Move the code style check to a decicated CI job
Browse files Browse the repository at this point in the history
There is no need to run the code style check with every
PHP version.
  • Loading branch information
oliverklee committed Feb 15, 2024
1 parent b0b9634 commit 7eb42ef
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,39 @@ jobs:
if: ${{ matrix.php > '8.1' }}
run: composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader --ignore-platform-req=php+

- name: Run cgl
if: ${{ matrix.php < '8.1' }}
run: composer cs

- name: Run unit tests
run: composer tests:unit

codestyle:
name: Code style
runs-on: ubuntu-22.04
strategy:
matrix:
php: ["8.1"]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: zip
tools: composer:v2

- name: Get composer cache directory
id: composer-cache
run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ env.composer_cache_dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader

- name: Run cgl
run: composer cs

0 comments on commit 7eb42ef

Please sign in to comment.