Skip to content
Merged
Changes from all 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
43 changes: 42 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
paths:
- "**.php"
- "bin/posthog"
- "composer.json"
- "composer.lock"
- "phpcs.xml"
- "phpunit.xml"
- ".github/workflows/php.yml"
Expand All @@ -14,14 +16,35 @@
paths:
- "**.php"
- "bin/posthog"
- "composer.json"
- "composer.lock"
- "phpcs.xml"
- "phpunit.xml"
- ".github/workflows/php.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
composer-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: 8.4
tools: composer

- name: Validate composer files
run: composer validate --no-check-lock --no-check-version --strict

phpunit:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: [8.2, 8.3, 8.4, 8.5]
steps:
Expand All @@ -31,16 +54,34 @@
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: ${{ matrix.php-version }}
extensions: xdebug
tools: composer, phpunit

- name: Install Dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPUnit Tests
run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php --configuration phpunit.xml

coverage:
runs-on: ubuntu-latest
needs: phpunit
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up PHP 8.4
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: 8.4
extensions: xdebug
tools: composer, phpunit

- name: Install Dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPUnit Coverage
Comment thread
marandaneto marked this conversation as resolved.
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --bootstrap vendor/autoload.php --configuration phpunit.xml --coverage-text

phpcs:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
Loading