Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 4541b21

Browse files
authored
Merge pull request #2 from PrisisForks/feature/provider
2 parents 84c3d88 + c59b4d3 commit 4541b21

37 files changed

+1026
-171
lines changed

.github/workflows/coding-standard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
key: "coding-standard-v1" # change key (version) to clear cache
2828
extensions: "mbstring"
2929
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
30-
tools: "composer, cs2pr"
30+
tools: "composer:v2, cs2pr"
3131

3232
steps:
3333
- name: "Git checkout"

.github/workflows/continuous-integration.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy
1313
- "composer.json"
1414

1515
jobs:
16-
LinuxIntegration:
16+
linux-integration:
1717
name: "PHP ${{ matrix.php-versions }} Test on ubuntu-latest OS with ${{ matrix.dependencies }} dependencies"
1818

1919
runs-on: "ubuntu-latest"
@@ -27,7 +27,7 @@ jobs:
2727
key: "continuous-integration-linux-v1" # change key (version) to clear cache
2828
extensions: "mbstring"
2929
ini-values: "date.timezone=Europe/Berlin, opcache.enable_cli=0, serialize_precision=14"
30-
tools: "composer"
30+
tools: "composer:v2"
3131

3232
steps:
3333
- name: "Git checkout"
@@ -114,7 +114,7 @@ jobs:
114114
name: "linux_clover"
115115
path: "./.build/phpunit/coverage/clover.xml"
116116

117-
WindowsIntegration:
117+
windows-integration:
118118
name: "PHP ${{ matrix.php-versions }} Test on windows-latest OS with ${{ matrix.dependencies }} dependencies"
119119

120120
runs-on: "windows-latest"
@@ -128,7 +128,7 @@ jobs:
128128
key: "continuous-integration-windows-v1" # change key (version) to clear cache
129129
extensions: "mbstring"
130130
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
131-
tools: "composer"
131+
tools: "composer:v2"
132132

133133
steps:
134134
- name: "Git checkout"
@@ -221,7 +221,7 @@ jobs:
221221
name: "windows_clover"
222222
path: "./.build/phpunit/coverage/clover.xml"
223223

224-
Coverage:
224+
coverage:
225225
needs: ["LinuxIntegration", "WindowsIntegration"]
226226

227227
runs-on: "ubuntu-latest"

.github/workflows/license-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
key: "license-update-linux-v1" # change key (version) to clear cache
2222
extensions: "mbstring"
2323
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
24-
tools: "composer, cs2pr"
24+
tools: "composer:v2, cs2pr"
2525

2626
steps:
2727
- name: "Git checkout"

.github/workflows/mutation.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525

2626
env:
2727
key: "mutation-v1" # change key (version) to clear cache
28-
min-covered-msi: 100
29-
min-msi: 100
28+
min-covered-msi: 9
29+
min-msi: 9
3030
extensions: "mbstring"
3131
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
32-
tools: "composer"
32+
tools: "composer:v2"
3333

3434
steps:
3535
- name: "Git checkout"
@@ -98,3 +98,5 @@ jobs:
9898

9999
- name: "mutation tests"
100100
run: "composer infection -- --ignore-msi-with-no-mutations --min-covered-msi=${{ env.min-covered-msi }} --min-msi=${{ env.min-msi }}"
101+
env:
102+
XDEBUG_MODE: "coverage"

.github/workflows/rector-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
key: "rector-ci-v1" # change key (version) to clear cache
2828
extensions: "mbstring, intl"
2929
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
30-
tools: "composer, cs2pr"
30+
tools: "composer:v2, cs2pr"
3131

3232
steps:
3333
- name: "Git checkout"
Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
22

3-
name: "Semantic Release"
3+
name: "Security Analysis"
44

55
on: # yamllint disable-line rule:truthy
66
push:
7-
branches:
8-
- "([0-9])?(.{+([0-9]),x}).x"
9-
- "main"
10-
- "next"
11-
- "next-major"
12-
- "alpha"
13-
- "beta"
7+
paths:
8+
- "**.php"
9+
- "composer.json"
10+
pull_request:
11+
paths:
12+
- "**.php"
13+
- "composer.json"
1414

