Skip to content

Commit c48386e

Browse files
committed
ci: add testing against PostgreSQL
1 parent 3bddb93 commit c48386e

File tree

3 files changed

+98
-3
lines changed

3 files changed

+98
-3
lines changed

.github/workflows/testing-mysql.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on: # yamllint disable-line rule:truthy
88
branches:
99
- master
1010

11-
name: 🧪 Unit testing (MySQL)
11+
name: 🧪 Testing (MySQL)
1212

1313
env:
1414
DB_HOST: 127.0.0.1
@@ -62,7 +62,7 @@ jobs:
6262
uses: shivammathur/[email protected]
6363
with:
6464
php-version: ${{ matrix.php-version }}
65-
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, pdo_sqlite
65+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql
6666
ini-values: error_reporting=E_ALL
6767
coverage: none
6868

.github/workflows/testing-pgsql.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
name: 🧪 Testing (PostgreSQL)
12+
13+
env:
14+
DB_HOST: 127.0.0.1
15+
DB_PORT: 15432
16+
DB_USERNAME: cycle
17+
DB_PASSWORD: SSpaSS__1_123
18+
DB_CONNECTION: mysql
19+
DB_DATABASE: default
20+
21+
jobs:
22+
test-mysql:
23+
timeout-minutes: 4
24+
runs-on: ${{ matrix.os }}
25+
concurrency:
26+
cancel-in-progress: true
27+
group: test-mysql-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }}
28+
strategy:
29+
fail-fast: true
30+
matrix:
31+
os:
32+
- 'ubuntu-latest'
33+
php-version:
34+
- '8.2'
35+
dependencies:
36+
- locked
37+
pgsql-version:
38+
- '13-alpine'
39+
40+
services:
41+
mysql:
42+
image: postgres:${{ matrix.pgsql-version }}
43+
env:
44+
POSTGRES_DB: 'default'
45+
POSTGRES_USER: 'cycle'
46+
POSTGRES_PASSWORD: 'SSpaSS__1_123'
47+
options: >-
48+
--health-cmd pg_isready
49+
--health-interval 10s
50+
--health-timeout 5s
51+
--health-retries 5
52+
ports:
53+
- 15432:5432
54+
55+
steps:
56+
- name: 📦 Check out the codebase
57+
uses: actions/[email protected]
58+
59+
- name: 🛠️ Setup PHP
60+
uses: shivammathur/[email protected]
61+
with:
62+
php-version: ${{ matrix.php-version }}
63+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, pdo_pgsql
64+
ini-values: error_reporting=E_ALL
65+
coverage: none
66+
67+
- name: 🛠️ Setup problem matchers
68+
run: |
69+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
70+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
71+
72+
- name: 🤖 Validate composer.json and composer.lock
73+
run: composer validate --ansi --strict
74+
75+
- name: 🔍 Get composer cache directory
76+
uses: wayofdev/gh-actions/actions/composer/[email protected]
77+
78+
- name: ♻️ Restore cached dependencies installed with composer
79+
uses: actions/[email protected]
80+
with:
81+
path: ${{ env.COMPOSER_CACHE_DIR }}
82+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
83+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
84+
85+
- name: 🗑️ Remove PHP platform configuration
86+
if: "matrix.dependencies != 'locked'"
87+
run: composer config platform.php --ansi --unset
88+
89+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
90+
uses: wayofdev/gh-actions/actions/composer/[email protected]
91+
with:
92+
dependencies: ${{ matrix.dependencies }}
93+
94+
- name: 🧪 Run phpunit tests with Pest
95+
run: composer test

.github/workflows/testing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
name: 🧪 Unit and mutation testing (SQLite)
3+
name: 🧪 Testing (SQLite)
44

55
on: # yamllint disable-line rule:truthy
66
pull_request:

0 commit comments

Comments
 (0)