Skip to content

Support Doctrine DBAL 4 instrumentation #234

Support Doctrine DBAL 4 instrumentation

Support Doctrine DBAL 4 instrumentation #234

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
php-cs-fixer:
name: PHP CS Fixer (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
php:
- '8.3'
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- name: Setup Cachix
uses: cachix/cachix-action@v14
with:
name: opentelemetry
extraPullNames: nix-shell, php-src-nix
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Setup Nix magic cache
uses: DeterminateSystems/magic-nix-cache-action@v3
- name: Instantiate Nix develop
uses: nicknovitski/nix-develop@v1
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: List PHP installed extensions
run: php -m
- name: Update project dependencies
run: |
composer update --no-interaction --no-progress --ansi
- name: Run PHP-CS-Fixer fix
run: vendor/bin/php-cs-fixer fix --dry-run --diff --ansi
phpstan:
name: PHPStan (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
php:
- '8.3'
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- name: Setup Cachix
uses: cachix/cachix-action@v14
with:
name: opentelemetry
extraPullNames: nix-shell, php-src-nix
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Setup Nix magic cache
uses: DeterminateSystems/magic-nix-cache-action@v3
- name: Instantiate Nix develop
uses: nicknovitski/nix-develop@v1
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: List PHP installed extensions
run: php -m
- name: Update project dependencies
run: |
composer update --no-interaction --no-progress --ansi
- name: Cache PHPStan results
uses: actions/cache@v4
with:
path: /tmp/phpstan
key: phpstan-php${{ matrix.php }}-${{ github.sha }}
restore-keys: |
phpstan-php${{ matrix.php }}-
phpstan-
continue-on-error: true
- name: Run PHPStan analysis
run: |
./vendor/bin/phpstan --version
./vendor/bin/phpstan analyse --no-interaction --no-progress --ansi --error-format=github --memory-limit=256M
phpunit:
name: PHPUnit (PHP ${{ matrix.php }}, ${{ matrix.dependencies }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
php:
- '8.2'
- '8.3'
dependencies:
- 'highest'
include:
- php: '8.3'
dependencies: 'highest'
coverage: true
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- name: Setup Cachix
uses: cachix/cachix-action@v14
with:
name: opentelemetry
extraPullNames: nix-shell, php-src-nix
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Setup Nix magic cache
uses: DeterminateSystems/magic-nix-cache-action@v3
- name: Instantiate Nix develop
uses: nicknovitski/nix-develop@v1
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.dependencies }}-
- name: Update project dependencies
run: composer update --no-interaction --no-progress --ansi ${{ matrix.dependencies == 'lowest' && '--prefer-lowest --prefer-stable' || '' }}
- name: Create database & schema
run: composer test:console -- doctrine:schema:update --force --complete
- name: Run PHPUnit tests
run: vendor/bin/phpunit --log-junit build/logs/phpunit/junit.xml ${{ matrix.coverage && '--coverage-clover build/logs/phpunit/clover.xml' || '' }}
env:
XDEBUG_MODE: coverage
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: phpunit-logs-php${{ matrix.php }}-${{ matrix.dependencies }}
path: build/logs/phpunit
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
directory: build/logs/phpunit
name: phpunit-php${{ matrix.php }}
flags: phpunit
fail_ci_if_error: true
continue-on-error: true
- name: Upload coverage results to Coveralls
if: matrix.coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
composer global require --prefer-dist --no-interaction --no-progress --ansi php-coveralls/php-coveralls
export PATH="$PATH:$HOME/.composer/vendor/bin"
php-coveralls --coverage_clover=build/logs/phpunit/clover.xml
continue-on-error: true