Skip to content

Commit

Permalink
Merge branch 'master' into fix/user-active
Browse files Browse the repository at this point in the history
  • Loading branch information
niden authored Nov 29, 2022
2 parents 9509607 + 241acd6 commit a2125ad
Show file tree
Hide file tree
Showing 89 changed files with 3,556 additions and 1,682 deletions.
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
DB_ADAPTER=Mysql
DB_HOST=localhost
DB_USERNAME=root
DB_PASSWORD=
DB_USERNAME=phalcon
DB_PASSWORD=secret
DB_DBNAME=invo
DB_CHARSET=utf8

VIEWS_DIR=themes/invo/
BASE_URI=/

APP_URL=http://127.0.0.1:8000
41 changes: 25 additions & 16 deletions .github/workflows/ci.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,31 @@ jobs:
services:
mysql:
image: mysql:5.7
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: root
steps:
- uses: actions/checkout@v1
MYSQL_ROOT_PASSWORD: secret
MYSQL_USER: phalcon
MYSQL_DATABASE: invo
MYSQL_PASSWORD: secret

- name: Init Database
run: |
mysql -uroot -h127.0.0.1 -proot -e 'CREATE DATABASE IF NOT EXISTS `invo`;'
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1' ]

steps:
- uses: actions/checkout@v3

- name: Copy .env file
run: cp .env.example .env

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
php-version: ${{ matrix.php }}
tools: pecl
extensions: mbstring, intl, json, phalcon4
extensions: mbstring, intl, json, phalcon-5.0.3
coverage: xdebug

- name: Validate composer.json and composer.lock
Expand All @@ -37,22 +44,24 @@ jobs:
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest

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

- name: Run tests
if: always()
run: |
sudo php -S 0.0.0.0:90 -t public/ &
sudo php -S 127.0.0.1:8000 -t public/ &
vendor/bin/codecept build
vendor/bin/codecept run acceptance
vendor/bin/codecept run unit --coverage-xml=unit-coverage.xml
vendor/bin/codecept run functional --coverage-xml=functional-coverage.xml
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v1.0.3
if: success()
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./tests/_output/*-coverage.xml
directory: ./tests/_output/
files: unit-coverage.xml,functional-coverage.xml
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ switch to the relevant branch.

### Requirements

* PHP >= 7.2
* PHP >= 7.4
* [Apache][2] Web Server with [mod_rewrite][3] enabled or [Nginx][4] Web Server
* Latest stable [Phalcon Framework release][5] extension enabled
* [MySQL][6] >= 5.5
* [MySQL][6] >= 5.7

### Installation

Expand All @@ -33,6 +33,30 @@ switch to the relevant branch.
3. Edit .env file with your DB connection information
4. Run DB migrations `vendor/bin/phalcon-migrations migration run --config=migrations.php`

If you do not have PHP installed on your machine or do not wish to install it, you
can run the application in a docker container. You will need [docker][9] and [docker-compose][10].

```shell
docker-compose up -d
```

will build and start your environment

```shell
docker exec -it invo-8.0 /bin/bash
```

will allow you to enter the environment and run the tests. There is also `invo-8.1`
as an option, if you wish to run an environment with PHP 8.1.

To see the dockerized invo in action run:

```shell
docker inspect invo-8.0
```
and make a note of the `IPAddress`. Type the address in your browser and you
will see the invo application in action.

## Contributing

See [CONTRIBUTING.md][7]
Expand Down Expand Up @@ -65,3 +89,5 @@ Invo is open-sourced software licensed under the [New BSD License][8]. © Phalco
[6]: https://www.mysql.com/
[7]: https://github.com/phalcon/invo/blob/master/CONTRIBUTING.md
[8]: https://github.com/phalcon/invo/blob/master/docs/LICENSE.md
[9]: https://docs.docker.com/engine/install/
[10]: https://docs.docker.com/compose/install/
3 changes: 3 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ coverage:
enabled: true
include:
- src/*
params:
# get params from environment vars
- .env
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@
}
],
"require": {
"php": ">=7.2",
"ext-phalcon": "^4.0.0",
"phalcon/migrations": "^1.1",
"vlucas/phpdotenv": "^4.0"
"php": ">=8.0",
"ext-phalcon": "^5.0.2",
"vlucas/phpdotenv": "^5.4"
},
"require-dev": {
"codeception/codeception": "^3.1",
"phalcon/ide-stubs": "^4.0.0",
"squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^3.6"
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "^4.27",
"codeception/codeception": "^5.0.0",
"codeception/module-phpbrowser": "^3.0",
"codeception/module-asserts": "^3.0",
"phalcon/ide-stubs": "^5.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit a2125ad

Please sign in to comment.