Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/auto-request-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,28 @@ 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' }}" == "true" ]; then
echo "run=false" >> $GITHUB_OUTPUT
echo "::notice::Skipping auto-review request - repository owner PR"
else
echo "run=true" >> $GITHUB_OUTPUT
fi

auto-request-review:
needs: should-run
if: needs.should-run.outputs.run == 'true'
runs-on: ubuntu-latest
name: Auto Request Review
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 }}
142 changes: 75 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@ name: CI
on:
pull_request:
branches: [ "main" ]
paths-ignore:
- '.github/**'
- '**/*.md'
push:
branches: [ "main" ]
paths-ignore:
- '.github/**'
- '**/*.md'

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' }}" == "true" ]; then
echo "run=false" >> $GITHUB_OUTPUT
echo "::notice::Skipping CI checks - release-please PR"
else
echo "run=true" >> $GITHUB_OUTPUT
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:
Expand All @@ -41,70 +49,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
Comment on lines +113 to +115
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Condition for Uploading Coverage Results
The condition used here is if: matrix.calculate-code-coverage == true. According to the PR objectives, the condition was updated to include a check that the event triggering the workflow is a pull_request. If this was intended, please update the condition as follows:

-        if: matrix.calculate-code-coverage == true
+        if: matrix.calculate-code-coverage == true && github.event_name == 'pull_request'

This ensures that coverage results are only uploaded when the workflow is triggered by a pull request.


Action Required: Update CI Workflow Condition for Coveralls Upload

The current condition only checks matrix.calculate-code-coverage == true. However, based on the PR objectives, this condition should also verify that the workflow is triggered by a pull request. Please update the condition as follows:

-        if: matrix.calculate-code-coverage == true
+        if: matrix.calculate-code-coverage == true && github.event_name == 'pull_request'

This change will ensure that coverage results are uploaded only when the workflow is triggered by a pull request.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Upload coverage results to Coveralls
if: matrix.calculate-code-coverage == true
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
- name: Upload coverage results to Coveralls
- if: matrix.calculate-code-coverage == true
+ if: matrix.calculate-code-coverage == true && github.event_name == 'pull_request'
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 }}"
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/sloth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,27 @@ 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' }}" == "true" ]; then
echo "run=false" >> $GITHUB_OUTPUT
echo "::notice::Skipping Sloth - release-please PR"
else
echo "run=true" >> $GITHUB_OUTPUT
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 }}
Expand Down