Skip to content

Commit efe5351

Browse files
authored
Merge pull request #738 from wayofdev/feat/infra-dx
2 parents 918b337 + 837213d commit efe5351

7 files changed

+386
-79
lines changed

.github/workflows/ci.yml.dist

-78
This file was deleted.
+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
3+
name: 🔐 Dependency analysis
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches:
8+
- master
9+
paths:
10+
- 'config/**'
11+
- 'src/**'
12+
- 'tests/**'
13+
- '.php-cs-fixer.dist.php'
14+
- 'composer.json'
15+
- 'composer.lock'
16+
- 'composer-require-checker.json'
17+
pull_request:
18+
branches:
19+
- master
20+
paths:
21+
- 'config/**'
22+
- 'src/**'
23+
- 'tests/**'
24+
- '.php-cs-fixer.dist.php'
25+
- 'composer.json'
26+
- 'composer.lock'
27+
- 'composer-require-checker.json'
28+
29+
jobs:
30+
dependency-analysis:
31+
timeout-minutes: 4
32+
runs-on: ${{ matrix.os }}
33+
concurrency:
34+
cancel-in-progress: true
35+
group: dependency-analysis-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
36+
strategy:
37+
fail-fast: true
38+
matrix:
39+
os:
40+
- ubuntu-latest
41+
php-version:
42+
- '8.2'
43+
dependencies:
44+
- locked
45+
46+
steps:
47+
- name: 📦 Check out the codebase
48+
uses: actions/[email protected]
49+
50+
- name: 🛠️ Setup PHP
51+
uses: shivammathur/[email protected]
52+
with:
53+
php-version: ${{ matrix.php-version }}
54+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql
55+
ini-values: error_reporting=E_ALL
56+
coverage: none
57+
tools: phive
58+
59+
- name: 🛠️ Setup problem matchers
60+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
61+
62+
- name: 🤖 Validate composer.json and composer.lock
63+
run: composer validate --ansi --strict
64+
65+
- name: 🔍 Get composer cache directory
66+
uses: wayofdev/gh-actions/actions/composer/[email protected]
67+
68+
- name: ♻️ Restore cached dependencies installed with composer
69+
uses: actions/[email protected]
70+
with:
71+
path: ${{ env.COMPOSER_CACHE_DIR }}
72+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
73+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
74+
75+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
76+
uses: wayofdev/gh-actions/actions/composer/[email protected]
77+
with:
78+
dependencies: ${{ matrix.dependencies }}
79+
80+
- name: 📥 Install dependencies with phive
81+
uses: wayofdev/gh-actions/actions/phive/[email protected]
82+
with:
83+
phive-home: '.phive'
84+
trust-gpg-keys: 0xC00543248C87FB13,0x033E5F8D801A2F8D
85+
86+
- name: 🔬 Run maglnet/composer-require-checker
87+
run: .phive/composer-require-checker check --ansi --config-file="$(pwd)/composer-require-checker.json" --verbose

.github/workflows/static-analysis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on: # yamllint disable-line rule:truthy
99
- 'src/**'
1010
- 'tests/**'
1111
- '.php-cs-fixer.dist.php'
12+
- 'composer.json'
13+
- 'composer.lock'
14+
- 'phpstan.neon.dist'
15+
- 'phpstan-baseline.neon'
16+
- 'psalm.xml'
17+
- 'psalm-baseline.xml'
1218
pull_request:
1319
branches:
1420
- master
@@ -17,6 +23,12 @@ on: # yamllint disable-line rule:truthy
1723
- 'src/**'
1824
- 'tests/**'
1925
- '.php-cs-fixer.dist.php'
26+
- 'composer.json'
27+
- 'composer.lock'
28+
- 'phpstan.neon.dist'
29+
- 'phpstan-baseline.neon'
30+
- 'psalm.xml'
31+
- 'psalm-baseline.xml'
2032

2133
name: 🔍 Static analysis
2234

