Skip to content

Commit 7e95833

Browse files
committed
ci: workflow and local dev env updates
1 parent 95508ce commit 7e95833

File tree

7 files changed

+96
-15
lines changed

7 files changed

+96
-15
lines changed
File renamed without changes.

.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 }}

.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
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

composer.json

+16-5
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@
8383
"wayofdev/cs-fixer-config": "^1.2"
8484
},
8585
"suggest": {
86+
"cycle/active-record": "Provides a simple way to work with your database using Active Record pattern and Cycle ORM",
87+
"wayofdev/cs-fixer-config": "A set of PHP-CS-Fixer rules for Laravel projects",
8688
"wayofdev/laravel-cycle-orm-factories": "Cycle-ORM Entity Factories and Database Seeders for Laravel",
87-
"wayofdev/laravel-paginator": "Custom Laravel Paginator for Cycle-ORM implementing RFC 5988"
89+
"wayofdev/laravel-paginator": "Custom Laravel Paginator for Cycle-ORM implementing RFC 5988",
90+
"wayofdev/laravel-symfony-serializer": "Symfony Serializer for Laravel"
8891
},
8992
"minimum-stability": "dev",
9093
"prefer-stable": true,
@@ -133,11 +136,13 @@
133136
"cs:fix": "php vendor/bin/php-cs-fixer fix -v",
134137
"infect": [
135138
"Composer\\Config::disableProcessTimeout",
136-
"XDEBUG_MODE=coverage php vendor/bin/roave-infection-static-analysis-plugin --threads=2 --configuration=infection.json.dist"
139+
"@putenv XDEBUG_MODE=coverage",
140+
"php vendor/bin/roave-infection-static-analysis-plugin --threads=2"
137141
],
138142
"infect:ci": [
139143
"Composer\\Config::disableProcessTimeout",
140-
"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"
144+
"@putenv XDEBUG_MODE=coverage",
145+
"php vendor/bin/roave-infection-static-analysis-plugin --threads=2 --ansi --logger-github --ignore-msi-with-no-mutations --only-covered"
141146
],
142147
"psalm": "php vendor/bin/psalm --show-info=true",
143148
"psalm:baseline": "php vendor/bin/psalm --set-baseline=psalm-baseline.xml",
@@ -147,7 +152,13 @@
147152
"stan": "php vendor/bin/phpstan analyse --memory-limit=2G",
148153
"stan:baseline": "php vendor/bin/phpstan analyse --generate-baseline --memory-limit=2G --allow-empty-baseline",
149154
"stan:ci": "php vendor/bin/phpstan analyse --memory-limit=2G --error-format=github",
150-
"test": "XDEBUG_MODE=coverage php vendor/bin/pest",
151-
"test:cc": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml"
155+
"test": [
156+
"@putenv XDEBUG_MODE=coverage",
157+
"php vendor/bin/pest"
158+
],
159+
"test:cc": [
160+
"@putenv XDEBUG_MODE=coverage",
161+
"php vendor/bin/pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml"
162+
]
152163
}
153164
}

composer.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
services:
44
app:
5-
image: wayofdev/php-dev:8.3-cli-alpine-latest
5+
image: wayofdev/php-dev:8.2-cli-alpine-latest
66
container_name: ${COMPOSE_PROJECT_NAME}-app
77
restart: on-failure
88
networks:

phpstan.neon.dist

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ parameters:
77
- config/
88
- src/
99
- tests/
10-
11-
checkMissingIterableValueType: false
1210
checkOctaneCompatibility: true
1311
checkModelProperties: true
14-
1512
tmpDir: .build/phpstan/

0 commit comments

Comments
 (0)