Skip to content

Commit

Permalink
Migrated from phpspec to phpunit, added integration with aeon-php/aut…
Browse files Browse the repository at this point in the history
…omation
  • Loading branch information
norberttech committed Feb 23, 2021
1 parent 5eab40b commit 1e6528f
Show file tree
Hide file tree
Showing 35 changed files with 2,330 additions and 1,019 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [norberttech]
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- Bellow section will be used to automatically generate changelog, please do not modify HTML code structure -->
<h2>Change Log</h2>
<div id="change-log">
<h4>Added</h4>
<ul id="added">
<!-- <li>Feature making everything better</li> -->
</ul>
<h4>Fixed</h4>
<ul id="fixed">
<!-- <li>Behavior that was incorrect</li> -->
</ul>
<h4>Changed</h4>
<ul id="changed">
<!-- <li>Something into something new</li> -->
</ul>
<h4>Removed</h4>
<ul id="removed">
<!-- <li>Something</li> -->
</ul>
<h4>Deprecated</h4>
<ul id="deprecated">
<!-- <li>Something is from now deprecated</li> -->
</ul>
<h4>Security</h4>
<ul id="security">
<!-- <li>Something that was security issue, is not an issue anymore</li> -->
</ul>
</div>
<hr/>

<h2>Description</h2>

<!-- Please provide a shore description of changes in this section, feel free to use markdown syntax -->
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
31 changes: 31 additions & 0 deletions .github/workflows/changelog-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Changelog - Release Unreleased"

###################################################################
# WARNING - THIS ACTION WILL PUSH COMMIT DIRECTLY INTO REPOSITORY #
###################################################################

on:
push:
tags:
- '*'

jobs:
changelog-release-unreleased:
name: "Update Changelog - Release Unreleased"

runs-on: "ubuntu-latest"

steps:
- name: "Get tag name"
id: "tag-name"
run: |
tag=$(echo ${{ github.event.ref }} | cut -c11-)
echo "::set-output name=tag::$tag"
- name: "Update CHANGELOG"
uses: "docker://aeonphp/automation:latest"
env:
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
entrypoint: "/composer/vendor/bin/automation"
args: "changelog:release:unreleased ${{ github.repository }} CHANGELOG.md ${{ steps.tag-name.outputs.tag }} --github-file-changelog-update"
38 changes: 38 additions & 0 deletions .github/workflows/changelog-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Changelog - Update Unreleased"

###################################################################
# WARNING - THIS ACTION WILL PUSH COMMIT DIRECTLY INTO REPOSITORY #
###################################################################

on:
push:
branches:
- 3.x

jobs:
changelog-update-unreleased:
name: "Changelog - Update Unreleased"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Restore Automation cache"
uses: "actions/cache@v2"
with:
path: |
cache
key: "${{ runner.os }}-automation-${{ hashFiles('**/CHANGELOG.md') }}"
restore-keys: |
${{ runner.os }}-automation-
- name: "Update CHANGELOG"
uses: "docker://aeonphp/automation:latest"
env:
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
EON_AUTOMATION_CACHE_DIR: "/github/workspace/cache"
with:
entrypoint: "/composer/vendor/bin/automation"
args: "changelog:generate ${{ github.repository }} --github-file-update-path=CHANGELOG.md --skip-from=\"dependabot[bot]\" --skip-from=\"aeon-automation\""
20 changes: 20 additions & 0 deletions .github/workflows/pull-request-description-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Pull Request Description Check"

on:
pull_request:
types: ["opened", "edited", "reopened", "ready_for_review"]

jobs:
pull-request-description-check:
name: "Pull Request Description"

runs-on: "ubuntu-latest"

steps:
- name: "Pull Request Description - Check"
uses: "docker://aeonphp/automation:latest"
env:
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
entrypoint: "/composer/vendor/bin/automation"
args: "pull-request:description:check ${{ github.repository }} ${{ github.event.pull_request.number }} --skip-from=\"dependabot[bot]\""
25 changes: 25 additions & 0 deletions .github/workflows/release-description-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Release - Description Update"

#########################################################
# WARNING - THIS ACTION WILL UPDATE RELEASE DESCRIPTION #
#########################################################

on:
release:
types:
- created

jobs:
release-description-update:
name: "Release - Description Update"

runs-on: "ubuntu-latest"

