Skip to content

Update workflows

Update workflows #1404

Workflow file for this run

on:
pull_request:
paths: &paths
- 'bin/**'
- 'config/**'
- 'resources/**'
- 'src/**'
- 'tests/**'
- '.github/workflows/build.yml'
- 'composer.json'
- 'phpunit.xml.dist'
push:
branches: ['master']
paths: *paths
name: build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
matrix:
php:
- 8.1
- 8.2
- 8.3
- 8.4
- 8.5
steps:
- name: Checkout.
uses: actions/checkout@v6
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone='UTC', pcov.directory=$GITHUB_WORKSPACE, pcov.exclude=#^(?!($GITHUB_WORKSPACE/config/|$GITHUB_WORKSPACE/src/)).*#
coverage: pcov
- name: Install Composer dependencies + required yiisoft/db and yiisoft/db-sqlite
uses: yiisoft/actions/install-packages@master
with:
packages: >-
['db', 'db-sqlite']
- name: Run tests with phpunit.
run: vendor/bin/phpunit --testsuite=Migration --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations
- name: Upload coverage to Codecov.
if: matrix.php == '8.5'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml