diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml new file mode 100644 index 0000000..f0ae0fc --- /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@v3 + + - 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@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: Run PHPStan + run: phpstan analyse --no-progress diff --git a/.github/workflows/ci.yaml b/.github/workflows/tests.yaml similarity index 77% rename from .github/workflows/ci.yaml rename to .github/workflows/tests.yaml index b6b15f1..c2e1f9d 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: @@ -161,19 +119,19 @@ 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 + - name: Run PHPUnit run: vendor/bin/simple-phpunit -v --coverage-text --coverage-clover=coverage.xml - - name: Upload coverage to Codecov + - name: Upload Coverage to Codecov if: ${{ success() }} uses: codecov/codecov-action@v3 with: diff --git a/README.md b/README.md index b01bf2d..d7db477 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # BizkitVersioningBundle -[![Build Status](https://github.com/HypeMC/versioning-bundle/workflows/CI/badge.svg)](https://github.com/HypeMC/versioning-bundle/actions) +[![Build Status](https://github.com/HypeMC/versioning-bundle/workflows/Tests/badge.svg)](https://github.com/HypeMC/versioning-bundle/actions) [![Latest Stable Version](https://poser.pugx.org/bizkit/versioning-bundle/v/stable)](https://packagist.org/packages/bizkit/versioning-bundle) [![License](https://poser.pugx.org/bizkit/versioning-bundle/license)](https://packagist.org/packages/bizkit/versioning-bundle) [![Code Coverage](https://codecov.io/gh/HypeMC/versioning-bundle/branch/1.x/graph/badge.svg)](https://codecov.io/gh/HypeMC/versioning-bundle)