chore(ci): bump codecov-action from v2 to v5 #1527
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: 'Continuous integration' | |
| on: ['push', 'pull_request'] | |
| jobs: | |
| cs: | |
| runs-on: 'ubuntu-24.04' | |
| name: 'Coding style' | |
| steps: | |
| - name: 'Checkout' | |
| uses: 'actions/checkout@v4' | |
| - name: 'Setup PHP' | |
| uses: 'shivammathur/setup-php@v2' | |
| with: | |
| php-version: '8.1' | |
| coverage: 'none' | |
| extensions: 'json, mbstring, tokenizer' | |
| tools: 'composer-normalize:2.28.0, php-cs-fixer:3.84.0' | |
| - name: 'Check PHP code' | |
| run: | | |
| php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no --show-progress=dots | |
| - name: 'Check composer.json' | |
| run: | | |
| composer-normalize --diff --dry-run --indent-size=4 --indent-style=space --no-update-lock | |
| coding-standards: | |
| runs-on: 'ubuntu-24.04' | |
| name: 'Coding standards' | |
| steps: | |
| - name: 'Checkout' | |
| uses: 'actions/checkout@v4' | |
| - name: 'Setup PHP' | |
| uses: 'shivammathur/setup-php@v2' | |
| with: | |
| php-version: '8.1' | |
| tools: composer | |
| - name: 'Install dependencies with Composer' | |
| uses: 'ramsey/composer-install@v3' | |
| with: | |
| composer-options: '--prefer-dist' | |
| - name: 'Run Rector' | |
| run: make run-rector | |
| phpunit: | |
| runs-on: 'ubuntu-24.04' | |
| name: 'PHPUnit (PHP ${{ matrix.php }}, ES ${{ matrix.elasticsearch }})' | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| # Required for the Codecov OIDC token exchange below. id-token is never | |
| # granted by default, so it has to be requested explicitly. | |
| id-token: write | |
| strategy: | |
| matrix: | |
| php: | |
| - '8.1' | |
| - '8.2' | |
| - '8.3' | |
| - '8.4' | |
| - '8.5' | |
| dependencies: | |
| - 'highest' | |
| elasticsearch: | |
| - '9.1.0' | |
| fail-fast: false | |
| steps: | |
| - name: 'Checkout' | |
| uses: 'actions/checkout@v4' | |
| - name: 'Setup PHP' | |
| uses: 'shivammathur/setup-php@v2' | |
| with: | |
| php-version: '${{ matrix.php }}' | |
| coverage: 'pcov' | |
| tools: 'pecl, composer:v2' | |
| extensions: 'curl, json, mbstring, openssl' | |
| - name: 'Install dependencies with Composer' | |
| uses: 'ramsey/composer-install@v3' | |
| with: | |
| dependency-versions: '${{ matrix.dependencies }}' | |
| composer-options: '--prefer-dist' | |
| - name: 'Run unit tests' | |
| run: | | |
| vendor/bin/phpunit --group unit --coverage-clover=build/coverage/unit-coverage.xml | |
| - name: 'Setup Elasticsearch' | |
| env: | |
| ES_VERSION: "${{ matrix.elasticsearch }}" | |
| run: | | |
| sudo swapoff -a | |
| sudo sysctl -w vm.swappiness=1 | |
| sudo sysctl -w fs.file-max=262144 | |
| sudo sysctl -w vm.max_map_count=262144 | |
| docker compose --file=docker/compose.proxy.yaml --file=docker/compose.es.yaml up --detach | |
| docker run --rm --network=docker_elastic curlimages/curl --max-time 120 --retry-max-time 120 --retry 120 --retry-delay 5 --retry-all-errors --show-error --silent http://es01:9200 | |
| docker run --rm --network=docker_elastic curlimages/curl --max-time 120 --retry-max-time 120 --retry 120 --retry-delay 5 --retry-all-errors --show-error --silent http://es02:9200 | |
| - name: 'Run functional tests' | |
| env: | |
| ES_VERSION: "${{ matrix.elasticsearch }}" | |
| run: | | |
| vendor/bin/phpunit --group functional --coverage-clover=build/coverage/functional-coverage.xml | |
| - name: 'Upload coverage to Codecov' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: build/coverage/unit-coverage.xml,build/coverage/functional-coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| # Tokenless uploads from forks are flaky in v5; only request OIDC | |
| # when the workflow is running on the head repository. | |
| use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} | |
| - name: Elasticsearch Logs | |
| if: always() | |
| run: | | |
| docker compose --file=docker/compose.proxy.yaml --file=docker/compose.es.yaml logs es01 es02 | |
| phpstan: | |
| runs-on: 'ubuntu-24.04' | |
| name: 'PHPStan' | |
| timeout-minutes: 10 | |
| steps: | |
| - name: 'Checkout' | |
| uses: 'actions/checkout@v4' | |
| - name: 'Setup PHP' | |
| uses: 'shivammathur/setup-php@v2' | |
| with: | |
| php-version: '8.1' | |
| coverage: 'none' | |
| tools: 'composer:v2' | |
| extensions: 'curl, json, mbstring, openssl' | |
| - name: 'Install dependencies with Composer' | |
| uses: 'ramsey/composer-install@v3' | |
| with: | |
| composer-options: '--prefer-dist' | |
| - name: 'Run phpstan' | |
| run: | | |
| vendor/bin/phpstan analyse --no-progress --error-format=github --memory-limit=1G |