Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5 Prep #165

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/.env.test → .ci/.env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DB_ADAPTER=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=
DB_PASSWORD=secret
DB_NAME=vokuro

MAIL_FROM_NAME=Vokuro
Expand All @@ -22,4 +22,4 @@ MAIL_SMTP_USERNAME=
MAIL_SMTP_PASSWORD=

CODECEPTION_URL=127.0.0.1
CODECEPTION_PORT=8888
CODECEPTION_PORT=80
6 changes: 3 additions & 3 deletions .env.example → .ci/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ APP_PUBLIC_URL=dev.vokuro.phalcon.io
# - sqlite
# - pgsql
DB_ADAPTER=mysql
DB_HOST=127.0.0.1
DB_HOST=vokuro-mysql
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=
DB_NAME=vokuro
DB_PASSWORD=secret
DB_NAME=phalcon_vokuro

MAIL_FROM_NAME=Vokuro
[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .ci/create-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

set -e

: "${DB_NAME:=vokuro}"
: "${DB_NAME:=phalcon_vokuro}"

case "$DB_ADAPTER" in
"mysql")
Expand Down
34 changes: 0 additions & 34 deletions .ci/install-phalcon.sh

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/docker-build.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/docker-build.yml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build Vokuro image 8.0
run: docker build -t phalconphp/vokuro:5.0.0-8.0 -f docker/8.0/Dockerfile .

- name: Build Vokuro image 8.1
run: docker build -t phalconphp/vokuro:5.0.0-8.1 -f docker/8.1/Dockerfile .
133 changes: 72 additions & 61 deletions .github/workflows/validations.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,99 @@
name: "Validations"
on: [push, pull_request]
jobs:
validate-code-style:
name: PSR-12 Code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Validate composer.json and composer.lock
run: composer validate
name: Testing Suite

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
on: [push, pull_request]

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
env:
DB_HOST: '127.0.0.1'

- name: Install PHP_CodeSniffer composer package
run: composer global require "squizlabs/php_codesniffer=*"
jobs:
run:
runs-on: ubuntu-latest
name: Workflow - PHP-${{ matrix.php }}

- name: Validate PSR-12 Code Style
run: ~/.composer/vendor/bin/phpcs
services:
mysql:
image: mysql:5.7
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: secret
MYSQL_USER: phalcon
MYSQL_DATABASE: vokuro
MYSQL_PASSWORD: secret

validate-code-static:
name: Static Code with PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
env:
extensions: mbstring, intl, json, psr, phalcon-4.0.5
key: cache-v2.0~14.05.2020
needs: validate-code-style
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
php: ['8.0', '8.1']

steps:
- name: Checkout the code
uses: actions/checkout@v1

- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
php-version: ${{ matrix.php }}
tools: pecl
extensions: mbstring, intl, json, phalcon-5.0.1
coverage: xdebug

- name: Init Database
run: |
mysql -uroot -h127.0.0.1 -psecret -e 'CREATE DATABASE IF NOT EXISTS `vokuro`;'

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-

- name: Install Composer dependencies with PHPStan
run: composer require --prefer-dist --no-progress --no-suggest --dev phpstan/phpstan
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run PHPCS
if: always()
run: vendor/bin/phpcs

- name: Run Psalm
if: always()
run: vendor/bin/psalm --show-info=false

- name: Run PHPStan
- name: Env file
if: always()
run: vendor/bin/phpstan analyse -l 5 src
run: cp -v ./.ci/.env.ci ./.env

# - name: Run migrations
# if: always()
# run: |
# vendor/bin/phinx migrate
#
# - name: Run seeds
# if: always()
# run: |
# vendor/bin/phinx seed:run

- name: Run tests
if: always()
run: |
sudo php -S 0.0.0.0 -t ./.htrouter.php &
vendor/bin/codecept build
vendor/bin/codecept run unit --coverage-xml=unit-coverage.xml
# vendor/bin/codecept run functional --coverage-xml=functional-coverage.xml
# vendor/bin/codecept run acceptance --coverage-xml=acceptance-coverage.xml

# - name: Upload to codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
# directory: ./tests/_output/
# files: unit-coverage.xml,functional-coverage.xml,acceptance-coverage.xml
# name: codecov-umbrella # optional
# fail_ci_if_error: false
# verbose: true # optional (default = false)
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ Thanks.

To run this application on your machine, you need at least:

* PHP >= 7.2
* Phalcon >= 4.0
* PHP >= 7.4
* Phalcon >= 5.0
* MySQL >= 5.5
* Apache Web Server with `mod_rewrite enabled`, and `AllowOverride Options` (or `All`) in your `httpd.conf` or Nginx Web Server
* Latest [Phalcon Framework](https://github.com/phalcon/cphalcon) extension installed/enabled

### Install Vökuró via composer create-project

```bash
composer create-project phalcon/vokuro /path/to/vokuro-folder "4.1.2" --prefer-dist
composer create-project phalcon/vokuro /path/to/vokuro-folder "5.0.0" --prefer-dist
```

### Installing Dependencies via Composer
Expand All @@ -44,7 +44,7 @@ Run the composer installer:
```bash
cd vokuro
composer install
cp .env.example .env
cp ./.ci/.env.example .env
vendor/bin/phinx migrate
vendor/bin/phinx seed:run
```
Expand All @@ -64,11 +64,11 @@ If you wish to check older versions or newer ones currently under development, p

Phalcon is an open source project and a volunteer effort.
Vökuró does not have human resources fully dedicated to the maintenance of this software.
If you want something to be improved or you want a new feature please submit a Pull Request.
If you want something to be improved, or you want a new feature please submit a Pull Request.

## Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)]
Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)]

<a href="https://opencollective.com/phalcon/#contributors">
<img src="https://opencollective.com/phalcon/tiers/sponsors.svg?avatarHeight=48&width=800" alt="sponsors">
Expand Down
2 changes: 1 addition & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extensions:

# Get params from .env file
params:
- tests/.env.test
- .env

error_level: "E_ALL"

Expand Down
Loading