Skip to content

Commit 3569c86

Browse files
committed
Enhancement: Synchronize with ergebnis/php-library-template
1 parent d54489b commit 3569c86

17 files changed

+227
-103
lines changed
File renamed without changes.

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ indent_size = 2
1313
[*.neon]
1414
indent_style = tab
1515

16-
[*.yml]
16+
[*.{yaml,yml}]
1717
indent_size = 2
1818

1919
[Makefile]

.github/CONTRIBUTING.md

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

33
We are using [GitHub Actions](https://github.com/features/actions) as a continuous integration system.
44

5-
For details, see [`workflows/continuous-integration.yml`](workflows/continuous-integration.yml).
5+
For details, take a look at the following workflow configuration files:
6+
7+
- [`workflows/integrate.yaml`](workflows/integrate.yaml)
8+
- [`workflows/prune.yaml`](workflows/prune.yaml)
9+
- [`workflows/release.yaml`](workflows/release.yaml)
10+
- [`workflows/renew.yaml`](workflows/renew.yaml)
611

712
## Coding Standards
813

@@ -40,7 +45,7 @@ $ make static-code-analysis
4045

4146
to run a static code analysis.
4247

43-
We are also using the baseline features of [`phpstan/phpstan`(https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
48+
We are also using the baseline features of [`phpstan/phpstan`](https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
4449

4550
Run
4651

.github/settings.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ branches:
2828
- "Tests (7.4, highest)"
2929
strict: false
3030
restrictions:
31+
32+
# https://developer.github.com/v3/repos/branches/#parameters-1
33+
34+
# Note: User, app, and team restrictions are only available for organization-owned repositories.
35+
# Set to null to disable when using this configuration for a repository on a personal account.
36+
3137
apps:
3238
- "dependabot-preview"
3339
teams: []
@@ -39,35 +45,35 @@ branches:
3945

4046
labels:
4147
- name: "bug"
42-
color: "#ee0701"
48+
color: "ee0701"
4349
description: ""
4450

4551
- name: "dependency"
46-
color: "#0366d6"
52+
color: "0366d6"
4753
description: ""
4854

4955
- name: "enhancement"
50-
color: "#0e8a16"
56+
color: "0e8a16"
5157
description: ""
5258

5359
- name: "rfc"
54-
color: "#f4db3a"
60+
color: "f4db3a"
5561
description: ""
5662

5763
- name: "question"
58-
color: "#cc317c"
64+
color: "cc317c"
5965
description: ""
6066

6167
- name: "security"
62-
color: "#ee0701"
68+
color: "ee0701"
6369
description: ""
6470

6571
- name: "stale"
66-
color: "#eeeeee"
72+
color: "eeeeee"
6773
description: ""
6874

6975
- name: "vendor"
70-
color: "#f4db3a"
76+
color: "f4db3a"
7177
description: ""
7278

7379
# https://developer.github.com/v3/repos/#edit

.github/workflows/continuous-integration.yml renamed to .github/workflows/integrate.yaml

+63-33
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
22

3-
name: "Continuous Integration"
3+
name: "Integrate"
44

5-
on:
6-
pull_request:
5+
on: # yamllint disable-line rule:truthy
6+
pull_request: null
77
push:
88
branches:
99
- "master"
@@ -27,10 +27,17 @@ jobs:
2727

2828
steps:
2929
- name: "Checkout"
30-
uses: "actions/[email protected]"
30+
uses: "actions/checkout@v2"
31+
32+
- name: "Lint YAML files"
33+
uses: "ibiqlik/action-yamllint@v1"
34+
with:
35+
config_file: ".yamllint.yaml"
36+
file_or_dir: "."
37+
strict: true
3138

3239
- name: "Install PHP with extensions"
33-
uses: "shivammathur/setup-php@1.7.3"
40+
uses: "shivammathur/setup-php@v2"
3441
with:
3542
coverage: "none"
3643
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
@@ -39,22 +46,26 @@ jobs:
3946
- name: "Validate composer.json and composer.lock"
4047
run: "composer validate --strict"
4148

49+
- name: "Determine composer cache directory"
50+
id: "determine-composer-cache-directory"
51+
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
52+
4253
- name: "Cache dependencies installed with composer"
43-
uses: "actions/cache@v1.0.3"
54+
uses: "actions/cache@v1"
4455
with:
45-
path: "~/.composer/cache"
56+
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
4657
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
4758
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
4859

49-
- name: "Install lowest dependencies with composer"
60+
- name: "Install lowest dependencies from composer.json"
5061
if: "matrix.dependencies == 'lowest'"
5162
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
5263

53-
- name: "Install locked dependencies with composer"
64+
- name: "Install locked dependencies from composer.lock"
5465
if: "matrix.dependencies == 'locked'"
5566
run: "composer install --no-interaction --no-progress --no-suggest"
5667

57-
- name: "Install highest dependencies with composer"
68+
- name: "Install highest dependencies from composer.json"
5869
if: "matrix.dependencies == 'highest'"
5970
run: "composer update --no-interaction --no-progress --no-suggest"
6071

@@ -65,7 +76,7 @@ jobs:
6576
run: "mkdir -p .build/php-cs-fixer"
6677

6778
- name: "Cache cache directory for friendsofphp/php-cs-fixer"
68-
uses: "actions/cache@v1.0.3"
79+
uses: "actions/cache@v1"
6980
with:
7081
path: ".build/php-cs-fixer"
7182
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('**/composer.lock') }}"
@@ -89,36 +100,40 @@ jobs:
89100

90101
steps:
91102
- name: "Checkout"
92-
uses: "actions/checkout@v2.0.0"
103+
uses: "actions/checkout@v2"
93104

94105
- name: "Install PHP with extensions"
95-
uses: "shivammathur/setup-php@1.7.3"
106+
uses: "shivammathur/setup-php@v2"
96107
with:
97108
coverage: "none"
98109
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
99110
php-version: "${{ matrix.php-version }}"
100111

112+
- name: "Determine composer cache directory"
113+
id: "determine-composer-cache-directory"
114+
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
115+
101116
- name: "Cache dependencies installed with composer"
102-
uses: "actions/cache@v1.0.3"
117+
uses: "actions/cache@v1"
103118
with:
104-
path: "~/.composer/cache"
119+
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
105120
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
106121
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
107122

108-
- name: "Install lowest dependencies with composer"
123+
- name: "Install lowest dependencies from composer.json"
109124
if: "matrix.dependencies == 'lowest'"
110125
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
111126

112-
- name: "Install locked dependencies with composer"
127+
- name: "Install locked dependencies from composer.lock"
113128
if: "matrix.dependencies == 'locked'"
114129
run: "composer install --no-interaction --no-progress --no-suggest"
115130

116-
- name: "Install highest dependencies with composer"
131+
- name: "Install highest dependencies from composer.json"
117132
if: "matrix.dependencies == 'highest'"
118133
run: "composer update --no-interaction --no-progress --no-suggest"
119134

120135
- name: "Run maglnet/composer-require-checker"
121-
uses: "docker://webfactory/composer-require-checker:2.0.0"
136+
uses: "docker://webfactory/composer-require-checker:2.1.0"
122137

123138
static-code-analysis:
124139
name: "Static Code Analysis"
@@ -135,37 +150,48 @@ jobs:
135150

136151
steps:
137152
- name: "Checkout"
138-
uses: "actions/checkout@v2.0.0"
153+
uses: "actions/checkout@v2"
139154

140155
- name: "Install PHP with extensions"
141-
uses: "shivammathur/setup-php@1.7.3"
156+
uses: "shivammathur/setup-php@v2"
142157
with:
143158
coverage: "none"
144159
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
145160
php-version: "${{ matrix.php-version }}"
146161

162+
- name: "Determine composer cache directory"
163+
id: "determine-composer-cache-directory"
164+
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
165+
147166
- name: "Cache dependencies installed with composer"
148-
uses: "actions/cache@v1.0.3"
167+
uses: "actions/cache@v1"
149168
with:
150-
path: "~/.composer/cache"
169+
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
151170
key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.lock') }}"
152171
restore-keys: "${{ matrix.php-version }}-composer-locked-"
153172

154-
- name: "Install lowest dependencies with composer"
173+
- name: "Install lowest dependencies from composer.json"
155174
if: "matrix.dependencies == 'lowest'"
156175
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
157176

158-
- name: "Install locked dependencies with composer"
177+
- name: "Install locked dependencies from composer.lock"
159178
if: "matrix.dependencies == 'locked'"
160179
run: "composer install --no-interaction --no-progress --no-suggest"
161180

162-
- name: "Install highest dependencies with composer"
181+
- name: "Install highest dependencies from composer.json"
163182
if: "matrix.dependencies == 'highest'"
164183
run: "composer update --no-interaction --no-progress --no-suggest"
165184

166185
- name: "Create cache directory for phpstan/phpstan"
167186
run: "mkdir -p .build/phpstan"
168187

188+
- name: "Cache cache directory for phpstan/phpstan"
189+
uses: "actions/cache@v1"
190+
with:
191+
path: ".build/phpstan"
192+
key: "php-${{ matrix.php-version }}-phpstan-${{ hashFiles('**/composer.lock') }}"
193+
restore-keys: "php-${{ matrix.php-version }}-phpstan-"
194+
169195
- name: "Run phpstan/phpstan"
170196
run: "vendor/bin/phpstan analyse --configuration=phpstan.neon"
171197

@@ -194,31 +220,35 @@ jobs:
194220

195221
steps:
196222
- name: "Checkout"
197-
uses: "actions/checkout@v2.0.0"
223+
uses: "actions/checkout@v2"
198224

199225
- name: "Install PHP with extensions"
200-
uses: "shivammathur/setup-php@1.7.3"
226+
uses: "shivammathur/setup-php@v2"
201227
with:
202228
coverage: "none"
203229
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
204230
php-version: "${{ matrix.php-version }}"
205231

232+
- name: "Determine composer cache directory"
233+
id: "determine-composer-cache-directory"
234+
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
235+
206236
- name: "Cache dependencies installed with composer"
207-
uses: "actions/cache@v1.0.3"
237+
uses: "actions/cache@v1"
208238
with:
209-
path: "~/.composer/cache"
239+
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
210240
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
211241
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
212242

213-
- name: "Install lowest dependencies with composer"
243+
- name: "Install lowest dependencies from composer.json"
214244
if: "matrix.dependencies == 'lowest'"
215245
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
216246

217-
- name: "Install locked dependencies with composer"
247+
- name: "Install locked dependencies from composer.lock"
218248
if: "matrix.dependencies == 'locked'"
219249
run: "composer install --no-interaction --no-progress --no-suggest"
220250

221-
- name: "Install highest dependencies with composer"
251+
- name: "Install highest dependencies from composer.json"
222252
if: "matrix.dependencies == 'highest'"
223253
run: "composer update --no-interaction --no-progress --no-suggest"
224254

.github/workflows/prune.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# https://github.com/actions/stale
2+
3+
name: "Prune"
4+
5+
on: # yamllint disable-line rule:truthy
6+
schedule:
7+
- cron: "0 12 * * *"
8+
9+
jobs:
10+
prune:
11+
name: "Issues"
12+
13+
runs-on: "ubuntu-latest"
14+
15+
steps:
16+
- name: "Prune issues and pull requests"
17+
uses: "actions/stale@v1"
18+
with:
19+
days-before-close: 5
20+
days-before-stale: 60
21+
repo-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
22+
stale-issue-label: "stale"
23+
stale-issue-message: |
24+
Since this issue has not had any activity within the last sixty days, I have marked it as stale.
25+
26+
I will close it if no further activity occurs within the next five days.
27+
stale-pr-label: "stale"
28+
stale-pr-message: |
29+
Since this pull request has not had any activity within the last sixty days, I have marked it as stale.
30+
31+
I will close it if no further activity occurs within the next five days.

.github/workflows/continuous-deployment.yml renamed to .github/workflows/release.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
22

3-
name: "Continuous Deployment"
3+
name: "Release"
44

5-
on:
5+
on: # yamllint disable-line rule:truthy
66
push:
77
tags:
88
- "**"
@@ -19,7 +19,7 @@ jobs:
1919
run: "echo \"::set-output name=tag::${GITHUB_REF#refs/tags/}\""
2020

2121
- name: "Create release"
22-
uses: "actions/create-release@v1.0.0"
22+
uses: "actions/create-release@v1"
2323
env:
2424
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
2525
with:

0 commit comments

Comments
 (0)