Skip to content

Commit d6d9d64

Browse files
authored
Merge pull request #390 from wayofdev/develop
2 parents f3c9d3c + 4414a30 commit d6d9d64

12 files changed

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

.github/workflows/deploy-release.yml

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,79 @@ on: # yamllint disable-line rule:truthy
77

88
name: 🚀 Deploy to production
99

10+
env:
11+
# Disable docker support in Makefile
12+
APP_RUNNER: 'cd app &&'
13+
1014
concurrency: production
1115

1216
jobs:
1317
deployment:
18+
timeout-minutes: 8
1419
runs-on: ${{ matrix.os }}
1520
strategy:
16-
fail-fast: true
1721
matrix:
18-
os: ["ubuntu-22.04"]
19-
php: ["8.2"]
22+
os:
23+
- ubuntu-latest
24+
php-version:
25+
- '8.3'
26+
dependencies:
27+
- locked
2028
environment:
2129
name: production
2230
url: https://prod.laravel-starter-tpl.wayof.dev
2331

2432
steps:
33+
- name: 🛠️ Setup PHP
34+
uses: shivammathur/setup-php@2.30.4
35+
with:
36+
php-version: ${{ matrix.php-version }}
37+
extensions: curl, libxml, mbstring, zip, fileinfo, decimal, pdo, pdo_mysql
38+
ini-values: error_reporting=E_ALL
39+
coverage: none
40+
2541
- name: 📦 Check out the codebase
26-
uses: actions/checkout@v4
42+
uses: actions/checkout@v4.1.6
2743
with:
2844
fetch-depth: 0
2945

30-
- name: 🛠️ Setup PHP
31-
uses: shivammathur/setup-php@v2
46+
- name: 🛠️ Setup problem matchers
47+
run: |
48+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
49+
50+
- name: 🤖 Validate composer.json and composer.lock
51+
run: make validate-composer
52+
53+
- name: 🔍 Get composer cache directory
54+
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0
3255
with:
33-
php-version: ${{ matrix.php }}
34-
extensions: curl, libxml, mbstring, zip, fileinfo, decimal
35-
ini-values: error_reporting=E_ALL
36-
tools: composer:v2
56+
working-directory: app
3757

38-
- name: ♻️ Restore cached backend dependencies
39-
id: cached-composer-dependencies
40-
uses: actions/cache@v4
58+
- name: ♻️ Restore cached dependencies installed with composer
59+
uses: actions/cache@v4.0.2
4160
with:
42-
path: vendor
43-
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}
61+
path: ${{ env.COMPOSER_CACHE_DIR }}
62+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
63+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
4464

45-
- name: 📥 Install backend dependencies
46-
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
47-
run: cd app && composer install
65+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
66+
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0
67+
with:
68+
working-directory: app
69+
dependencies: ${{ matrix.dependencies }}
4870

4971
- name: 📤 Deploy production environment
5072
uses: deployphp/action@v1
5173
with:
5274
private-key: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
5375
dep: deploy prod
54-
deployer-version: 7.3.1
76+
deployer-version: 7.4.0
5577
sub-directory: app
5678
env:
57-
DEPLOYER_STAGING_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_STAGING_SLACK_WEBHOOK }}
58-
DEPLOYER_STAGING_REMOTE_USER: ${{ secrets.DEPLOYER_STAGING_REMOTE_USER }}
59-
DEPLOYER_STAGING_HOST: "staging.laravel-starter-tpl.wayof.dev"
60-
DEPLOYER_STAGING_BRANCH: "develop"
6179
DEPLOYER_PROD_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_PROD_SLACK_WEBHOOK }}
6280
DEPLOYER_PROD_REMOTE_USER: ${{ secrets.DEPLOYER_PROD_REMOTE_USER }}
63-
DEPLOYER_PROD_HOST: "prod.laravel-starter-tpl.wayof.dev"
64-
DEPLOYER_PROD_BRANCH: "master"
81+
DEPLOYER_PROD_HOST: prod.laravel-starter-tpl.wayof.dev
82+
DEPLOYER_PROD_BRANCH: master
6583

6684
- name: 📦 Create sentry release
6785
uses: getsentry/action-release@v1

0 commit comments

Comments
 (0)