File tree Expand file tree Collapse file tree 4 files changed +71
-2
lines changed Expand file tree Collapse file tree 4 files changed +71
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ tags :
7
+ pull_request :
8
+
9
+ jobs :
10
+ build :
11
+ runs-on : ubuntu-latest
12
+ strategy :
13
+ matrix :
14
+ php : [7.1, 7.2, 7.3]
15
+ services :
16
+ mongo :
17
+ image : mongo
18
+ ports :
19
+ - 27017:27017
20
+ mysql :
21
+ image : mysql:5.7
22
+ ports :
23
+ - 3307:3306
24
+ env :
25
+ MYSQL_ALLOW_EMPTY_PASSWORD : ' yes'
26
+ MYSQL_DATABASE : ' unittest'
27
+ MYSQL_ROOT_PASSWORD :
28
+
29
+ steps :
30
+ - uses : actions/checkout@v1
31
+ - name : Show php version
32
+ run : php${{ matrix.php }} -v && composer -V
33
+ - name : Show docker and docker-compose versions
34
+ run : |
35
+ docker version
36
+ - name : Debug if needed
37
+ run : if [[ "$DEBUG" == "true" ]]; then env; fi
38
+ env :
39
+ DEBUG : ${{secrets.DEBUG}}
40
+ - name : Install dependencies
41
+ run : |
42
+ composer install --no-interaction
43
+ - name : Generating code coverage
44
+ run : |
45
+ mkdir -p build/logs
46
+ ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
47
+ env :
48
+ MONGO_HOST : 0.0.0.0
49
+ MYSQL_HOST : 0.0.0.0
50
+ MYSQL_PORT : 3307
51
+ - name : Send coveralls
52
+ run : vendor/bin/php-coveralls -v
53
+ env :
54
+ COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 29
29
"phpunit/phpunit" : " ^6.0|^7.0|^8.0" ,
30
30
"orchestra/testbench" : " ^3.1|^4.0" ,
31
31
"mockery/mockery" : " ^1.0" ,
32
- "satooshi/php-coveralls" : " ^2.0" ,
33
- "doctrine/dbal" : " ^2.5"
32
+ "php-coveralls/php-coveralls" : " dev-add-support-for-github-actions" ,
33
+ "doctrine/dbal" : " ^2.5" ,
34
+ "phpunit/phpcov" : " 5.0.0"
34
35
},
36
+ "repositories" : [
37
+ {
38
+ "type" : " vcs" ,
39
+ "url" : " https://github.com/Smolevich/php-coveralls"
40
+ }
41
+ ],
35
42
"autoload" : {
36
43
"psr-0" : {
37
44
"Jenssegers\\ Mongodb" : " src/"
Original file line number Diff line number Diff line change 40
40
<file >tests/ValidationTest.php</file >
41
41
</testsuite >
42
42
</testsuites >
43
+ <filter >
44
+ <whitelist processUncoveredFilesFromWhitelist =" true" >
45
+ <directory suffix =" .php" >./src</directory >
46
+ </whitelist >
47
+ </filter >
43
48
<php >
44
49
<env name =" MONGO_HOST" value =" mongodb" />
45
50
<env name =" MONGO_DATABASE" value =" unittest" />
46
51
<env name =" MONGO_PORT" value =" 27017" />
47
52
<env name =" MYSQL_HOST" value =" mysql" />
53
+ <env name =" MYSQL_PORT" value =" 3306" />
48
54
<env name =" MYSQL_DATABASE" value =" unittest" />
49
55
<env name =" MYSQL_USERNAME" value =" root" />
50
56
<env name =" QUEUE_CONNECTION" value =" database" />
Original file line number Diff line number Diff line change 2
2
3
3
$ mongoHost = env ('MONGO_HOST ' , 'mongodb ' );
4
4
$ mongoPort = env ('MONGO_PORT ' ) ? (int ) env ('MONGO_PORT ' ) : 27017 ;
5
+ $ mysqlPort = env ('MYSQL_PORT ' ) ? (int ) env ('MYSQL_PORT ' ) : 3306 ;
5
6
6
7
return [
7
8
23
24
'mysql ' => [
24
25
'driver ' => 'mysql ' ,
25
26
'host ' => env ('MYSQL_HOST ' , 'mysql ' ),
27
+ 'port ' => $ mysqlPort ,
26
28
'database ' => env ('MYSQL_DATABASE ' , 'unittest ' ),
27
29
'username ' => env ('MYSQL_USERNAME ' , 'root ' ),
28
30
'password ' => env ('MYSQL_PASSWORD ' , '' ),
You can’t perform that action at this time.
0 commit comments