diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1aa554c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build + +on: + push: + branches: [ main ] + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + strategy: + fail-fast: false + matrix: + php-versions: ['8.2', '8.3'] + dependency-versions: ['lowest', 'highest'] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - run: composer validate --strict + + - run: composer install --prefer-dist --no-progress --no-suggest + + - run: vendor/bin/phpcs + if: ${{ failure() || success() }} + + - run: vendor/bin/phpstan + if: ${{ failure() || success() }} + + - run: vendor/bin/rector process --dry-run + if: ${{ failure() || success() }} + + - run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover ./clover.xml --log-junit ./phpunit.report.xml + if: ${{ failure() || success() }}= diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml deleted file mode 100644 index a33f6b3..0000000 --- a/.github/workflows/phpunit.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: PHPUnit tests - -on: [push, pull_request] - -permissions: - contents: read - -jobs: - tests_suite: - strategy: - matrix: - php_version: [ '8.1', '8.2' ] - runs-on: ubuntu-latest - steps: - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php_version }} - - uses: actions/checkout@v3 - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - name: Install Dependencies - run: | - composer install - - name: Execute PHPUnit tests - run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 90b7f43..c90df8c 100755 --- a/composer.json +++ b/composer.json @@ -28,6 +28,6 @@ }, "require-dev": { "symfony/test-pack": "^1.0", - "rector/rector": "^2.2" + "assoconnect/php-quality-config": "^1.16" } }