Skip to content

Commit 1e6528f

Browse files
committed
Migrated from phpspec to phpunit, added integration with aeon-php/automation
1 parent 5eab40b commit 1e6528f

35 files changed

+2330
-1019
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [norberttech]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!-- Bellow section will be used to automatically generate changelog, please do not modify HTML code structure -->
2+
<h2>Change Log</h2>
3+
<div id="change-log">
4+
<h4>Added</h4>
5+
<ul id="added">
6+
<!-- <li>Feature making everything better</li> -->
7+
</ul>
8+
<h4>Fixed</h4>
9+
<ul id="fixed">
10+
<!-- <li>Behavior that was incorrect</li> -->
11+
</ul>
12+
<h4>Changed</h4>
13+
<ul id="changed">
14+
<!-- <li>Something into something new</li> -->
15+
</ul>
16+
<h4>Removed</h4>
17+
<ul id="removed">
18+
<!-- <li>Something</li> -->
19+
</ul>
20+
<h4>Deprecated</h4>
21+
<ul id="deprecated">
22+
<!-- <li>Something is from now deprecated</li> -->
23+
</ul>
24+
<h4>Security</h4>
25+
<ul id="security">
26+
<!-- <li>Something that was security issue, is not an issue anymore</li> -->
27+
</ul>
28+
</div>
29+
<hr/>
30+
31+
<h2>Description</h2>
32+
33+
<!-- Please provide a shore description of changes in this section, feel free to use markdown syntax -->

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Changelog - Release Unreleased"
2+
3+
###################################################################
4+
# WARNING - THIS ACTION WILL PUSH COMMIT DIRECTLY INTO REPOSITORY #
5+
###################################################################
6+
7+
on:
8+
push:
9+
tags:
10+
- '*'
11+
12+
jobs:
13+
changelog-release-unreleased:
14+
name: "Update Changelog - Release Unreleased"
15+
16+
runs-on: "ubuntu-latest"
17+
18+
steps:
19+
- name: "Get tag name"
20+
id: "tag-name"
21+
run: |
22+
tag=$(echo ${{ github.event.ref }} | cut -c11-)
23+
echo "::set-output name=tag::$tag"
24+
25+
- name: "Update CHANGELOG"
26+
uses: "docker://aeonphp/automation:latest"
27+
env:
28+
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
29+
with:
30+
entrypoint: "/composer/vendor/bin/automation"
31+
args: "changelog:release:unreleased ${{ github.repository }} CHANGELOG.md ${{ steps.tag-name.outputs.tag }} --github-file-changelog-update"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Changelog - Update Unreleased"
2+
3+
###################################################################
4+
# WARNING - THIS ACTION WILL PUSH COMMIT DIRECTLY INTO REPOSITORY #
5+
###################################################################
6+
7+
on:
8+
push:
9+
branches:
10+
- 3.x
11+
12+
jobs:
13+
changelog-update-unreleased:
14+
name: "Changelog - Update Unreleased"
15+
16+
runs-on: "ubuntu-latest"
17+
18+
steps:
19+
- name: "Checkout"
20+
uses: "actions/checkout@v2"
21+
22+
- name: "Restore Automation cache"
23+
uses: "actions/cache@v2"
24+
with:
25+
path: |
26+
cache
27+
key: "${{ runner.os }}-automation-${{ hashFiles('**/CHANGELOG.md') }}"
28+
restore-keys: |
29+
${{ runner.os }}-automation-
30+
31+
- name: "Update CHANGELOG"
32+
uses: "docker://aeonphp/automation:latest"
33+
env:
34+
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
35+
EON_AUTOMATION_CACHE_DIR: "/github/workspace/cache"
36+
with:
37+
entrypoint: "/composer/vendor/bin/automation"
38+
args: "changelog:generate ${{ github.repository }} --github-file-update-path=CHANGELOG.md --skip-from=\"dependabot[bot]\" --skip-from=\"aeon-automation\""
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Pull Request Description Check"
2+
3+
on:
4+
pull_request:
5+
types: ["opened", "edited", "reopened", "ready_for_review"]
6+
7+
jobs:
8+
pull-request-description-check:
9+
name: "Pull Request Description"
10+
11+
runs-on: "ubuntu-latest"
12+
13+
steps:
14+
- name: "Pull Request Description - Check"
15+
uses: "docker://aeonphp/automation:latest"
16+
env:
17+
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
18+
with:
19+
entrypoint: "/composer/vendor/bin/automation"
20+
args: "pull-request:description:check ${{ github.repository }} ${{ github.event.pull_request.number }} --skip-from=\"dependabot[bot]\""
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Release - Description Update"
2+
3+
#########################################################
4+
# WARNING - THIS ACTION WILL UPDATE RELEASE DESCRIPTION #
5+
#########################################################
6+
7+
on:
8+
release:
9+
types:
10+
- created
11+
12+
jobs:
13+
release-description-update:
14+
name: "Release - Description Update"
15+
16+
runs-on: "ubuntu-latest"
17+
18+
steps:
19+
- name: "Update CHANGELOG"
20+
uses: "docker://aeonphp/automation:latest"
21+
env:
22+
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
23+
with:
24+
entrypoint: "/composer/vendor/bin/automation"
25+
args: "changelog:generate ${{ github.repository }} --tag=${{ github.event.release.tag_name }} --github-release-update --skip-from=\"dependabot[bot]\" --skip-from=\"aeon-automation\""

