From ca43e66f753b5a0495a87a7ba05ea52ac069ef49 Mon Sep 17 00:00:00 2001 From: Konrad Michalik Date: Mon, 22 Jun 2026 10:43:58 +0200 Subject: [PATCH] chore(ci): use reusable github actions workflows --- .github/workflows/cgl.yml | 54 ++--------------------------------- .github/workflows/release.yml | 24 +--------------- composer-unused.php | 14 +++++++++ 3 files changed, 18 insertions(+), 74 deletions(-) create mode 100644 composer-unused.php diff --git a/.github/workflows/cgl.yml b/.github/workflows/cgl.yml index f15fdf5..4b26f39 100644 --- a/.github/workflows/cgl.yml +++ b/.github/workflows/cgl.yml @@ -6,54 +6,6 @@ on: jobs: cgl: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - # Prepare environment - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - # @todo Use PHP 8.4 once PHP-CS-Fixer supports PHP 8.4 - php-version: 8.3 - tools: composer:v2, composer-require-checker, composer-unused, cs2pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # Validation - - name: Validate composer.json - run: composer validate - - # Install dependencies - - name: Add required packages - run: composer require composer/composer:"^2.2" - - # Check Composer dependencies - - name: Check dependencies - run: composer-require-checker check - - name: Reset composer.json - run: git checkout composer.json - - name: Re-install Composer dependencies - uses: ramsey/composer-install@4.0.0 - - name: Check for unused dependencies - run: composer-unused --excludePackage=deployer/deployer --excludePackage=sourcebroker/deployer-extended - - # Linting - - name: Update composer.lock - run: composer update --lock - - name: Lint composer.json - run: composer lint:composer - - name: Lint Editorconfig - run: composer lint:editorconfig - - name: Lint PHP - run: composer lint:php -- --format checkstyle | cs2pr - - # SCA - - name: SCA PHP - run: composer sca:php -- --error-format github - - # Migration - - name: Run Rector migration - run: composer migration:rector -- --dry-run + uses: konradmichalik/reusable-github-actions/.github/workflows/cgl.yml@main + with: + php-version: '8.3' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69e6078..06419dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,27 +6,5 @@ on: - '*' jobs: - # Job: Create release release: - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - outputs: - release-notes-url: ${{ steps.create-release.outputs.url }} - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - # Check if tag is valid - - name: Check tag - run: | - if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then - exit 1 - fi - - # Create release - - name: Create release - id: create-release - uses: softprops/action-gh-release@v3 - with: - generate_release_notes: true + uses: konradmichalik/reusable-github-actions/.github/workflows/release.yml@main diff --git a/composer-unused.php b/composer-unused.php new file mode 100644 index 0000000..d932812 --- /dev/null +++ b/composer-unused.php @@ -0,0 +1,14 @@ +addNamedFilter(NamedFilter::fromString('deployer/deployer')) + ->addNamedFilter(NamedFilter::fromString('sourcebroker/deployer-extended')); +};