Skip to content

Commit 2d045f4

Browse files
authored
Upgrade php-humanizer to the latest standards (#122)
* Library dependencies upgrade & cleanup * Fixed static analyze errors * Aeon php integration * Removed travis configuration * Fixed missing phive keys
1 parent da1bbcf commit 2d045f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3978
-1013
lines changed

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.php text eol=lf
2+
*.phpt text eol=lf
3+
/composer.lock export-ignore
4+
/.github/ export-ignore
5+
/.phive/ export-ignore
6+
/tests export-ignore
7+
/.gitattributes export-ignore
8+
/.gitignore export-ignore
9+
/.php_cs export-ignore
10+
/phpstan.neon export-ignore
11+
/phpunit.xml export-ignore

.github/PULL_REQUEST_TEMPLATE.md

+33
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

+6
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"
+31
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"
+38
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+
- 6.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\""
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]\""
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

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: "Static Analyze"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "4.x"
8+
schedule:
9+
- cron: '* 8 * * *'
10+
11+
jobs:
12+
compatibility:
13+
name: "Static Analyze"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "7.4"
23+
operating-system:
24+
- "ubuntu-latest"
25+
26+
steps:
27+
- name: "Checkout"
28+
uses: "actions/checkout@v2"
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@v2"
32+
with:
33+
coverage: "pcov"
34+
php-version: "${{ matrix.php-version }}"
35+
ini-values: memory_limit=-1
36+
tools: phive, composer:v2
37+
38+
- name: "Cache Phive dependencies"
39+
uses: "actions/cache@v2"
40+
with:
41+
path: |
42+
~/.phive
43+
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
44+
restore-keys: |
45+
${{ runner.os }}-phive-
46+
47+
- name: "Get Composer Cache Directory"
48+
id: composer-cache
49+
run: |
50+
echo "::set-output name=dir::$(composer config cache-files-dir)"
51+
52+
- name: "Cache Composer dependencies"
53+
uses: "actions/cache@v2"
54+
with:
55+
path: |
56+
${{ steps.composer-cache.outputs.dir }}
57+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.lock') }}"
58+
restore-keys: |
59+
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
60+
61+
- name: "Install tools"
62+
run: "phive install --trust-gpg-keys E82B2FB314E9906E,CF1A108D0E7AE720,8A03EA3B385DBAA1,12CE0F1D262429A5 --force-accept-unsigned"
63+
64+
- name: "Install lowest dependencies"
65+
if: ${{ matrix.dependencies == 'lowest' }}
66+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
67+
68+
- name: "Install highest dependencies"
69+
if: ${{ matrix.dependencies == 'highest' }}
70+
run: "composer update --no-interaction --no-progress --no-suggest"
71+
72+
- name: "Install locked dependencies"
73+
if: ${{ matrix.dependencies == 'locked' }}
74+
run: "composer install --no-interaction --no-progress --no-suggest"
75+
76+
- name: "Static Analyze"
77+
run: "composer static:analyze"

.github/workflows/tests.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: "Tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "4.x"
8+
schedule:
9+
- cron: '* 8 * * *'
10+
11+
jobs:
12+
compatibility:
13+
name: "Tests"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
- "lowest"
22+
- "highest"
23+
php-version:
24+
- "7.4"
25+
- "8.0"
26+
operating-system:
27+
- "ubuntu-latest"
28+
29+
steps:
30+
- name: "Checkout"
31+
uses: "actions/checkout@v2"
32+
33+
- name: "Install PHP"
34+
uses: "shivammathur/setup-php@v2"
35+
with:
36+
coverage: "pcov"
37+
php-version: "${{ matrix.php-version }}"
38+
ini-values: memory_limit=-1
39+
tools: phive, composer:v2
40+
41+
- name: "Cache Phive dependencies"
42+
uses: "actions/cache@v2"
43+
with:
44+
path: |
45+
~/.phive
46+
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
47+
restore-keys: |
48+
${{ runner.os }}-phive-
49+
50+
- name: "Get Composer Cache Directory"
51+
id: composer-cache
52+
run: |
53+
echo "::set-output name=dir::$(composer config cache-files-dir)"
54+
55+
- name: "Cache Composer dependencies"
56+
uses: "actions/cache@v2"
57+
with:
58+
path: |
59+
${{ steps.composer-cache.outputs.dir }}
60+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.lock') }}"
61+
restore-keys: |
62+
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
63+
64+
- name: "Install tools"
65+
run: "phive install --trust-gpg-keys E82B2FB314E9906E,CF1A108D0E7AE720,8A03EA3B385DBAA1,12CE0F1D262429A5 --force-accept-unsigned"
66+
67+
- name: "Install lowest dependencies"
68+
if: ${{ matrix.dependencies == 'lowest' }}
69+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
70+
71+
- name: "Install highest dependencies"
72+
if: ${{ matrix.dependencies == 'highest' }}
73+
run: "composer update --no-interaction --no-progress --no-suggest"
74+
75+
- name: "Install locked dependencies"
76+
if: ${{ matrix.dependencies == 'locked' }}
77+
run: "composer install --no-interaction --no-progress --no-suggest"
78+
79+
- name: "Tests"
80+
run: "composer test"

.gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
vendor/
22
bin/
3-
composer.lock
4-
composer.phar
5-
*.cache
3+
var/
4+
tools/

.phive/phars.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="php-cs-fixer" version="^2.16.4" installed="2.16.4" location="./tools/php-cs-fixer" copy="true"/>
4+
<phar name="phpstan" version="^0.12.32" installed="0.12.52" location="./tools/phpstan" copy="true"/>
5+
<phar name="psalm" version="^3.12.2" installed="3.18.2" location="./tools/psalm" copy="true"/>
6+
</phive>

.travis.yml

-19
This file was deleted.

0 commit comments

Comments
 (0)