1515
jobs:
16-
Test:
17-
name: "PHP ${{ matrix.php-versions }} Test on ubuntu-latest OS with ${{ matrix.dependencies }} dependencies"
18-
19-
if: "github.repository != 'narrowspark/php-library-template'"
16+
security-analysis:
17+
name: "Security Analysis"
2018

2119
runs-on: "ubuntu-latest"
2220

@@ -26,10 +24,10 @@ jobs:
2624
dependencies: ["locked"]
2725

2826
env:
29-
key: "semantic-release-linux-v1" # change key (version) to clear cache
27+
key: "security-analysis-v1" # change key (version) to clear cache
3028
extensions: "mbstring"
3129
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
32-
tools: "composer"
30+
tools: "composer:v2"
3331

3432
steps:
3533
- name: "Git checkout"
@@ -96,38 +94,5 @@ jobs:
9694
with:
9795
dependency-versions: "${{ matrix.dependencies }}"
9896

99-
- name: "Setup Problem Matchers for PHPUnit"
100-
run: "echo '::add-matcher::${{ runner.tool_cache }}/phpunit.json'"
101-
102-
- name: "Run Test's"
103-
run: "./vendor/bin/phpunit --verbose"
104-
105-
Semantic-Release:
106-
name: "Semantic Release"
107-
108-
if: "github.repository != 'narrowspark/php-library-template'"
109-
110-
runs-on: "ubuntu-latest"
111-
112-
needs: ["Test"]
113-
114-
steps:
115-
- uses: "actions/checkout@v2"
116-
with:
117-
persist-credentials: false
118-
119-
- name: "Semantic Release"
120-
uses: "cycjimmy/semantic-release-action@v2"
121-
with:
122-
semantic_version: "17.0.7"
123-
extra_plugins: |
124-
@semantic-release/changelog@^5.0.1
125-
@semantic-release/git@^9.0.0
126-
@google/semantic-release-replace-plugin@^1.0.0
127-
conventional-changelog-conventionalcommits@^4.3.0
128-
env:
129-
GITHUB_TOKEN: "${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}"
130-
GIT_AUTHOR_NAME: "github-actions-shell"
131-
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
132-
GIT_COMMITTER_NAME: "github-actions-shell"
133-
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
97+
- name: "running security analysis ( psalm )"
98+
run: "vendor/bin/psalm --output-format=github --taint-analysis"

.github/workflows/static-analyze.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
key: "phpstan-static-analyze-v1" # change key (version) to clear cache
2828
extensions: "mbstring, intl"
2929
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
30-
tools: "composer, cs2pr"
30+
tools: "composer:v2, cs2pr"
3131

3232
steps:
3333
- name: "Git checkout"
@@ -111,7 +111,7 @@ jobs:
111111
key: "psalm-static-analyze-v1 " # change key (version) to clear cache
112112
extensions: "mbstring, intl"
113113
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
114-
tools: "composer"
114+
tools: "composer:v2"
115115

116116
steps:
117117
- name: "Git checkout"

