Skip to content

Commit

Permalink
Split workflow & update actions versions
Browse files Browse the repository at this point in the history
  • Loading branch information
HypeMC committed Feb 24, 2024
1 parent a24d66d commit 4b576a8
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 50 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Code Quality

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 8 * * *'

jobs:
php-cs-fixer:
runs-on: ubuntu-latest
name: Coding Standards
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: php-cs-fixer, cs2pr

- name: Run PHP CS Fixer
run: php-cs-fixer fix --dry-run --format checkstyle | cs2pr

phpstan:
runs-on: ubuntu-latest
name: Static Analysis
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: phpstan

- name: Install Dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '--prefer-dist'

- name: Install PHPUnit Dependencies
run: vendor/bin/simple-phpunit install

- name: Run PHPStan
run: phpstan analyse --no-progress
59 changes: 9 additions & 50 deletions .github/workflows/ci.yaml → .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Tests

on:
push:
Expand All @@ -8,48 +8,6 @@ on:
- cron: '0 8 * * *'

jobs:
php-cs-fixer:
runs-on: ubuntu-latest
name: Coding Standards
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: php-cs-fixer, cs2pr

- name: PHP Coding Standards Fixer
run: php-cs-fixer fix --dry-run --format checkstyle | cs2pr

phpstan:
runs-on: ubuntu-latest
name: Static Analysis
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: phpstan

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '--prefer-dist'

- name: Install PHPUnit dependencies
run: vendor/bin/simple-phpunit install

- name: PHPStan
run: phpstan analyse --no-progress

phpunit:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -152,7 +110,7 @@ jobs:
name: PHP ${{ matrix.php }} & Symfony ${{ matrix.symfony }}${{ matrix.dependencies == 'lowest' && ' (lowest)' || '' }} Test
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -161,27 +119,28 @@ jobs:
ini-values: zend.exception_ignore_args=false
tools: flex

- name: Install dependencies
- name: Install Dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '--prefer-dist'
dependency-versions: ${{ matrix.dependencies }}

- name: Install PHPUnit dependencies
- name: Install PHPUnit Dependencies
run: vendor/bin/simple-phpunit install

- name: Run tests with Doctrine Annotations
- name: Run PHPUnit with Doctrine Annotations
run: vendor/bin/simple-phpunit -v --coverage-text --coverage-clover=coverage-annotations.xml

- name: Remove Doctrine Annotations
run: composer remove --dev doctrine/annotations

- name: Run tests without Doctrine Annotations
- name: Run PHPUnit without Doctrine Annotations
run: vendor/bin/simple-phpunit -v --coverage-text --coverage-clover=coverage-no-annotations.xml

- name: Upload coverage to Codecov
- name: Upload Coverage to Codecov
if: ${{ success() }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: coverage-annotations.xml,coverage-no-annotations.xml
flags: ${{ matrix.php }}
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 4b576a8

Please sign in to comment.