diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml new file mode 100644 index 000000000..0275b540b --- /dev/null +++ b/.github/workflows/Build.yml @@ -0,0 +1,345 @@ +name: Build + +on: + push: + branches: ['*'] + pull_request: + branches: ['*'] + schedule: + - cron: "0 0 * * 5" + +jobs: + PHPUnit-MySQL: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + runs-on: ubuntu-latest + name: PHPUnit - PHP ${{ matrix.php_versions }} - MySQL + + env: + TEST_DB: default + UF_MODE: debug + DB_DRIVER: mysql + DB_HOST: 127.0.0.1 + DB_USER: userfrosting + DB_PASSWORD: password + DB_NAME: userfrosting + DB_PORT: 3306 + + 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, memcached, redis, pdo_sqlite + coverage: xdebug + tools: pecl, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: 10 + + - name: Setup Redis-server + uses: supercharge/redis-github-action@1.1.0 + with: + redis-version: 6 + + - name: Setup Memcached + uses: niden/actions-memcached@v7 + + - name: Shutdown Ubuntu MySQL (SUDO) + run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it + + - name: Set up MySQL (PHP <= 7.3 -> MySQL 5) + if: ${{ matrix.php_versions != 7.4 }} + uses: mirromutth/mysql-action@v1.1 + with: + mysql version: '5' + mysql database: 'userfrosting' + mysql user: 'userfrosting' + mysql password: 'password' + + - name: Set up MySQL (PHP >= 7.4 -> MySQL 8) + if: ${{ matrix.php_versions == 7.4 }} + uses: mirromutth/mysql-action@v1.1 + with: + mysql version: '8' + mysql database: 'userfrosting' + mysql user: 'userfrosting' + mysql password: 'password' + + - name: Wait for MySQL + run: | + while ! mysqladmin ping --host=127.0.0.1 --password=password --silent; do + sleep 1 + done + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Bakery Debug + run: php bakery debug + + - name: Migrate DB + run: php bakery migrate + + - name: Build Assets + run: php bakery build-assets + + - name: Execute tests + run: app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + if: github.event_name != 'schedule' + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + + PHPUnit-SQLite: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + runs-on: ubuntu-latest + name: PHPUnit - PHP ${{ matrix.php_versions }} - SQLite + + env: + TEST_DB: default + UF_MODE: debug + DB_DRIVER: sqlite + DB_NAME: database/database.sqlite + + 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, memcached, redis, pdo_sqlite + coverage: xdebug + tools: pecl, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: 10 + + - name: Setup Redis-server + uses: supercharge/redis-github-action@1.1.0 + with: + redis-version: 6 + + - name: Setup Memcached + uses: niden/actions-memcached@v7 + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Create SQLite Database + run: | + mkdir -p database + touch database/database.sqlite + + - name: Bakery Debug + run: php bakery debug + + - name: Migrate DB + run: php bakery migrate + + - name: Build Assets + run: php bakery build-assets + + - name: Execute tests + run: app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + if: github.event_name != 'schedule' + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + + PHPUnit-Postgre: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + runs-on: ubuntu-latest + name: PHPUnit - PHP ${{ matrix.php_versions }} - PostgreSQL + + env: + TEST_DB: default + UF_MODE: debug + DB_DRIVER: pgsql + DB_HOST: 127.0.0.1 + DB_USER: userfrosting + DB_PASSWORD: password + DB_NAME: userfrosting + DB_PORT: 5432 + + 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, memcached, redis, pdo_sqlite, pdo_pgsql + coverage: xdebug + tools: pecl, composer:v1 + + - name: Setup PostgreSQL + uses: harmon758/postgresql-action@v1 + with: + postgresql db: 'userfrosting' + postgresql user: 'userfrosting' + postgresql password: 'password' + + - uses: actions/setup-node@v2 + with: + node-version: 10 + + - name: Setup Redis-server + uses: supercharge/redis-github-action@1.1.0 + with: + redis-version: 6 + + - name: Setup Memcached + uses: niden/actions-memcached@v7 + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Bakery Debug + run: php bakery debug + + - name: Migrate DB + run: php bakery migrate + + - name: Build Assets + run: php bakery build-assets + + - name: Execute tests + run: app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + if: github.event_name != 'schedule' + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + + PHPUnit-Windows: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + runs-on: windows-latest + name: PHPUnit - PHP ${{ matrix.php_versions }} - Windows + + env: + TEST_DB: default + UF_MODE: debug + DB_DRIVER: sqlite + DB_NAME: database/database.sqlite + + 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, pdo, sqlite, pdo_sqlite + coverage: xdebug + tools: pecl, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: 10 + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Create SQLite Database + run: | + mkdir -p database + touch database/database.sqlite + + - name: Bakery Debug + run: php bakery debug + + - name: Migrate DB + run: php bakery migrate + + - name: Build Assets + run: php bakery build-assets + + - name: Execute tests + run: app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + + Asset-Build: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.4'] + node_versions: ['10', '12', '14'] + os: [ubuntu-latest, windows-latest] + + runs-on: ${{ matrix.os }} + name: Assets Build - PHP ${{ matrix.php_versions }} - Node ${{ matrix.node_versions }} - ${{ matrix.os }} + + 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, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node_versions }} + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Execute build + run: php bakery build-assets \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e8eb42d2f..000000000 --- a/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -dist: xenial -language: php - -services: - - mysql - - postgresql - - memcached - - redis - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -env: - jobs: - - DB=mysql - - DB=sqlite - - DB=pgsql - - DB=memory - -jobs: - fast_finish: true - -cache: - directories: - - $HOME/.composer/cache - -before_install: - # Force use of Composer 1.x - - composer self-update --1 - # copy sprinkles.json - - cp app/sprinkles.example.json app/sprinkles.json - # set up db - - bash build/before_install.sh $DB - # update node - - nvm install 10.12.0 - # Install Redis and Memcached - - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - printf "\n" | pecl install -f redis - -before_script: - # install deps and UF - - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer install --no-interaction - - php bakery debug - - php bakery build-assets - - php bakery migrate - -script: - # run unit tests - - app/vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -after_failure: - - cat app/log/userfrosting.log diff --git a/CHANGELOG.md b/CHANGELOG.md index 093b9cdf2..9a312cb33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ 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). +## [v4.4.5] + +### Changed +- Replaced Travis with Github Actions +- Force Composer 1.0 for Docker ([#1126]) +- Update error.html.twig - add container ([#1128]) +- Update some tests +- Update Vagrant doc & config + ## [v4.4.4] ### Fixed @@ -983,6 +992,8 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x [#1107]: https://github.com/userfrosting/UserFrosting/pull/1107 [#1109]: https://github.com/userfrosting/UserFrosting/pull/1109 [#1114]: https://github.com/userfrosting/UserFrosting/pull/1114 +[#1126]: https://github.com/userfrosting/UserFrosting/pull/1126 +[#1128]: https://github.com/userfrosting/UserFrosting/pull/1128 [v4.2.0]: https://github.com/userfrosting/UserFrosting/compare/v4.1.22...v4.2.0 [v4.2.1]: https://github.com/userfrosting/UserFrosting/compare/v4.2.0...v.4.2.1 @@ -997,3 +1008,4 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x [v4.4.2]: https://github.com/userfrosting/UserFrosting/compare/v4.4.1...v4.4.2 [v4.4.3]: https://github.com/userfrosting/UserFrosting/compare/v4.4.2...v4.4.3 [v4.4.4]: https://github.com/userfrosting/UserFrosting/compare/v4.4.3...v4.4.4 +[v4.4.5]: https://github.com/userfrosting/UserFrosting/compare/v4.4.4...v4.4.5 diff --git a/README.md b/README.md index a0268dc83..b50f11f48 100644 --- a/README.md +++ b/README.md @@ -3,22 +3,22 @@ [![Latest Version](https://img.shields.io/github/release/userfrosting/UserFrosting.svg)](https://github.com/userfrosting/UserFrosting/releases) ![PHP Version](https://img.shields.io/packagist/php-v/userfrosting/userfrosting.svg?color=brightgreen) [![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) [![Backers on Open Collective](https://opencollective.com/userfrosting/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/userfrosting/sponsors/badge.svg)](#sponsors) [![Donate](https://img.shields.io/badge/Open%20Collective-Donate-blue.svg)](https://opencollective.com/userfrosting#backer) | Branch | Version | Build | Coverage | Style | | ------ |:-------:|:-----:|:--------:|:-----:| -| [master] | ![](https://img.shields.io/github/release/userfrosting/userfrosting.svg?color=success&label=Version) | [![](https://travis-ci.org/userfrosting/UserFrosting.svg?branch=master)][UF-Travis] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/master/graph/badge.svg)][UF-Codecov] | [![][style-master]][style] | -| [hotfix] | ![](https://img.shields.io/badge/Version-v4.4.x-yellow.svg) | [![](https://travis-ci.org/userfrosting/UserFrosting.svg?branch=hotfix)][UF-Travis] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/hotfix/graph/badge.svg)][UF-Codecov] | [![][style-hotfix]][style] | -| [develop] | ![](https://img.shields.io/badge/Version-v4.5.x-orange.svg) | [![](https://travis-ci.org/userfrosting/UserFrosting.svg?branch=develop)][UF-Travis] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/develop/graph/badge.svg)][UF-Codecov] | [![][style-develop]][style] | +| [master] | ![](https://img.shields.io/github/release/userfrosting/userfrosting.svg?color=success&label=Version) | [![](https://github.com/userfrosting/userfrosting/workflows/Build/badge.svg?branch=master)][UF-Build] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/master/graph/badge.svg)][UF-Codecov] | [![][style-master]][style] | +| [hotfix] | ![](https://img.shields.io/badge/Version-v4.4.x-yellow.svg) | [![](https://github.com/userfrosting/userfrosting/workflows/Build/badge.svg?branch=hotfix)][UF-Build] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/hotfix/graph/badge.svg)][UF-Codecov] | [![][style-hotfix]][style] | +| [develop] | ![](https://img.shields.io/badge/Version-v4.5.x-orange.svg) | [![](https://github.com/userfrosting/userfrosting/workflows/Build/badge.svg?branch=develop)][UF-Build] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/develop/graph/badge.svg)][UF-Codecov] | [![][style-develop]][style] | [master]: https://github.com/userfrosting/UserFrosting [hotfix]: https://github.com/userfrosting/UserFrosting/tree/hotfix [develop]: https://github.com/userfrosting/UserFrosting/tree/develop -[UF-Travis]: https://travis-ci.org/userfrosting/UserFrosting +[UF-Build]: https://github.com/userfrosting/userfrosting/actions?query=workflow%3ABuild [UF-Codecov]: https://codecov.io/gh/userfrosting/userfrosting [style-master]: https://github.styleci.io/repos/18148206/shield?branch=master&style=flat [style-hotfix]: https://github.styleci.io/repos/18148206/shield?branch=hotfix&style=flat diff --git a/app/defines.php b/app/defines.php index cbd11bdea..778df9d38 100755 --- a/app/defines.php +++ b/app/defines.php @@ -11,7 +11,7 @@ namespace UserFrosting; // Some standard defines -define('UserFrosting\VERSION', '4.4.4'); +define('UserFrosting\VERSION', '4.4.5'); define('UserFrosting\DS', '/'); define('UserFrosting\PHP_MIN_VERSION', '7.1'); define('UserFrosting\PHP_RECOMMENDED_VERSION', '7.3'); diff --git a/app/sprinkles/core/templates/pages/abstract/error.html.twig b/app/sprinkles/core/templates/pages/abstract/error.html.twig index a6da90c60..568ff3046 100644 --- a/app/sprinkles/core/templates/pages/abstract/error.html.twig +++ b/app/sprinkles/core/templates/pages/abstract/error.html.twig @@ -9,7 +9,7 @@