Release v0.5.0 (#16) #57
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: | |
| push: | |
| branches: | |
| - main | |
| - 'release-*' | |
| - 'hotfix-*' | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| - 'release-*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| extensions: opentelemetry | |
| tools: composer:v2 | |
| coverage: none | |
| - uses: ramsey/composer-install@v3 | |
| - name: CS Fixer | |
| run: vendor/bin/php-cs-fixer fix --dry-run --show-progress=none | |
| - name: PHPStan | |
| run: vendor/bin/phpstan analyse --no-progress | |
| test: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: ['8.2', '8.3', '8.4'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: opentelemetry | |
| tools: composer:v2 | |
| coverage: ${{ matrix.php-version == '8.4' && 'xdebug' || 'none' }} | |
| - uses: ramsey/composer-install@v3 | |
| - name: Tests | |
| if: matrix.php-version != '8.4' | |
| run: vendor/bin/phpunit --no-progress | |
| - name: Tests with coverage | |
| if: matrix.php-version == '8.4' | |
| run: vendor/bin/phpunit --no-progress --coverage-clover=coverage.xml | |
| - name: Upload coverage | |
| if: matrix.php-version == '8.4' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.xml | |
| bench: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: opentelemetry | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Checkout base branch | |
| run: git checkout ${{ github.event.pull_request.base.sha }} | |
| - uses: ramsey/composer-install@v3 | |
| - name: Benchmark base branch | |
| run: vendor/bin/phpbench run --progress=none --tag=base | |
| - name: Checkout PR branch | |
| run: git checkout ${{ github.event.pull_request.head.sha }} | |
| - uses: ramsey/composer-install@v3 | |
| - name: Benchmark PR branch and compare with base | |
| run: vendor/bin/phpbench run --report=default --progress=none --ref=base | |
| split: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| package: | |
| - local_path: 'packages/core' | |
| split_repository: 'opentelemetry-auto-class' | |
| - local_path: 'packages/symfony' | |
| split_repository: 'opentelemetry-auto-class-symfony' | |
| - local_path: 'packages/laravel' | |
| split_repository: 'opentelemetry-auto-class-laravel' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: danharrin/monorepo-split-github-action@v2.3.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.SPLIT_TOKEN }} | |
| with: | |
| package_directory: ${{ matrix.package.local_path }} | |
| repository_organization: 'eerzho' | |
| repository_name: ${{ matrix.package.split_repository }} | |
| tag: ${{ github.ref_type == 'tag' && github.ref_name || '' }} | |
| user_name: 'eerzho' | |
| user_email: 'eerzho@gmail.com' | |
| release: | |
| needs: split | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create monorepo release | |
| run: gh release create ${{ github.ref_name }} --generate-notes | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create sub-repo releases | |
| run: | | |
| for repo in opentelemetry-auto-class opentelemetry-auto-class-symfony opentelemetry-auto-class-laravel; do | |
| gh release create ${{ github.ref_name }} --generate-notes --repo eerzho/$repo | |
| done | |
| env: | |
| GH_TOKEN: ${{ secrets.SPLIT_TOKEN }} |