diff --git a/.github/workflows/auto-request-review.yml b/.github/workflows/auto-request-review.yml index 9e53b9b4..879b6fa6 100644 --- a/.github/workflows/auto-request-review.yml +++ b/.github/workflows/auto-request-review.yml @@ -8,19 +8,29 @@ on: - reopened jobs: - auto-request-review: - name: Auto Request Review + should-run: runs-on: ubuntu-latest + outputs: + run: ${{ steps.check.outputs.run }} steps: - name: Skip for repository owner - id: check_owner - if: github.event.pull_request.user.id == 4849482 # martin-georgiev + id: check run: | - echo "Skipping auto-review request for repository owner" - exit 0 + if [ "${{ github.event.pull_request.user.id }}" = "4849482" ]; then + echo "run=false" >> $GITHUB_OUTPUT + echo "::notice::Skipping auto request review - repository owner PR" + else + echo "run=true" >> $GITHUB_OUTPUT + echo "::notice::Auto request review will execute - the PR author is not the repository owner" + fi + auto-request-review: + needs: should-run + if: needs.should-run.outputs.run == 'true' + runs-on: ubuntu-latest + name: Request a reviewer + steps: - name: Request reviews based on configuration - if: ${{ always() && steps.check_owner.outcome == 'skipped' }} uses: necojackarc/auto-request-review@e89da1a8cd7c8c16d9de9c6e763290b6b0e3d424 # v0.13.0 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b492ac1c..af047e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,24 +2,34 @@ name: CI on: pull_request: - branches: [ "main" ] - paths-ignore: - - '.github/**' - - '**/*.md' - push: - branches: [ "main" ] - paths-ignore: - - '.github/**' - - '**/*.md' + branches: + - main permissions: contents: read jobs: - tests: - name: "PHP ${{ matrix.php }} + Doctrine ORM ${{ matrix.doctrine-orm }} + Doctrine Lexer ${{ matrix.doctrine-lexer }}" + should-run: runs-on: ubuntu-latest + outputs: + run: ${{ steps.check.outputs.run }} + steps: + - name: Skip for release-please + id: check + run: | + if [ "${{ github.event.pull_request.user.id }}" = "41898282" ]; then + echo "run=false" >> $GITHUB_OUTPUT + echo "::notice::Skipping CI checks - release-please PR" + else + echo "run=true" >> $GITHUB_OUTPUT + echo "::notice::CI checks will execute - the PR author is not the release-please bot" + fi + tests: + needs: should-run + if: needs.should-run.outputs.run == 'true' + runs-on: ubuntu-latest + name: "PHP ${{ matrix.php }} + Doctrine ORM ${{ matrix.doctrine-orm }} + Doctrine Lexer ${{ matrix.doctrine-lexer }}" strategy: fail-fast: false matrix: @@ -41,70 +51,70 @@ jobs: doctrine-lexer: '2.1' steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - name: Set up PHP with PECL extension - uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2 - with: - php-version: ${{ matrix.php }} - coverage: xdebug - extensions: ctype, json, mbstring - tools: composer + - name: Set up PHP with PECL extension + uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + extensions: ctype, json, mbstring + tools: composer - - name: Validate composer.json and composer.lock - run: composer validate --strict + - name: Validate composer.json and composer.lock + run: composer validate --strict - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- - - name: Install Doctrine Lexer dependency - run: | - if [ "${{ matrix.doctrine-lexer }}" == "1.2" ]; then - composer require doctrine/lexer "~1.2" --dev --prefer-dist --no-interaction --no-progress - elif [ "${{ matrix.doctrine-lexer }}" == "2.1" ]; then - composer require doctrine/lexer "~2.1" --dev --prefer-dist --no-interaction --no-progress - elif [ "${{ matrix.doctrine-lexer }}" == "3.0" ]; then - composer require doctrine/lexer "~3.0" --dev --prefer-dist --no-interaction --no-progress - else - composer update --prefer-dist --no-interaction --no-progress - fi + - name: Install Doctrine Lexer dependency + run: | + if [ "${{ matrix.doctrine-lexer }}" = "1.2" ]; then + composer require doctrine/lexer "~1.2" --dev --prefer-dist --no-interaction --no-progress + elif [ "${{ matrix.doctrine-lexer }}" = "2.1" ]; then + composer require doctrine/lexer "~2.1" --dev --prefer-dist --no-interaction --no-progress + elif [ "${{ matrix.doctrine-lexer }}" = "3.0" ]; then + composer require doctrine/lexer "~3.0" --dev --prefer-dist --no-interaction --no-progress + else + composer update --prefer-dist --no-interaction --no-progress + fi - - name: Install Doctrine ORM dependency - run: | - if [ "${{ matrix.doctrine-orm }}" == "2.14" ]; then - composer require doctrine/orm "~2.14" --prefer-dist --no-interaction --no-progress --with-all-dependencies - elif [ "${{ matrix.doctrine-orm }}" == "2.18" ]; then - composer require doctrine/orm "~2.18" --prefer-dist --no-interaction --no-progress --with-all-dependencies - elif [ "${{ matrix.doctrine-orm }}" == "3.0" ]; then - composer require doctrine/orm "~3.0" --prefer-dist --no-interaction --no-progress --with-all-dependencies - else - composer update --prefer-dist --no-interaction --no-progress - fi + - name: Install Doctrine ORM dependency + run: | + if [ "${{ matrix.doctrine-orm }}" = "2.14" ]; then + composer require doctrine/orm "~2.14" --prefer-dist --no-interaction --no-progress --with-all-dependencies + elif [ "${{ matrix.doctrine-orm }}" = "2.18" ]; then + composer require doctrine/orm "~2.18" --prefer-dist --no-interaction --no-progress --with-all-dependencies + elif [ "${{ matrix.doctrine-orm }}" = "3.0" ]; then + composer require doctrine/orm "~3.0" --prefer-dist --no-interaction --no-progress --with-all-dependencies + else + composer update --prefer-dist --no-interaction --no-progress + fi - - name: Run static analysis - run: composer run-static-analysis - continue-on-error: ${{ matrix.continue-on-error || false }} + - name: Run static analysis + run: composer run-static-analysis + continue-on-error: ${{ matrix.continue-on-error || false }} - - name: Check code style - run: composer check-code-style + - name: Check code style + run: composer check-code-style - - name: Check for security vulnerabilities in 3rd party dependencies - run: composer audit + - name: Check for security vulnerabilities in 3rd party dependencies + run: composer audit - - name: Run test suite - run: composer run-tests-with-clover + - name: Run test suite + run: composer run-tests-with-clover - - name: Upload coverage results to Coveralls - if: matrix.calculate-code-coverage == true - uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - fail-on-error: false - base-path: ./var/logs/test-coverage/ - flag-name: "PHP ${{ matrix.php }}" + - name: Upload coverage results to Coveralls + if: matrix.calculate-code-coverage == true + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + fail-on-error: false + base-path: ./var/logs/test-coverage/ + flag-name: "PHP ${{ matrix.php }}" diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index b458f873..d956aab0 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -14,8 +14,8 @@ permissions: jobs: release-please: - name: Create new release PR runs-on: ubuntu-latest + name: Create new release PR steps: - uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 # v4 with: diff --git a/.github/workflows/sloth.yml b/.github/workflows/sloth.yml index f0d28149..45800cc8 100644 --- a/.github/workflows/sloth.yml +++ b/.github/workflows/sloth.yml @@ -9,18 +9,28 @@ permissions: checks: read jobs: - sloth: + should-run: runs-on: ubuntu-latest + outputs: + run: ${{ steps.check.outputs.run }} steps: - name: Skip for release-please - id: check_release_please - if: github.event.pull_request.user.id == 41898282 # release-please[bot] + id: check run: | - echo "skip=true" >> $GITHUB_OUTPUT - echo "Skipping Sloth check for release-please PR" + if [ "${{ github.event.pull_request.user.id }}" = "41898282" ]; then + echo "run=false" >> $GITHUB_OUTPUT + echo "::notice::Skipping Sloth - release-please PR" + else + echo "run=true" >> $GITHUB_OUTPUT + echo "::notice::Sloth will execute - the PR author is not the release-please bot" + fi + sloth: + needs: should-run + if: needs.should-run.outputs.run == 'true' + runs-on: ubuntu-latest + steps: - name: Run Sloth - if: ${{ !steps.check_release_please.outputs.skip }} uses: lendable/sloth@e1fd9a2df2549f6e64188f274bc5d3b39d7842ed # 0.2.0 with: token: ${{ secrets.GITHUB_TOKEN }}