Skip to content

Commit d5ac074

Browse files
authored
Merge pull request #732 from wayofdev/feat/infra-dx
2 parents ca5a6fb + c35d151 commit d5ac074

13 files changed

+2043
-2533
lines changed

.github/workflows/apply-labels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name: 🏷️ Add labels
1414

1515
jobs:
1616
label:
17-
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master
17+
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@v3.1.0
1818
with:
1919
os: ubuntu-latest
2020
secrets:
File renamed without changes.

.github/workflows/create-arch-diagram.yml

-29
This file was deleted.

.github/workflows/create-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: 🎉 Create release
19-
uses: google-github-actions/release-please-action@v4
19+
uses: googleapis/release-please-action@v4.1.1
2020
id: release
2121
with:
2222
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
3+
name: 🔐 Security analysis
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
security-analysis:
15+
timeout-minutes: 4
16+
runs-on: ${{ matrix.os }}
17+
concurrency:
18+
cancel-in-progress: true
19+
group: security-analysis-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
strategy:
21+
fail-fast: true
22+
matrix:
23+
os:
24+
- ubuntu-latest
25+
php-version:
26+
- '8.2'
27+
dependencies:
28+
- locked
29+
steps:
30+
- name: 📦 Check out the codebase
31+
uses: actions/[email protected]
32+
33+
- name: 🛠️ Setup PHP
34+
uses: shivammathur/[email protected]
35+
with:
36+
php-version: ${{ matrix.php-version }}
37+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql
38+
ini-values: error_reporting=E_ALL
39+
coverage: none
40+
41+
- name: 🛠️ Setup problem matchers
42+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
43+
44+
- name: 🤖 Validate composer.json and composer.lock
45+
run: composer validate --ansi --strict
46+
47+
- name: 🔍 Get composer cache directory
48+
uses: wayofdev/gh-actions/actions/composer/[email protected]
49+
50+
- name: ♻️ Restore cached dependencies installed with composer
51+
uses: actions/[email protected]
52+
with:
53+
path: ${{ env.COMPOSER_CACHE_DIR }}
54+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
55+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
56+
57+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
58+
uses: wayofdev/gh-actions/actions/composer/[email protected]
59+
with:
60+
dependencies: ${{ matrix.dependencies }}
61+
62+
- name: 🐛 Check installed packages for security vulnerability advisories
63+
run: composer audit --ansi

.github/workflows/shellcheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
shellcheck:
13-
uses: wayofdev/gh-actions/.github/workflows/shellcheck.yml@master
13+
uses: wayofdev/gh-actions/.github/workflows/shellcheck.yml@v3.1.0
1414
with:
1515
os: ubuntu-latest
1616
severity: warning

.github/workflows/static-analysis.yml

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

.phive/phars.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="composer-require-checker" version="^4.10.0" installed="4.10.0" location="./.phive/composer-require-checker" copy="false"/>
3+
<phar name="composer-normalize" version="^2.42.0" installed="2.42.0" location="./.phive/composer-normalize" copy="false"/>
4+
<phar name="composer-require-checker" version="^4.11.0" installed="4.11.0" location="./.phive/composer-require-checker" copy="false"/>
45
</phive>

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ update: ## Updates composer dependencies by running composer update command
171171
.PHONY: update
172172

173173
phive: ## Installs dependencies with phive
174-
$(APP_RUNNER) /usr/local/bin/phive install --trust-gpg-keys 0x033E5F8D801A2F8D
174+
$(APP_RUNNER) /usr/local/bin/phive install --trust-gpg-keys 0xC00543248C87FB13,0x033E5F8D801A2F8D
175175
.PHONY: phive
176176

177177
#
@@ -241,7 +241,7 @@ lint-deps: ## Runs composer-require-checker – checks for dependencies that are
241241
.PHONY: lint-deps
242242

243243
lint-composer: ## Normalize composer.json and composer.lock files
244-
$(APP_COMPOSER) normalize
244+
$(APP_RUNNER) .phive/composer-normalize normalize
245245
.PHONY: lint-composer
246246

247247
lint-audit: ## Runs security checks for composer dependencies

composer.json

