Skip to content

Commit 413c5f9

Browse files
authored
Merge pull request #389 from wayofdev/feat/laravel-11
2 parents b424af4 + ba25a67 commit 413c5f9

File tree

8 files changed

+239
-7
lines changed

8 files changed

+239
-7
lines changed
File renamed without changes.
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
---
2+
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
name: 🧹 Fix PHP coding standards
10+
11+
env:
12+
APP_RUNNER: 'cd app &&'
13+
14+
jobs:
15+
commit-linting:
16+
timeout-minutes: 4
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
pull-requests: read
21+
steps:
22+
- name: 📦 Check out the codebase
23+
uses: actions/checkout@v4.1.6
24+
25+
- name: 🧐 Lint commits using "commitlint"
26+
uses: wagoid/commitlint-github-action@v6.0.1
27+
with:
28+
configFile: ${{ github.workspace }}/.github/.commitlint.config.mjs
29+
failOnWarnings: false
30+
failOnErrors: false
31+
helpURL: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'
32+
33+
yaml-linting:
34+
timeout-minutes: 4
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
pull-requests: read
39+
steps:
40+
- name: 📦 Check out the codebase
41+
uses: actions/checkout@v4.1.6
42+
43+
- name: 🧐 Lint YAML files
44+
uses: ibiqlik/action-yamllint@v3.1.1
45+
with:
46+
config_file: .github/.yamllint.yaml
47+
file_or_dir: '.'
48+
strict: true
49+
50+
markdown-linting:
51+
timeout-minutes: 4
52+
runs-on: ubuntu-latest
53+
concurrency:
54+
cancel-in-progress: true
55+
group: markdown-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
56+
steps:
57+
- name: 📦 Check out the codebase
58+
uses: actions/checkout@v4.1.6
59+
60+
- name: 🧐 Lint Markdown files
61+
uses: DavidAnson/markdownlint-cli2-action@v16.0.0
62+
with:
63+
globs: |
64+
**/*.md
65+
!CHANGELOG.md
66+
!app/vendor
67+
!app/node_modules
68+
69+
composer-linting:
70+
timeout-minutes: 4
71+
runs-on: ${{ matrix.os }}
72+
concurrency:
73+
cancel-in-progress: true
74+
group: composer-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
75+
strategy:
76+
matrix:
77+
os:
78+
- ubuntu-latest
79+
php-version:
80+
- '8.3'
81+
dependencies:
82+
- locked
83+
permissions:
84+
contents: write
85+
steps:
86+
- name: 🛠️ Setup PHP
87+
uses: shivammathur/setup-php@2.30.4
88+
with:
89+
php-version: ${{ matrix.php-version }}
90+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql
91+
ini-values: error_reporting=E_ALL
92+
coverage: none
93+
tools: phive
94+
95+
- name: 📦 Check out the codebase
96+
uses: actions/checkout@v4.1.6
97+
98+
- name: 🛠️ Setup problem matchers
99+
run: |
100+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
101+
102+
- name: 🤖 Validate composer.json and composer.lock
103+
run: make validate-composer
104+
105+
- name: 🔍 Get composer cache directory
106+
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0
107+
with:
108+
working-directory: app
109+
110+
- name: ♻️ Restore cached dependencies installed with composer
111+
uses: actions/cache@v4.0.2
112+
with:
113+
path: ${{ env.COMPOSER_CACHE_DIR }}
114+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
115+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
116+
117+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
118+
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0
119+
with:
120+
working-directory: app
121+
dependencies: ${{ matrix.dependencies }}
122+
123+
- name: 📥 Install dependencies with phive
124+
working-directory: app
125+
env:
126+
PHIVE_HOME: .phive
127+
run: phive install --trust-gpg-keys 0xC00543248C87FB13,0x033E5F8D801A2F8D,0x47436587D82C4A39
128+
shell: bash
129+
130+
- name: 🔍 Run ergebnis/composer-normalize
131+
working-directory: app
132+
run: .phive/composer-normalize --ansi --dry-run
133+
134+
coding-standards:
135+
timeout-minutes: 4
136+
runs-on: ${{ matrix.os }}
137+
concurrency:
138+
cancel-in-progress: true
139+
group: coding-standards-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
140+
strategy:
141+
matrix:
142+
os:
143+
- ubuntu-latest
144+
php-version:
145+
- '8.3'
146+
dependencies:
147+
- locked
148+
permissions:
149+
contents: write
150+
steps:
151+
- name: ⚙️ Set git to use LF line endings
152+
run: |
153+
git config --global core.autocrlf false
154+
git config --global core.eol lf
155+
156+
- name: 🛠️ Setup PHP
157+
uses: shivammathur/setup-php@2.30.4
158+
with:
159+
php-version: ${{ matrix.php-version }}
160+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql
161+
ini-values: error_reporting=E_ALL
162+
coverage: none
163+
164+
- name: 📦 Check out the codebase
165+
uses: actions/checkout@v4.1.6
166+
167+
- name: 🛠️ Setup problem matchers
168+
run: |
169+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
170+
171+
- name: 🤖 Validate composer.json and composer.lock
172+
run: make validate-composer
173+
174+
- name: 🔍 Get composer cache directory
175+
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0
176+
with:
177+
working-directory: app
178+
179+
- name: ♻️ Restore cached dependencies installed with composer
180+
uses: actions/cache@v4.0.2
181+
with:
182+
path: ${{ env.COMPOSER_CACHE_DIR }}
183+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
184+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
185+
186+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
187+
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0
188+
with:
189+
working-directory: app
190+
dependencies: ${{ matrix.dependencies }}
191+
192+
- name: 🛠️ Prepare environment
193+
run: make prepare
194+
195+
- name: 🚨 Run coding standards task
196+
run: make lint-php
197+
env:
198+
PHP_CS_FIXER_IGNORE_ENV: true
199+
200+
- name: 📤 Commit and push changed files back to GitHub
201+
uses: stefanzweifel/git-auto-commit-action@v5.0.1
202+
with:
203+
commit_message: 'style(php-cs-fixer): lint php files and fix coding standards'
204+
branch: ${{ github.head_ref }}
205+
commit_author: 'github-actions <github-actions@users.noreply.github.com>'
206+
env:
207+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/deploy-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
private-key: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
5353
dep: deploy prod
54-
deployer-version: 7.3.1
54+
deployer-version: 7.4.0
5555
sub-directory: app
5656
env:
5757
DEPLOYER_STAGING_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_STAGING_SLACK_WEBHOOK }}

.github/workflows/deploy-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
private-key: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
5353
dep: deploy staging
54-
deployer-version: 7.3.1
54+
deployer-version: 7.4.0
5555
sub-directory: app
5656
env:
5757
DEPLOYER_STAGING_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_STAGING_SLACK_WEBHOOK }}

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ lint-audit: ## Runs security checks for composer dependencies
294294
$(APP_COMPOSER) audit
295295
.PHONY: lint-security
296296

297+
validate-composer: ## Validates composer.json and composer.lock files
298+
$(APP_COMPOSER) validate
299+
.PHONY: validate-composer
300+
297301
#
298302
# Testing
299303
# ------------------------------------------------------------------------------------

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<br>
22

33
<div align="center">
4-
<img width="456" src="https://raw.githubusercontent.com/wayofdev/laravel-starter-tpl/master/assets/logo.gh-light-mode-only.png#gh-light-mode-only">
5-
<img width="456" src="https://raw.githubusercontent.com/wayofdev/laravel-starter-tpl/master/assets/logo.gh-dark-mode-only.png#gh-dark-mode-only">
4+
<img alt="Logo for White Mode" width="456" src="https://raw.githubusercontent.com/wayofdev/laravel-starter-tpl/master/assets/logo.gh-light-mode-only.png#gh-light-mode-only">
5+
<img alt="Logo for Dark Mode" width="456" src="https://raw.githubusercontent.com/wayofdev/laravel-starter-tpl/master/assets/logo.gh-dark-mode-only.png#gh-dark-mode-only">
66
</div>
77
<br>
88

app/composer.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,20 @@
1919
"laravel-ddd",
2020
"ddd"
2121
],
22+
"authors": [
23+
{
24+
"name": "Andrij Orlenko",
25+
"email": "the@wayof.dev",
26+
"homepage": "https://wayof.dev"
27+
}
28+
],
29+
"support": {
30+
"issues": "https://github.com/wayofdev/laravel-starter-tpl/issues",
31+
"source": "https://github.com/wayofdev/laravel-starter-tpl",
32+
"security": "https://github.com/wayofdev/laravel-starter-tpl/blob/master/.github/SECURITY.md"
33+
},
2234
"require": {
23-
"php": "^8.2",
35+
"php": "^8.3",
2436
"ext-pdo": "*",
2537
"deployer/deployer": "^7.4",
2638
"guzzlehttp/guzzle": "^7.8",
@@ -78,7 +90,13 @@
7890
"php-http/discovery": true,
7991
"phpstan/extension-installer": true
8092
},
93+
"audit": {
94+
"abandoned": "report"
95+
},
8196
"optimize-autoloader": true,
97+
"platform": {
98+
"php": "8.3.7"
99+
},
82100
"preferred-install": "dist",
83101
"sort-packages": true
84102
},

app/composer.lock

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)