forked from FlowCI/templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp.yaml
51 lines (42 loc) · 1.04 KB
/
php.yaml
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
#
# PHP Project Template
#
envs:
FLOWCI_GIT_URL: "https://gitlab.com/gitlab-examples/php.git"
steps:
- name: clone
docker:
image: flowci/debian-git
plugin: 'gitclone'
- name: composer install
docker:
image: composer:2
bash: |
cd $FLOWCI_GIT_REPO
composer install
- name: unit test
dockers:
- image: php:7.4
is_runtime: true
- image: mysql:5.7
name: mysql
environment:
MYSQL_DATABASE: hello_world_test
MYSQL_ROOT_PASSWORD: mysql
bash: |
cd $FLOWCI_GIT_REPO
## install db driver
docker-php-ext-install pdo_mysql
## install phpunit test coverage driver
pecl install xdebug && docker-php-ext-enable xdebug
## make sure mysql is upon running
wait-for-it.sh mysql:3306 -t 30
## run phpunit
./vendor/bin/phpunit --configuration phpunit_mysql.xml --coverage-html reports
- name: upload report
docker:
image: ubuntu:18.04
envs:
REPORT_PATH: "${FLOWCI_GIT_REPO}/reports"
REPORT_NAME: "Code Coverage"
plugin: 'report-upload'