Skip to content

Commit 88d5350

Browse files
committed
ci: update workflows
1 parent 2d9011d commit 88d5350

File tree

12 files changed

+816
-527
lines changed

12 files changed

+816
-527
lines changed

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
"type: documentation":
1313
- changed-files:
14-
- any-glob-to-any-file: ['assets/**/*', '.github/*', './*.md']
14+
- any-glob-to-any-file: ['.github/*', './*.md']
1515

1616
"type: maintenance":
1717
- changed-files:

.github/workflows/auto-merge-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
on: # yamllint disable-line rule:truthy
66
pull_request:
7+
branches:
8+
- master
79

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

.github/workflows/create-release.yml

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

0 commit comments

Comments
 (0)