diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml new file mode 100644 index 0000000..fea990a --- /dev/null +++ b/.github/workflows/Build.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: [master, develop] + pull_request: + branches: [master, develop] + schedule: + - cron: "0 0 * * 5" + +jobs: + PHPUnit: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + name: PHPUnit Tests - ${{ matrix.php_versions }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_versions }} + extensions: mbstring, dom, fileinfo, gd + coverage: xdebug + tools: pecl + - name: Install Dependencies + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Execute tests via PHPUnit + run: vendor/bin/phpunit + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./_meta/coverage.xml + fail_ci_if_error: true diff --git a/.gitignore b/.gitignore index bbfceca..080dee2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ composer.lock _meta .serenata .vscode +.phpunit.result.cache diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a51505b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -dist: xenial -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -cache: - directories: - - $HOME/.composer/cache - -before_script: - - composer install - -script: - - vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b31eb..acec50f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [4.4.3] +- Replaced Travis with GitHub Action for build +- Upgrade deprecation in tests + ## [4.4.2] - Fixed issue where locale files from higher priority locations would not overwrite files from lower priority locations. (N.B.: This fix means the files withing the same locations will be loaded in BACKWARD order. Having the location order is more important in this case.) @@ -64,6 +68,7 @@ See updated [documentation](README.md) for more details on how to use the new Tr ## 4.0.0 - Initial release +[4.4.3]: https://github.com/userfrosting/i18n/compare/4.4.2...4.4.3 [4.4.2]: https://github.com/userfrosting/i18n/compare/4.4.1...4.4.2 [4.4.1]: https://github.com/userfrosting/i18n/compare/4.4.0...4.4.1 [4.4.0]: https://github.com/userfrosting/i18n/compare/4.3.0...4.4.0 diff --git a/README.md b/README.md index 6203d12..8ffcc41 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Latest Version](https://img.shields.io/github/release/userfrosting/i18n.svg)](https://github.com/userfrosting/i18n/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md) -[![Join the chat at https://chat.userfrosting.com/channel/support](https://demo.rocket.chat/images/join-chat.svg)](https://chat.userfrosting.com/channel/support) +[![Join the chat at https://chat.userfrosting.com/channel/support](https://chat.userfrosting.com/api/v1/shield.svg?name=UserFrosting)](https://chat.userfrosting.com/channel/support) [![Donate](https://img.shields.io/badge/Open%20Collective-Donate-blue.svg)](https://opencollective.com/userfrosting#backer) | Branch | Build | Coverage | Style | @@ -14,12 +14,12 @@ [i18n]: https://github.com/userfrosting/i18n [i18n-develop]: https://github.com/userfrosting/i18n/tree/develop [i18n-version]: https://img.shields.io/github/release/userfrosting/i18n.svg -[i18n-master-build]: https://travis-ci.org/userfrosting/i18n.svg?branch=master +[i18n-master-build]: https://github.com/userfrosting/i18n/workflows/Build/badge.svg?branch=master [i18n-master-codecov]: https://codecov.io/gh/userfrosting/i18n/branch/master/graph/badge.svg -[i18n-develop-build]: https://travis-ci.org/userfrosting/i18n.svg?branch=develop +[i18n-develop-build]: https://github.com/userfrosting/i18n/workflows/Build/badge.svg?branch=develop [i18n-develop-codecov]: https://codecov.io/gh/userfrosting/i18n/branch/develop/graph/badge.svg [i18n-releases]: https://github.com/userfrosting/i18n/releases -[i18n-travis]: https://travis-ci.org/userfrosting/i18n +[i18n-travis]: https://github.com/userfrosting/i18n/actions?query=workflow%3ABuild [i18n-codecov]: https://codecov.io/gh/userfrosting/i18n [i18n-style-master]: https://github.styleci.io/repos/60137335/shield?branch=master&style=flat [i18n-style-develop]: https://github.styleci.io/repos/60137335/shield?branch=develop&style=flat diff --git a/composer.json b/composer.json index 55ec433..6a8aef0 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.13", "mockery/mockery": "^1.2", - "phpunit/phpunit": "^7.5", + "phpunit/phpunit": "^7.5 | ^8.5", "victorjonsson/markdowndocs": "^1.3" }, "autoload": { diff --git a/phpunit.xml b/phpunit.xml index cee98c8..e6270c1 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -19,4 +19,8 @@ src/ + + + + \ No newline at end of file diff --git a/tests/CompareTest.php b/tests/CompareTest.php index de39b3e..fb0e3e7 100644 --- a/tests/CompareTest.php +++ b/tests/CompareTest.php @@ -30,7 +30,7 @@ class CompareTest extends TestCase /** * {@inheritdoc} */ - public function setup() + public function setup(): void { parent::setup(); @@ -61,7 +61,7 @@ public function setup() /** * {@inheritdoc} */ - public function tearDown() + public function tearDown(): void { Mockery::close(); } diff --git a/tests/DictionaryTest.php b/tests/DictionaryTest.php index 534e9d0..520a38e 100644 --- a/tests/DictionaryTest.php +++ b/tests/DictionaryTest.php @@ -26,7 +26,7 @@ class DictionaryTest extends TestCase protected $locator; - public function setUp() + public function setUp(): void { $this->basePath = __DIR__.'/data/dictionary'; $this->locator = new ResourceLocator($this->basePath); @@ -34,7 +34,7 @@ public function setUp() $this->locator->registerStream('locale', '', null, true); } - public function tearDown() + public function tearDown(): void { Mockery::close(); } diff --git a/tests/LocaleTest.php b/tests/LocaleTest.php index b4854b3..3e9f0b0 100644 --- a/tests/LocaleTest.php +++ b/tests/LocaleTest.php @@ -24,7 +24,7 @@ class LocaleTest extends TestCase /** @var ResourceLocator */ protected $locator; - public function setUp() + public function setUp(): void { $this->basePath = __DIR__.'/data/sprinkles'; $this->locator = new ResourceLocator($this->basePath); diff --git a/tests/TranslatorTest.php b/tests/TranslatorTest.php index 645733a..d8b4955 100644 --- a/tests/TranslatorTest.php +++ b/tests/TranslatorTest.php @@ -24,7 +24,7 @@ class TranslatorTest extends TestCase /** @var ResourceLocator */ protected $locator; - public function setUp() + public function setUp(): void { $this->locator = new ResourceLocator($this->basePath);