refactor(DependencyInjection): move configurate in compiler passes #398
This file contains 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: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
flake-check: | |
name: Flake check | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v16 | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v15 | |
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@v8 | |
- name: Run Nix Flake check | |
run: nix flake check | |
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@v16 | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v15 | |
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@v8 | |
- 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-tools-php-cs-fixer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer-tools-php-cs-fixer | |
- name: List PHP installed extensions | |
run: php -m | |
- name: Install PHP CS Fixer dependencies | |
run: cd tools/php-cs-fixer && composer update --no-interaction --no-progress --ansi | |
- name: Run PHP-CS-Fixer fix | |
run: tools/php-cs-fixer/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@v16 | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v15 | |
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@v8 | |
- 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-tools-phpstan-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer-tools-phpstan | |
- name: List PHP installed extensions | |
run: php -m | |
- name: Install PHPStan dependencies | |
run: | | |
composer update --no-interaction --no-progress --ansi | |
cd tools/phpstan && 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: | | |
tools/phpstan/vendor/bin/phpstan --version | |
tools/phpstan/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@v16 | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v15 | |
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@v8 | |
- 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@v5 | |
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 |