Repository navigation
115 lines (97 loc) · 3.5 KB
/
Copy pathpgsql.yml
File metadata and controls
115 lines (97 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: pgsql
on:
pull_request:
paths: &paths
- 'src/**'
- 'tests/**'
- '.github/workflows/pgsql.yml'
- 'composer.json'
- 'phpunit.xml.dist'
push:
branches: ['master']
paths: *paths
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: PHP ${{ matrix.php }}-pgsql-${{ matrix.pgsql.version }}
env:
extensions: pdo, pdo_pgsql
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
php:
- 8.1
- 8.2
- 8.3
- 8.4
- 8.5
pgsql:
- version: 9
image: postgres:9@sha256:15055f7b681334cbf0212b58e510148b1b23973639e3904260fb41fa0761a103
- version: 10
image: postgres:10@sha256:7a484b11fcabd39596b1bf08780cdb61fa9b0d8bfad0844dbdce3a6922df95d1
- version: 11
image: postgres:11@sha256:fdfb434d69d7884d6366840279dc3e721d1bd67cc1d02d51aeea7497f323fc5e
- version: 12
image: postgres:12@sha256:4bf4eb8e5932534db5fb9d3d91a212a91406aecf1fa626a60df4a9e2781d73ae
- version: 13
image: postgres:13@sha256:1094e2cdc5605e5c7914633bcd93758a9c52ae8c8b2855ddd1c3a8afbe4795d5
- version: 14
image: postgres:14@sha256:e49f970414656e9198612493a9a63eafffc780789b5ae636f9c077acc0410bd8
services:
postgres:
image: ${{ matrix.pgsql.image }}
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install PHP with extensions
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: pcov
tools: composer:v2
- name: Determine composer cache directory
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Cache dependencies installed with composer
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Run tests with phpunit
run: vendor/bin/phpunit --testsuite Pgsql --coverage-clover=coverage.xml --colors=always
env:
ENVIRONMENT: ci
CYCLE_PGSQL_DATABASE: yiitest
CYCLE_PGSQL_HOST: 127.0.0.1
CYCLE_PGSQL_PORT: 5432
CYCLE_PGSQL_USER: root
CYCLE_PGSQL_PASSWORD: root
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
files: ./coverage.xml