.github/workflows/static-analyze.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- "master"
7+
- "3.x"
88
schedule:
99
- cron: '* 8 * * *'
1010

.github/workflows/testsuite.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- "master"
7+
- "3.x"
88
schedule:
99
- cron: '* 8 * * *'
1010

@@ -42,28 +42,22 @@ jobs:
4242

4343
- name: "Install tools"
4444
run: "phive install --trust-gpg-keys E82B2FB314E9906E"
45-
continue-on-error: ${{ matrix.php-version == '8.0' }}
4645

4746
- name: "Install lowest dependencies"
4847
if: ${{ matrix.dependencies == 'lowest' }}
4948
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
50-
continue-on-error: ${{ matrix.php-version == '8.0' }}
5149

5250
- name: "Install highest dependencies"
5351
if: ${{ matrix.dependencies == 'highest'}}
5452
run: "composer update --no-interaction --no-progress --no-suggest"
55-
continue-on-error: ${{ matrix.php-version == '8.0' }}
5653

5754
- name: "Install locked dependencies"
5855
if: ${{ matrix.dependencies == 'locked' && matrix.php-version == '7.4' }}
5956
run: "composer install --no-interaction --no-progress --no-suggest"
60-
continue-on-error: ${{ matrix.php-version == '8.0' }}
6157

6258
- name: "Install highest dependencies"
6359
if: ${{ matrix.dependencies == 'locked' && matrix.php-version != '7.4' }}
6460
run: "composer update --no-interaction --no-progress --no-suggest"
65-
continue-on-error: ${{ matrix.php-version == '8.0' }}
6661

6762
- name: "Tests"
68-
run: "composer test"
69-
continue-on-error: ${{ matrix.php-version == '8.0' }}
63+
run: "composer test"

.php_cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ $finder = PhpCsFixer\Finder::create()
44
->files()
55
->in([
66
__DIR__ . '/src',
7-
__DIR__ . '/spec',
8-
]);
7+
__DIR__ . '/tests'
8+
])
9+
->notName('*.phpt');
910

1011
if (!\file_exists(__DIR__ . '/var')) {
1112
\mkdir(__DIR__ . '/var');
1213
}
1314

15+
/**
16+
* This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist
17+
* and slightly adjusted.
18+
*/
1419
return PhpCsFixer\Config::create()
1520
->setRiskyAllowed(true)
1621
->setCacheFile(__DIR__.'/var/.php_cs.cache')
@@ -81,7 +86,7 @@ return PhpCsFixer\Config::create()
8186
'magic_constant_casing' => true,
8287
'magic_method_casing' => true,
8388
'method_argument_space' => ['ensure_fully_multiline' => true],
84-
'modernize_types_casting' => true,
89+
'modernize_types_casting' => false,
8590
'multiline_comment_opening_closing' => true,
8691
'multiline_whitespace_before_semicolons' => true,
8792
'native_constant_invocation' => false,

0 commit comments

Comments
 (0)