diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 3836fb33..f33c357f 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -24,53 +24,3 @@ jobs: with: github_token: ${{ secrets.COMPOSER_TOKEN }} fix: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - - normalize: - needs: style - - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - file: - - src/Core - - src/Cash - - src/SberAuth - - src/SberOnline - - src/SberQrCode - - src/TinkoffAuth - - src/TinkoffCredit - - src/TinkoffOnline - - src/TinkoffQrCode - - src/TemplateDriver - - src/TemplateDriverAuth - - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - - steps: - - name: Git setup - if: success() - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - - - name: Install dependency - run: composer global require ergebnis/composer-normalize - - - name: Normalize composer.json - id: normalizer - run: | - IS_DIRTY=1 - - composer normalize ${{ matrix.file }}/composer.json - - { git add . && git commit -a -m "Normalized \`composer.json\` files"; } || IS_DIRTY_0 - - echo "is_dirty=${IS_DIRTY}" >> $GITHUB_OUTPUT - - - name: Push changes - uses: ad-m/github-push-action@master - if: steps.normalizer.outputs.is_dirty == 1 - with: - github_token: ${{ secrets.COMPOSER_TOKEN }} diff --git a/.github/workflows/composer_normalize.yml b/.github/workflows/composer_normalize.yml new file mode 100644 index 00000000..b2cad2b6 --- /dev/null +++ b/.github/workflows/composer_normalize.yml @@ -0,0 +1,62 @@ +name: Normalize composer.json + +on: [ push, pull_request ] + +permissions: write-all + +jobs: + normalize: + needs: style + + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + package: + - Core + - Cash + - SberAuth + - SberOnline + - SberQrCode + - TinkoffAuth + - TinkoffCredit + - TinkoffOnline + - TinkoffQrCode + - TemplateDriver + - TemplateDriverAuth + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json + coverage: none + + - name: Git setup + if: success() + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Install dependency + run: composer global require ergebnis/composer-normalize + + - name: Normalize composer.json + id: normalizer + run: composer normalize src/${{ matrix.package }}/composer.json + + { git add . && git commit -a -m "Normalized \`composer.json\` files"; } + + - name: Create a Pull Request + uses: peter-evans/create-pull-request@v5 + with: + branch: normalize/package + branch-suffix: random + delete-branch: true + add-paths: src/${{ matrix.package }}/composer.json + title: "[${{ matrix.package }}]: Normalized \`composer.json\`" + commit-message: Normalized \`composer.json\` diff --git a/.github/workflows/databases.yml b/.github/workflows/databases.yml index f26b3e64..97228de6 100644 --- a/.github/workflows/databases.yml +++ b/.github/workflows/databases.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: true matrix: - db: [ "5.7", "8" ] + db: [ "8" ] name: MySQL ${{ matrix.db }} @@ -41,7 +41,7 @@ jobs: command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress --optimize-autoloader - name: Execute tests - run: vendor/bin/pest --colors=always + run: vendor/bin/pest --colors=always env: DB_CONNECTION: mysql DB_USERNAME: root @@ -95,7 +95,7 @@ jobs: strategy: fail-fast: true matrix: - db: [ "14", "15" ] + db: [ "14", "15", "16" ] name: PostgreSQL ${{ matrix.db }}