steps:
- name: "Update CHANGELOG"
uses: "docker://aeonphp/automation:latest"
env:
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
entrypoint: "/composer/vendor/bin/automation"
args: "changelog:generate ${{ github.repository }} --tag=${{ github.event.release.tag_name }} --github-release-update --skip-from=\"dependabot[bot]\" --skip-from=\"aeon-automation\""
2 changes: 1 addition & 1 deletion .github/workflows/static-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- "master"
- "3.x"
schedule:
- cron: '* 8 * * *'

Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- "master"
- "3.x"
schedule:
- cron: '* 8 * * *'

Expand Down Expand Up @@ -42,28 +42,22 @@ jobs:

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

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

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

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

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

- name: "Tests"
run: "composer test"
continue-on-error: ${{ matrix.php-version == '8.0' }}
run: "composer test"
11 changes: 8 additions & 3 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ $finder = PhpCsFixer\Finder::create()
->files()
->in([
__DIR__ . '/src',
__DIR__ . '/spec',
]);
__DIR__ . '/tests'
])
->notName('*.phpt');

if (!\file_exists(__DIR__ . '/var')) {
\mkdir(__DIR__ . '/var');
}

/**
* This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist
* and slightly adjusted.
*/
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setCacheFile(__DIR__.'/var/.php_cs.cache')
Expand Down Expand Up @@ -81,7 +86,7 @@ return PhpCsFixer\Config::create()
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => ['ensure_fully_multiline' => true],
'modernize_types_casting' => true,
'modernize_types_casting' => false,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_constant_invocation' => false,
Expand Down
75 changes: 75 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
## [3.1.0] - 2020-09-27