+25-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"description": "🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.",
44
"license": "MIT",
55
"type": "library",
6-
"version": "4.12.3",
76
"keywords": [
87
"php",
98
"php8",
@@ -44,6 +43,7 @@
4443
],
4544
"require": {
4645
"php": "^8.2",
46+
"ext-fileinfo": "*",
4747
"ext-pdo": "*",
4848
"cycle/annotated": "^4.1",
4949
"cycle/database": "^2.8",
@@ -62,8 +62,9 @@
6262
"symfony/console": "^6.4 || ^7.0"
6363
},
6464
"require-dev": {
65+
"ext-curl": "*",
66+
"ext-pdo_mysql": "*",
6567
"beberlei/assert": "^3.3",
66-
"ergebnis/composer-normalize": "^2.42",
6768
"fakerphp/faker": "^1.23",
6869
"larastan/larastan": "^2.9",
6970
"laravel/telescope": "^5.0",
@@ -80,13 +81,18 @@
8081
"psalm/plugin-phpunit": "~0.19.0",
8182
"rector/rector": "^1.0",
8283
"roave/infection-static-analysis-plugin": "^1.35",
83-
"roave/security-advisories": "dev-latest",
8484
"vimeo/psalm": "^5.23.1",
8585
"wayofdev/cs-fixer-config": "^1.2"
8686
},
8787
"suggest": {
88+
"ext-pdo_mysql": "Required for MySQL database support",
89+
"ext-pdo_pgsql": "Required for PostgreSQL database support",
90+
"ext-pdo_sqlite": "Required for SQLite database support",
91+
"cycle/active-record": "Provides a simple way to work with your database using Active Record pattern and Cycle ORM",
92+
"wayofdev/cs-fixer-config": "A set of PHP-CS-Fixer rules for Laravel projects",
8893
"wayofdev/laravel-cycle-orm-factories": "Cycle-ORM Entity Factories and Database Seeders for Laravel",
89-
"wayofdev/laravel-paginator": "Custom Laravel Paginator for Cycle-ORM implementing RFC 5988"
94+
"wayofdev/laravel-paginator": "Custom Laravel Paginator for Cycle-ORM implementing RFC 5988",
95+
"wayofdev/laravel-symfony-serializer": "Symfony Serializer for Laravel"
9096
},
9197
"minimum-stability": "dev",
9298
"prefer-stable": true,
@@ -108,6 +114,9 @@
108114
"pestphp/pest-plugin": true,
109115
"phpstan/extension-installer": true
110116
},
117+
"platform": {
118+
"php": "8.2.19"
119+
},
111120
"sort-packages": true
112121
},
113122
"extra": {
@@ -132,11 +141,13 @@
132141
"cs:fix": "php vendor/bin/php-cs-fixer fix -v",
133142
"infect": [
134143
"Composer\\Config::disableProcessTimeout",
135-
"XDEBUG_MODE=coverage php vendor/bin/roave-infection-static-analysis-plugin --threads=2 --configuration=infection.json.dist"
144+
"@putenv XDEBUG_MODE=coverage",
145+
"php vendor/bin/roave-infection-static-analysis-plugin --threads=2"
136146
],
137147
"infect:ci": [
138148
"Composer\\Config::disableProcessTimeout",
139-
"XDEBUG_MODE=coverage php vendor/bin/roave-infection-static-analysis-plugin --threads=2 --ansi --configuration=infection.json.dist --logger-github --ignore-msi-with-no-mutations --only-covered"
149+
"@putenv XDEBUG_MODE=coverage",
150+
"php vendor/bin/roave-infection-static-analysis-plugin --threads=2 --ansi --logger-github --ignore-msi-with-no-mutations --only-covered"
140151
],
141152
"psalm": "php vendor/bin/psalm --show-info=true",
142153
"psalm:baseline": "php vendor/bin/psalm --set-baseline=psalm-baseline.xml",
@@ -146,7 +157,13 @@
146157
"stan": "php vendor/bin/phpstan analyse --memory-limit=2G",
147158
"stan:baseline": "php vendor/bin/phpstan analyse --generate-baseline --memory-limit=2G --allow-empty-baseline",
148159
"stan:ci": "php vendor/bin/phpstan analyse --memory-limit=2G --error-format=github",
149-
"test": "XDEBUG_MODE=coverage php vendor/bin/pest",
150-
"test:cc": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml"
160+
"test": [
161+
"@putenv XDEBUG_MODE=coverage",
162+
"php vendor/bin/pest"
163+
],
164+
"test:cc": [
165+
"@putenv XDEBUG_MODE=coverage",
166+
"php vendor/bin/pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml"
167+
]
151168
}
152169
}

0 commit comments

Comments
 (0)