.github/workflows/version.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Update version files"
4+
5+
on: # yamllint disable-line rule:truthy
6+
schedule:
7+
- cron: "0 0 * * *"
8+
9+
jobs:
10+
fetch-versions:
11+
name: "PHP ${{ matrix.php-versions }} fetch versions on ubuntu-latest OS with ${{ matrix.dependencies }} dependencies"
12+
13+
runs-on: "ubuntu-latest"
14+
15+
strategy:
16+
matrix:
17+
php-versions: ["8.0"]
18+
dependencies: ["locked"]
19+
20+
env:
21+
key: "fetch-versions-linux-v1" # change key (version) to clear cache
22+
extensions: "mbstring"
23+
ini-values: "date.timezone=Europe/Berlin, opcache.enable_cli=0, serialize_precision=14"
24+
tools: "composer"
25+
26+
steps:
27+
- name: "Git checkout"
28+
uses: "actions/checkout@v2"
29+
with:
30+
fetch-depth: 2
31+
env:
32+
GIT_COMMITTER_NAME: "GitHub Actions Shell"
33+
GIT_AUTHOR_NAME: "GitHub Actions Shell"
34+
EMAIL: "github-actions[bot]@users.noreply.github.com"
35+
36+
- name: "Setup cache environment"
37+
id: "cache-env"
38+
uses: "shivammathur/cache-extensions@v1"
39+
with:
40+
php-version: "${{ matrix.php-versions }}"
41+
extensions: "${{ env.extensions }}"
42+
key: "${{ env.key }}"
43+
44+
- name: "Cache extensions"
45+
uses: "actions/cache@v2"
46+
with:
47+
path: "${{ steps.cache-env.outputs.dir }}"
48+
key: "${{ steps.cache-env.outputs.key }}"
49+
restore-keys: "${{ steps.cache-env.outputs.key }}"
50+
51+
- name: "Setup PHP"
52+
uses: "shivammathur/setup-php@v2"
53+
with:
54+
php-version: "${{ matrix.php-versions }}"
55+
extensions: "${{ env.extensions }}"
56+
ini-values: "${{ env.ini-values }}"
57+
tools: "${{ env.tools }}"
58+
coverage: "pcov"
59+
60+
- name: "Setup Problem Matchers for PHP"
61+
run: "echo '::add-matcher::${{ runner.tool_cache }}/php.json'"
62+
63+
- name: "Check PHP Version"
64+
run: "php -v"
65+
66+
- name: "List all php extensions with versions"
67+
run: "php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . \" \" . phpversion($extension) . PHP_EOL;'"
68+
69+
- name: "Configure Container"
70+
env:
71+
GIT_USER_EMAIL: "${{ secrets.GIT_USER_EMAIL }}"
72+
GIT_USER_USERNAME: "${{ secrets.GIT_USER_USERNAME }}"
73+
run: |
74+
EMAIL=${GIT_USER_EMAIL:-"github-actions[bot]@users.noreply.github.com"}
75+
NAME=${GIT_USER_USERNAME:-"github-actions-shell"}
76+
77+
git config --global user.email "${EMAIL}"
78+
git config --global user.name "${NAME}"
79+
80+
- name: "Check Composer Version"
81+
run: "composer -V"
82+
83+
- name: "Validate composer.json and composer.json"
84+
run: "composer validate --strict"
85+
86+
- name: "Install dependencies with Composer"
87+
uses: "ramsey/composer-install@v1"
88+
with:
89+
dependency-versions: "${{ matrix.dependencies }}"
90+
91+
- name: "Fetch versions"
92+
run: "php bin/versions.php"
93+
env:
94+
VERSIONS_GITHUB_TOKEN: "${{ secrets.VERSIONS_GITHUB_TOKEN }}"
95+
96+
- name: "Commit modified files"
97+
uses: "stefanzweifel/[email protected]"
98+
with:
99+
commit_author: "Daniel Bannert <[email protected]>"
100+
commit_message: "feat: updated versions files"
101+
commit_user_email: "[email protected]"
102+
commit_user_name: "prisis"

.php_cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $license = License\Type\MIT::markdown(
1212
new \DateTimeZone('UTC')
1313
),
1414
License\Holder::fromString('Daniel Bannert'),
15-
License\Url::fromString('https://github.com/narrowspark/php-library-template')
15+
License\Url::fromString('https://github.com/narrowspark/automatic-versions')
1616
);
1717

1818
$license->save();
@@ -24,11 +24,12 @@ $config->getFinder()
2424
->in(__DIR__)
2525
->exclude([
2626
'.build',
27-
'.dependabot',
2827
'.docker',
2928
'.github',
30-
'vendor',
29+
'vendor'
3130
])
31+
// php_unit_namespaced rule thinks than the const are some namespaces
32+
->notPath('rector.php')
3233
->name('*.php')
3334
->ignoreDotFiles(true)
3435
->ignoreVCS(true);

.typo-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ excluded_words:
4949
- "prisis"
5050
- "narrowspark"
5151
- "composer"
52+
- "viserio"
53+
- "guzzlehttp"
5254

5355
# Would you like filenames to also be spellchecked?
5456
spellcheck_filenames: true

0 commit comments

Comments
 (0)