.github/workflows/testing-mssql.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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 (MSSQL - SQLServer)
12+
13+
env:
14+
DB_HOST: 127.0.0.1
15+
DB_PORT: 11433
16+
DB_USERNAME: SA
17+
DB_PASSWORD: 'SSpaSS__1_123'
18+
DB_CONNECTION: sqlserver
19+
DB_DATABASE: tempdb
20+
21+
jobs:
22+
test-sqlserver:
23+
timeout-minutes: 4
24+
runs-on: ${{ matrix.os }}
25+
concurrency:
26+
cancel-in-progress: true
27+
group: test-sqlserver-${{ 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+
sqlserver-version:
38+
- '2022-latest'
39+
40+
services:
41+
sqlserver:
42+
image: mcr.microsoft.com/mssql/server:${{ matrix.sqlserver-version }}
43+
env:
44+
ACCEPT_EULA: 'Y'
45+
SA_PASSWORD: 'SSpaSS__1_123'
46+
options: >-
47+
--health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'SSpaSS__1_123' -l 30 -Q 'SELECT 1'"
48+
--health-interval 3s
49+
--health-timeout 1s
50+
--health-retries 10
51+
ports:
52+
- 11433:1433
53+
54+
steps:
55+
- name: 📦 Check out the codebase
56+
uses: actions/[email protected]
57+
58+
- name: 🛠️ Setup PHP
59+
uses: shivammathur/[email protected]
60+
with:
61+
php-version: ${{ matrix.php-version }}
62+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, pdo_sqlsrv
63+
ini-values: error_reporting=E_ALL
64+
coverage: none
65+
66+
- name: 🛠️ Setup problem matchers
67+
run: |
68+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
69+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
70+
71+
- name: 🤖 Validate composer.json and composer.lock
72+
run: composer validate --ansi --strict
73+
74+
- name: 🔍 Get composer cache directory
75+
uses: wayofdev/gh-actions/actions/composer/[email protected]
76+
77+
- name: ♻️ Restore cached dependencies installed with composer
78+
uses: actions/[email protected]
79+
with:
80+
path: ${{ env.COMPOSER_CACHE_DIR }}
81+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
82+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
83+
84+
- name: 🗑️ Remove PHP platform configuration
85+
if: "matrix.dependencies != 'locked'"
86+
run: composer config platform.php --ansi --unset
87+
88+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
89+
uses: wayofdev/gh-actions/actions/composer/[email protected]
90+
with:
91+
dependencies: ${{ matrix.dependencies }}
92+
93+
- name: 🧪 Run phpunit tests with Pest
94+
run: composer test

.github/workflows/testing-mysql.yml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 (MySQL)
12+
13+
env:
14+
DB_HOST: 127.0.0.1
15+
DB_PORT: 13306
16+
DB_USERNAME: cycle
17+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
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+
mysql-version:
38+
- latest
39+
40+
services:
41+
mysql:
42+
image: mysql:${{ matrix.mysql-version }}
43+
env:
44+
MYSQL_ROOT_HOST: '%'
45+
MYSQL_USER: 'cycle'
46+
MYSQL_PASSWORD: ${{ secrets.DB_PASSWORD }}
47+
MYSQL_ROOT_PASSWORD: ${{ secrets.DB_PASSWORD }}
48+
MYSQL_DATABASE: 'default'
49+
options: >-
50+
--health-cmd="mysqladmin ping"
51+
--health-interval 10s
52+
--health-timeout 5s
53+
--health-retries 5
54+
ports:
55+
- 13306:3306
56+
57+
steps:
58+
- name: 📦 Check out the codebase
59+
uses: actions/[email protected]
60+
61+
- name: 🛠️ Setup PHP
62+
uses: shivammathur/[email protected]
63+
with:
64+
php-version: ${{ matrix.php-version }}
65+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql
66+
ini-values: error_reporting=E_ALL
67+
coverage: none
68+
69+
- name: 🛠️ Setup problem matchers
70+
run: |
71+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
72+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
73+
74+
- name: 🤖 Validate composer.json and composer.lock
75+
run: composer validate --ansi --strict
76+
77+
- name: 🔍 Get composer cache directory
78+
uses: wayofdev/gh-actions/actions/composer/[email protected]
79+
80+
- name: ♻️ Restore cached dependencies installed with composer
81+
uses: actions/[email protected]
82+
with:
83+
path: ${{ env.COMPOSER_CACHE_DIR }}
84+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
85+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
86+
87+
- name: 🗑️ Remove PHP platform configuration
88+
if: "matrix.dependencies != 'locked'"
89+
run: composer config platform.php --ansi --unset
90+
91+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
92+
uses: wayofdev/gh-actions/actions/composer/[email protected]
93+
with:
94+
dependencies: ${{ matrix.dependencies }}
95+
96+
- name: 🧪 Run phpunit tests with Pest
97+
run: composer test

0 commit comments

Comments
 (0)