Repository navigation
chore(deps): bump the composer-dependencies group with 2 updates (#257) #537
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "CI" | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**.php" | |
| - "sdk_compliance_adapter/**" | |
| - "bin/posthog" | |
| - "composer.json" | |
| - "composer.lock" | |
| - "phpcs.xml" | |
| - "phpunit.xml" | |
| - "api/public-api.json" | |
| - "scripts/**" | |
| - ".github/workflows/php.yml" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-markdown-only: | |
| uses: PostHog/.github/.github/workflows/detect-markdown-only.yml@ec25337d9fae0100622cbfea1bd5bd88284ac10b | |
| permissions: | |
| pull-requests: read | |
| composer-validate: | |
| needs: detect-markdown-only | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Complete markdown-only PR check | |
| if: needs.detect-markdown-only.outputs.markdown_only == 'true' | |
| run: echo "Only Markdown files changed; no additional work is required for this check." | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| - name: Set up PHP | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | |
| with: | |
| php-version: 8.4 | |
| tools: composer | |
| - name: Validate composer files | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| run: composer validate --no-check-version --strict | |
| public-api: | |
| needs: detect-markdown-only | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up PHP 8.4 | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | |
| with: | |
| php-version: 8.4 | |
| tools: composer | |
| - name: Install Dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Check public API snapshot | |
| run: composer api:check | |
| phpunit: | |
| needs: detect-markdown-only | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: [8.2, 8.3, 8.4, 8.5] | |
| steps: | |
| - name: Complete markdown-only PR check | |
| if: needs.detect-markdown-only.outputs.markdown_only == 'true' | |
| run: echo "Only Markdown files changed; no additional work is required for this check." | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| - name: Set up PHP ${{ matrix.php-version }} | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: zlib | |
| tools: composer, phpunit | |
| - name: Install Dependencies | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| run: composer install --prefer-dist --no-progress | |
| - name: Run PHPUnit Tests | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php --configuration phpunit.xml | |
| - name: Run adapter fidelity and report checker tests | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| run: python3 -m unittest discover -s sdk_compliance_adapter -v | |
| coverage: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - detect-markdown-only | |
| - phpunit | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up PHP 8.4 | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | |
| with: | |
| php-version: 8.4 | |
| extensions: xdebug, zlib | |
| tools: composer, phpunit | |
| - name: Install Dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Run PHPUnit Coverage | |
| run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --bootstrap vendor/autoload.php --configuration phpunit.xml --coverage-text | |
| phpcs: | |
| needs: detect-markdown-only | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Complete markdown-only PR check | |
| if: needs.detect-markdown-only.outputs.markdown_only == 'true' | |
| run: echo "Only Markdown files changed; no additional work is required for this check." | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| with: | |
| fetch-depth: 0 # important! | |
| - name: Set up PHP 8.4 | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | |
| with: | |
| php-version: 8.4 | |
| tools: composer | |
| - name: Install Dependencies | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| run: composer install --prefer-dist --no-progress | |
| - name: Check PHP formatting | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| run: | | |
| ./vendor/bin/phpcbf --standard=phpcs.xml --no-colors --runtime-set ignore_non_auto_fixable_on_exit 1 | |
| git diff --exit-code -- lib test | |
| - uses: tinovyatkin/action-php-codesniffer@0043b33b3629611c37e8bc7ee8a4e061dc9a7ea2 # v1 | |
| if: needs.detect-markdown-only.outputs.markdown_only != 'true' | |
| with: | |
| files: "**.php" # you may customize glob as needed | |
| phpcs_path: ./vendor/bin/phpcs | |
| standard: phpcs.xml | |
| scope: "file" |