Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 17 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
pull_request:
paths:
paths: &paths
- 'src/**'
- 'tests/**'
- '.github/workflows/build.yml'
Expand All @@ -9,28 +9,20 @@ on:

push:
branches: ['master']
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/build.yml'
- 'composer.json'
- 'phpunit.xml.dist'
paths: *paths

name: build

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: PHP ${{ matrix.php }}-pgsql-${{ matrix.pgsql }}

env:
COMPOSER_ROOT_VERSION: 1.0.0
EXTENSIONS: pdo, pdo_pgsql

runs-on: ubuntu-latest
name: Postgres ${{ matrix.pgsql }}

strategy:
matrix:
Expand All @@ -51,52 +43,17 @@ jobs:

include:
- php: 8.1
pgsql: 17
pgsql: 18
- php: 8.2
pgsql: 17
pgsql: 18
- php: 8.3
pgsql: 17
pgsql: 18
- php: 8.4
pgsql: 17

services:
postgres:
image: postgres:${{ matrix.pgsql }}
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

steps:
- name: Checkout.
uses: actions/checkout@v4

- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: date.timezone='UTC'
coverage: pcov

- name: Update composer.
run: composer self-update

- name: Install db.
uses: yiisoft/actions/install-packages@master
with:
packages: >-
['db']

- name: Run tests with phpunit with code coverage.
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations

- name: Upload coverage to Codecov.
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml

pgsql: 18

uses: yiisoft/actions/.github/workflows/db-pgsql.yml@master
with:
pgsql: ${{ matrix.pgsql }}
php: >-
[${{ matrix.php }}]
codecov-php: ${{ matrix.php }}