### Added
- [4c3902](https://github.com/coduo/php-to-string/commit/4c39029921aa1ead4d156e81dc9eac4dfc121e11) - **poser.pugx.org badges** - [@norberttech](https://github.com/norberttech)

### Changed
- [#14](https://github.com/coduo/php-to-string/pull/14) - **dependencies** - [@norberttech](https://github.com/norberttech)
- [37176c](https://github.com/coduo/php-to-string/commit/37176cfff780473b5aedd89f5734d7cad6c7588e) - **master branch alias** - [@norberttech](https://github.com/norberttech)

## [3.0.0] - 2019-11-23

### Added
- [#11](https://github.com/coduo/php-to-string/pull/11) - **missing dependency and moved from travis to github actions** - [@norberttech](https://github.com/norberttech)

### Changed
- [6ee3db](https://github.com/coduo/php-to-string/commit/6ee3dbd06fbff934673f2e59094158cf187400b2) - **Update README.md** - [@norberttech](https://github.com/norberttech)
- [d8b1dd](https://github.com/coduo/php-to-string/commit/d8b1dd1986b2da58dbdd83f19a910229c0802bf3) - **Run testsuite also on pushes to master** - [@norberttech](https://github.com/norberttech)
- [#12](https://github.com/coduo/php-to-string/pull/12) - **Switch to short array notation** - [@norberttech](https://github.com/norberttech)

### Removed
- [#13](https://github.com/coduo/php-to-string/pull/13) - **php 7.0 & 7.1 support** - [@norberttech](https://github.com/norberttech)

## [2.0.2] - 2019-08-09

### Added
- [#8](https://github.com/coduo/php-to-string/pull/8) - **intl extension as required dependency** - [@teklakct](https://github.com/teklakct)

### Fixed
- [#7](https://github.com/coduo/php-to-string/pull/7) - **minor typo** - [@sdaoudi](https://github.com/sdaoudi)

### Removed
- [#9](https://github.com/coduo/php-to-string/pull/9) - **non supported php versions from Travis build** - [@norberttech](https://github.com/norberttech)

## [2.0.1] - 2016-01-20

### Changed
- [4c1d7e](https://github.com/coduo/php-to-string/commit/4c1d7e2e76017719edc70e944ace0ec570748a78) - **Merge pull request #6 from jakzal/symfony-intl-3** - [@norzechowicz](https://github.com/norzechowicz)
- [#6](https://github.com/coduo/php-to-string/pull/6) - **Remove an optional dependency on symfony/intl** - [@jakzal](https://github.com/jakzal)

## [2.0.0] - 2015-12-13

### Added
- [#5](https://github.com/coduo/php-to-string/pull/5) - **support for php7** - [@norberttech](https://github.com/norberttech)

### Changed
- [5a55f3](https://github.com/coduo/php-to-string/commit/5a55f3bd3af772175b458ce48648a36a1d15b54a) - **Merge pull request #5 from norzechowicz/php7-support** - [@norzechowicz](https://github.com/norzechowicz)

## [1.0.2] - 2015-12-13

### Changed
- [#4](https://github.com/coduo/php-to-string/pull/4) - **travis.ci configuration file** - [@norberttech](https://github.com/norberttech)
- [fb3f87](https://github.com/coduo/php-to-string/commit/fb3f879af3878310bd05c35fbec7256b4aeaf58c) - **Merge pull request #4 from norzechowicz/travis** - [@norzechowicz](https://github.com/norzechowicz)

## [1.0.1] - 2014-10-18

### Added
- [a92b47](https://github.com/coduo/php-to-string/commit/a92b47db643541baa7ea9c61ea427a6896676685) - **symfony2/intl fixed phpspec extensions** - [@norberttech](https://github.com/norberttech)

### Changed
- [a24f4c](https://github.com/coduo/php-to-string/commit/a24f4c97278fafa69cea2c180a036b2b207ab204) - **Update composer.json** - [@norberttech](https://github.com/norberttech)
- [5ad9be](https://github.com/coduo/php-to-string/commit/5ad9be49ecfe0e832066bf86dca65ea9a197891e) - **Update README.md** - [@norberttech](https://github.com/norberttech)

## [v0.1.0] - 2014-05-08

### Changed
- [420928](https://github.com/coduo/php-to-string/commit/42092807d4efab4c0c6c7782ab085978de4f4ce9) - **Travis.yml CS fix** - [@norberttech](https://github.com/norberttech)
- [616f6f](https://github.com/coduo/php-to-string/commit/616f6f7dfd47056f39d332d34d9ade395715e6fd) - **Use PhpSpecDataProviderExtension to improve specs readabilty** - [@norberttech](https://github.com/norberttech)
- [f519ef](https://github.com/coduo/php-to-string/commit/f519ef20ec15ba7030daa6315a3090e2a8964efa) - **Update README.md** - [@norberttech](https://github.com/norberttech)
- [dc133b](https://github.com/coduo/php-to-string/commit/dc133bcded367ab1495846d934ef003f92143ee8) - **Update README.md** - [@norberttech](https://github.com/norberttech)
- [f6034a](https://github.com/coduo/php-to-string/commit/f6034a859c7ce9e3b98521df7d27779cccfe7b01) - **Initial commit** - [@norberttech](https://github.com/norberttech)

### Fixed
- [7e29aa](https://github.com/coduo/php-to-string/commit/7e29aa926156d7952ea070af19066eac830192a2) - **travis configuration** - [@norberttech](https://github.com/norberttech)

Generated by [Automation](https://github.com/aeon-php/automation)
2 changes: 1 addition & 1 deletion LICENCE → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 Michal Dabrowski, Norbert Orzechowicz
Copyright (c) 2014-2021 Michal Dabrowski, Norbert Orzechowicz

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Simple library that converts PHP values into strings.

Status:

* ![Build Status](https://github.com/coduo/php-to-string/workflows/Tests/badge.svg?branch=master) - master

![Build Status](https://github.com/coduo/php-to-string/workflows/Tests/badge.svg?branch=3.x)
[![Latest Stable Version](https://poser.pugx.org/coduo/php-to-string/v/stable)](https://packagist.org/packages/coduo/php-to-string)
[![Total Downloads](https://poser.pugx.org/coduo/php-to-string/downloads)](https://packagist.org/packages/coduo/php-to-string)
[![Latest Unstable Version](https://poser.pugx.org/coduo/php-to-string/v/unstable)](https://packagist.org/packages/coduo/php-to-string)
Expand Down
17 changes: 12 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,31 @@
"symfony/intl": "^3.4|^4.0|^5.0"
},
"require-dev": {
"phpspec/phpspec": "^6"
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
"Coduo\\ToString\\" : "src/Coduo/ToString"
}
},
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
"autoload-dev": {
"psr-4": {
"Coduo\\ToString\\": "tests/Coduo/ToString"
}
},
"suggest": {
"ext-intl": "Required if you are going to use humanizer with locales different than en_EN"
},
"scripts": {
"build": [
"@static:analyze",
"@test"
],
"cs:php:fix": [
"tools/php-cs-fixer fix --using-cache=no"
],
"test" : [
"phpspec run --format=pretty"
"phpunit"
],
"static:analyze": [
"tools/php-cs-fixer fix --dry-run"
Expand Down

0 comments on commit 1e6528f

Please sign in to comment.