diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml new file mode 100644 index 0000000..0d60a1f --- /dev/null +++ b/.github/workflows/code-quality.yaml @@ -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 diff --git a/.github/workflows/ci.yaml b/.github/workflows/tests.yaml similarity index 76% rename from .github/workflows/ci.yaml rename to .github/workflows/tests.yaml index a31d747..782cf22 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/tests.yaml @@ -1,4 +1,4 @@ -name: CI +name: Tests on: push: @@ -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: @@ -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 @@ -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 }}