-
-
Notifications
You must be signed in to change notification settings - Fork 8
99 lines (83 loc) · 3.08 KB
/
main.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
99
name: Tests & Validations
on: [ push ]
jobs:
validations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl, json, mongodb, phalcon-5.4.0, xdebug
tools: pecl
ini-values: apc.enable_cli=on, session.save_path=/tmp
- run: composer install --no-interaction --no-ansi --no-progress
- name: run psalm
if: always()
run: vendor/bin/psalm
- name: run phpcs
run: vendor/bin/phpcs
run-tests:
name: PHP ${{ matrix.php-versions }} with Phalcon ${{ matrix.phalcon-versions }}
runs-on: ubuntu-latest
env:
extensions: mbstring, intl, json, mongodb, phalcon-${{ matrix.phalcon-versions }}, xdebug
key: cache-${{ matrix.phalcon-versions }}-${{ matrix.php-versions }}
services:
mongodb:
image: mongo
ports:
- 27017:27017
strategy:
fail-fast: false
matrix:
php-versions: [ '7.4', '8.0', '8.1', '8.2' ]
phalcon-versions: [ '5.0.0', '5.0.1', '5.0.2', '5.0.3', '5.0.4', '5.0.5', '5.1.0', '5.1.1', '5.1.2', '5.1.3', '5.1.4', '5.2.0', '5.2.1', '5.2.2', '5.3.0', '5.3.1', '5.4.0' ]
steps:
- uses: actions/checkout@v3
- 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 }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
tools: pecl
ini-values: apc.enable_cli=on, session.save_path=/tmp
- 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
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --prefer-dist
- name: Copy .env file
run: cp tests/_ci/.env.default .env
- name: Setup tests
if: success()
run: vendor/bin/codecept build
- name: Run integration tests
if: success()
run: vendor/bin/codecept run --ext DotReporter integration --coverage --coverage-xml=coverage-${{ matrix.php-versions }}.xml
- name: Upload coverage to Codecov
if: success()
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./tests/_output/coverage-*.xml