@@ -2,58 +2,76 @@ name: Testing Suite
2
2
on : [push, pull_request]
3
3
4
4
jobs :
5
- build-and-test-linux :
6
- services :
7
- mongodb :
8
- image : mongo:4.2
9
- ports :
10
- - 27017:27017
11
- runs-on : ${{ matrix.operating-system }}
12
- strategy :
13
- fail-fast : false
14
- matrix :
15
- operating-system : [ubuntu-latest]
16
- php-versions : ['7.4']
17
-
18
- name : PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
19
- steps :
20
-
21
- - name : Git checkout
22
- uses : actions/checkout@v2-beta
23
- with :
24
- fetch-depth : 1
25
-
26
- - name : Get Composer Cache Directory
27
- id : composer-cache
28
- run : |
29
- echo "::set-output name=dir::$(composer config cache-files-dir)"
30
- - name : Setup Cache
31
- uses : actions/cache@v1
32
- with :
33
- path : ${{ steps.composer-cache.outputs.dir }}
34
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
35
- restore-keys : |
36
- ${{ runner.os }}-composer-
37
- - name : Setup Composer Token
38
- run : |
39
- # To increase the Composer rate limit we're use GitHub authentication
40
- if [ -n "${{ secrets.COMPOSER_TOKEN }}" ]; then
41
- composer config github-oauth.github.com "${{ secrets.COMPOSER_TOKEN }}"
42
- fi
43
- - name : Setup PHP
44
- uses : shivammathur/setup-php@v1
45
- with :
46
- php-version : ${{ matrix.php-versions }}
47
- ini-values : apc.enable_cli=on, session.save_path=/tmp
48
- tools : pecl
49
- extensions : mbstring, intl, json, imagick, phalcon
50
-
51
- - name : Install packages
52
- run : composer install --prefer-dist
53
-
54
- - name : Setup tests
55
- run : |
56
- cp tests/_ci/.env.default .env
57
- vendor/bin/codecept build
58
- - name : Run integration tests
59
- run : vendor/bin/codecept run --ext DotReporter integration --coverage --coverage-xml
5
+ run-tests :
6
+ name : PHP ${{ matrix.php-versions }} with Phalcon ${{ matrix.phalcon-versions }}
7
+ runs-on : ubuntu-latest
8
+ env :
9
+ extensions : mbstring, intl, json, phalcon-${{ matrix.phalcon-versions }}, xdebug
10
+ key : cache-v0.0.2
11
+ services :
12
+ mongodb :
13
+ image : mongo:4.2
14
+ ports :
15
+ - 27017:27017
16
+ strategy :
17
+ fail-fast : false
18
+ matrix :
19
+ php-versions : ['7.2', '7.3', '7.4']
20
+ # There is no 4.1.1 version due release bug
21
+ phalcon-versions : ['4.0.5', '4.0.6', '4.1.0', '4.1.2']
22
+ steps :
23
+ - uses : actions/checkout@v1
24
+ - name : Setup cache environment
25
+ id : cache-env
26
+ uses : shivammathur/cache-extensions@v1
27
+ with :
28
+ php-version : ${{ matrix.php-versions }}
29
+ extensions : ${{ env.extensions }}
30
+ key : ${{ env.key }}
31
+
32
+ - name : Cache extensions
33
+ uses : actions/cache@v1
34
+ with :
35
+ path : ${{ steps.cache-env.outputs.dir }}
36
+ key : ${{ steps.cache-env.outputs.key }}
37
+ restore-keys : ${{ steps.cache-env.outputs.key }}
38
+
39
+ - name : Setup PHP
40
+ uses : shivammathur/setup-php@v2
41
+ with :
42
+ php-version : ${{ matrix.php-versions }}
43
+ extensions : ${{ env.extensions }}
44
+ tools : pecl
45
+ ini-values : apc.enable_cli=on, session.save_path=/tmp
46
+
47
+ - name : Get Composer Cache Directory
48
+ id : composer-cache
49
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
50
+
51
+ - name : Cache composer dependencies
52
+ uses : actions/cache@v1
53
+ with :
54
+ path : ${{ steps.composer-cache.outputs.dir }}
55
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
56
+ restore-keys : ${{ runner.os }}-composer-
57
+
58
+ - name : Install Composer dependencies
59
+ run : composer install --prefer-dist --no-suggest
60
+
61
+ - name : Copy .env file
62
+ run : cp tests/_ci/.env.default .env
63
+
64
+ - name : Setup tests
65
+ if : success()
66
+ run : vendor/bin/codecept build
67
+
68
+ - name : Run integration tests
69
+ if : success()
70
+ run : vendor/bin/codecept run --ext DotReporter integration --coverage --coverage-xml=coverage-${{ matrix.php-versions }}.xml
71
+
72
+ - name : Upload coverage to Codecov
73
+ if : success()
74
+ uses : codecov/codecov-action@v1
75
+ with :
76
+ token : ${{secrets.CODECOV_TOKEN}}
77
+ file : ./tests/_output/coverage-*.xml
0 commit comments