Bump codecov/codecov-action from 3 to 4 #78
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
on: | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- 'README.md' | |
- 'CHANGELOG.md' | |
- '.gitignore' | |
- '.gitattributes' | |
- 'infection.json.dist' | |
- 'psalm.xml' | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- 'README.md' | |
- 'CHANGELOG.md' | |
- '.gitignore' | |
- '.gitattributes' | |
- 'infection.json.dist' | |
- 'psalm.xml' | |
name: build | |
jobs: | |
phpunit: | |
name: PHP ${{ matrix.php }}-${{ matrix.os }}-${{ matrix.branch }} | |
runs-on: ${{ matrix.os }} | |
services: | |
postgres: | |
image: postgres:9.6 | |
env: | |
POSTGRES_USER: root | |
POSTGRES_PASSWORD: root | |
POSTGRES_DB: yiitest | |
ports: | |
- 5432:5432 | |
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
matrix: | |
branch: ['^2.0.49', '^2.2.x-dev'] | |
os: [ubuntu-latest] | |
php: ['8.1', '8.2', '8.3'] | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v4 | |
- name: Install PHP. | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: pecl | |
extensions: pdo, pdo_pgsql, pgsql | |
ini-values: date.timezone='UTC', session.save_path="${{ runner.temp }}" | |
- name: Install dependencies with composer. | |
run: composer require yiisoft/yii2:${{ matrix.branch }} --prefer-dist --no-progress --no-interaction --no-scripts --ansi | |
- name: Load database data. | |
env: | |
PGHOST: 127.0.0.1 | |
PGUSER: root | |
PGDATABASE: yiitest | |
PGPASSWORD: root | |
PGPORT: ${{ job.services.postgres.ports['5432'] }} | |
run: | | |
sudo apt update && sudo apt --fix-broken install && sudo apt install -y postgresql-client | |
psql -U root yiitest < tests/data/pgsql.sql | |
echo "<?php unset(\$config['databases']['pgsql']['fixture']);" > tests/data/config.local.php | |
- name: Run tests with phpunit. | |
if: matrix.php != '8.1' | |
run: vendor/bin/phpunit --colors=always | |
- name: Run tests with phpunit and generate coverage. | |
if: matrix.php == '8.1' | |
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always | |
- name: Upload coverage to Codecov. | |
if: matrix.php == '8.1' | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml |