@@ -3,7 +3,7 @@ name: "Tests"
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
- run-tests :
6
+ run-tests-php7 :
7
7
name : PHP ${{ matrix.php-versions }}
8
8
runs-on : ubuntu-latest
9
9
env :
29
29
php-versions : ['7.3', '7.4']
30
30
steps :
31
31
- uses : actions/checkout@v1
32
+ - name : Setup cache environment
33
+ id : cache-env
34
+ uses : shivammathur/cache-extensions@v1
35
+ with :
36
+ php-version : ${{ matrix.php-versions }}
37
+ extensions : ${{ env.extensions }}
38
+ key : ${{ env.key }}
39
+
40
+ - name : Cache extensions
41
+ uses : actions/cache@v1
42
+ with :
43
+ path : ${{ steps.cache-env.outputs.dir }}
44
+ key : ${{ steps.cache-env.outputs.key }}
45
+ restore-keys : ${{ steps.cache-env.outputs.key }}
46
+
47
+ - name : Setup PHP
48
+ uses : shivammathur/setup-php@v2
49
+ with :
50
+ php-version : ${{ matrix.php-versions }}
51
+ extensions : ${{ env.extensions }}
52
+ tools : pecl
53
+
54
+ - name : Get Composer Cache Directory
55
+ id : composer-cache
56
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
57
+
58
+ - name : Cache composer dependencies
59
+ uses : actions/cache@v1
60
+ with :
61
+ path : ${{ steps.composer-cache.outputs.dir }}
62
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
63
+ restore-keys : ${{ runner.os }}-composer-
64
+
65
+ - name : Install Composer dependencies
66
+ run : composer install --prefer-dist --no-suggest
67
+
68
+ - name : Copy .env file
69
+ run : cp tests/.env.example tests/.env
32
70
71
+ - name : Run test suites
72
+ env :
73
+ MYSQL_TEST_DB_PORT : ${{ job.services.mysql.ports['3306'] }}
74
+ POSTGRES_TEST_DB_PORT : ${{ job.services.postgres.ports['5432'] }}
75
+ if : success()
76
+ run : vendor/bin/codecept run --coverage-xml=coverage-${{ matrix.php-versions }}.xml
77
+
78
+ - name : Upload coverage to Codecov
79
+ if : success()
80
+ uses : codecov/codecov-action@v1
81
+ with :
82
+ token : ${{secrets.CODECOV_TOKEN}}
83
+ file : ./tests/_output/coverage-*.xml
84
+
85
+ run-tests-php8 :
86
+ name : PHP ${{ matrix.php-versions }}
87
+ runs-on : ubuntu-latest
88
+ env :
89
+ extensions : mbstring, intl, json, psr, phalcon-5.0.0alpha3, mysql, pgsql, xdebug
90
+ key : cache-v2.0~19.03.2020
91
+ services :
92
+ mysql :
93
+ image : mysql:5.7
94
+ env :
95
+ MYSQL_DATABASE : phalcon-migrations
96
+ MYSQL_ROOT_PASSWORD : root
97
+ ports :
98
+ - 3306/tcp
99
+ options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
100
+ postgres :
101
+ image : postgres:10.8
102
+ ports :
103
+ - 5432/tcp
104
+ options : --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 2
105
+ strategy :
106
+ fail-fast : false
107
+ matrix :
108
+ php-versions : ['8.0']
109
+ steps :
110
+ - uses : actions/checkout@v1
33
111
- name : Setup cache environment
34
112
id : cache-env
35
113
uses : shivammathur/cache-extensions@v1
0 commit comments