forked from phalcon/vokuro
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (82 loc) · 3.21 KB
/
validations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Testing Suite
on: [push, pull_request]
env:
DB_HOST: '127.0.0.1'
jobs:
run:
runs-on: ubuntu-latest
name: Workflow - PHP-${{ matrix.php }}
services:
mysql:
image: mysql:5.7
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: secret
MYSQL_USER: phalcon
MYSQL_DATABASE: vokuro
MYSQL_PASSWORD: secret
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1']
steps:
- uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
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
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- 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: Env file
if: always()
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)