diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 7fb0690..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: CI - -on: - push: - branches: [ main ] - pull_request: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: 'Setup PHP' - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - - - uses: "ramsey/composer-install@v4" - - - name: PHP CS Fixer - run: ./vendor/bin/php-cs-fixer check - - rector: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: 'Setup PHP' - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - - - uses: "ramsey/composer-install@v4" - with: - working-directory: "tools/rector" - - - name: Rector - run: ./tools/bin/rector --dry-run - - test: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-version: - - "8.3" - - "8.4" - - steps: - - uses: actions/checkout@v6 - - - name: 'Setup PHP' - uses: shivammathur/setup-php@v2 - with: - php-version: "${{ matrix.php-version }}" - - - uses: "ramsey/composer-install@v4" - with: - composer-options: "--prefer-dist" - - - name: Install PDFtk - run: sudo apt install -y pdftk - - - name: Run tests and collect coverage - run: vendor/bin/phpunit --coverage-clover coverage.xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v6 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..1eb572a --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,67 @@ +name: Lint + +on: + push: + branches: [ main ] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: 'Setup PHP' + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - uses: ramsey/composer-install@v4 + + - name: PHP CS Fixer + run: ./vendor/bin/php-cs-fixer check + + rector: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: 'Setup PHP' + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - uses: ramsey/composer-install@v4 + with: + working-directory: "tools/rector" + + - name: Rector + run: ./tools/bin/rector --dry-run + + others: + name: Others Quality Checks + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - name: Download dependencies + uses: ramsey/composer-install@v4 + + - name: Lint Composer config + shell: bash + run: composer validate + + - name: Check that PSR is respected + shell: bash + run: composer dump-autoload --dev -o --dry-run --strict-psr + + - name: Check whether a PHP dependency is compromised + shell: bash + run: composer audit diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..22ff078 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,70 @@ +name: Tests + +on: + push: + branches: [ main ] + pull_request: + +jobs: + test: + name: "Tests (PHP ${{ matrix.php }})" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - php: 8.3 + symfony-version: 7.2.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + stability: stable + - php: 8.3 + symfony-version: 7.3.* + composer-flags: '--prefer-stable' + - php: 8.3 + symfony-version: 7.4.* + composer-flags: '--prefer-stable' + - php: 8.4 + symfony-version: 7.2.* + composer-flags: '--prefer-stable' + - php: 8.4 + symfony-version: 7.3.* + composer-flags: '--prefer-stable' + - php: 8.4 + symfony-version: 7.4.* + composer-flags: '--prefer-stable' + - php: 8.4 + symfony-version: 8.0.* + composer-flags: '--prefer-stable' + - php: 8.5 + symfony-version: 7.3.* + composer-flags: '--prefer-stable' + - php: 8.5 + symfony-version: 7.4.* + composer-flags: '--prefer-stable' + - php: 8.5 + symfony-version: 8.0.* + composer-flags: '--prefer-stable' + steps: + - name: "Checkout" + uses: actions/checkout@v6 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Install dependencies + env: + SYMFONY_REQUIRE: ${{ matrix.symfony-version }} + run: composer update ${{ matrix.composer-flags }} --no-interaction --no-progress --optimize-autoloader + + - name: Install PDFtk + run: sudo apt install -y pdftk + + - name: Run tests and collect coverage + run: vendor/bin/phpunit --coverage-clover coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v6 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/composer.json b/composer.json index 58977f2..dd96661 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ ], "require": { "php": "^8.3", - "symfony/process": "^7.2" + "symfony/process": "^7.2 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^12", @@ -31,6 +31,7 @@ "phpstan/phpstan-phpunit": "^2.0" }, "config": { + "sort-packages": true, "allow-plugins": { "phpstan/extension-installer": true }