-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pcit.yml
155 lines (137 loc) · 3.4 KB
/
.pcit.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#
# @see https://github.com/khs1994-php/pcit/blob/master/docs/SUMMARY.md
#
# cache:
# directories:
# - cache
workspace:
base: /app
# path: .
path: src
steps:
# install dep
install:
# image: composer:${COMPOSER_VERSION}
image: khs1994/php:8.3.0-composer-alpine
shell: bash
run:
- pwd
- composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
# 由于 composer 镜像缺少某些扩展,故忽略这些
- composer install -q --ignore-platform-reqs
# - composer update -q --ignore-platform-reqs
# test script
script:
image: khs1994/php:${PHP_VERSION}-fpm-alpine
pull: true
shell: bash
env:
- CI_REDIS_HOST=redis
- CI_REDIS_PORT=6379
- CI_MYSQL_HOST=mysql
- CI_MYSQL_PORT=3306
- CI_MYSQL_USERNAME=root
- CI_MYSQL_PASSWORD=mytest
- CI_MYSQL_DBNAME=test
run:
- pwd
- mv ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini.default ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini
# 服务初始化需要时间,这里延迟执行
- sleep 30
- vendor/bin/phpunit --coverage-clover=coverage.xml
with:
# platform: linux/amd64
# platform: [ linux/*, windows/amd64 ]
# status: changed
# status: [ failure, success ]
# event: tag
# event: [push, pull_request, tag, deployment]
event: [push, pull_request, tag]
# branch: master
# branch: prefix/*
# branch: [master, develop]
# branch:
# include: [ master, release/* ]
# exclude: [ release/1.0.0, release/1.1.* ]
# when tag push build docker image
publish_php:
image: pcit/docker
# registry: docker.khs1994.com
with:
repo: khs1994/php
tags: ${PHP_VERSION}-pro-${CI_TAG}-alpine
# target: php
build_args:
- key=value
# dockerfile: Dockerfile
# dockerfile: path/to/Dockerfile
username: ${DOCKER_USERNAME}
password: ${DOCKER_PASSWORD}
if:
event: tag
after_success:
image: khs1994/php:8.3.0-composer-alpine
shell: bash
if:
status: success
run:
# please set env CODECOV_TOKEN=XXX
- bash <(curl -s https://codecov.io/bash)
after_failure:
image: bash
if:
status: failure
run:
- echo "build failure"
changed:
image: bash
if:
status: changed
run:
- echo "build status changed"
services:
mysql:
image: mysql:${MYSQL_VERSION}
env:
- MYSQL_DATABASE=test
- MYSQL_ROOT_PASSWORD=mytest
# entrypoint: [ "mysqld" ]
command: [ "--character-set-server=utf8mb4", "--default-authentication-plugin=mysql_native_password" ]
# postgresql:
# image: postgres:${POSTGRESQL_VERSION}
# environment:
# - POSTGRES_USER=postgres
# - POSTGRES_DB=test
redis:
image: redis:${REDIS_VERSION}-alpine
command: ["--bind", "0.0.0.0"]
# mongodb:
# image: mongo:${MONGODB_VERSION}
# command: [ --smallfiles ]
jobs:
COMPOSER_VERSION:
- 2.5.8
PHP_VERSION:
- 8.3.0
- 8.1.26
- 8.0.30
# - 7.4.33
# - 7.3.33
# - 7.2.34
# - 7.1.33
# - 7.0.33
# - 5.6.40
NGINX_VERSION:
- 1.17.0
REDIS_VERSION:
- 7.0.0
MYSQL_VERSION:
# - 8.0.21
- 5.7.22
MONGODB_VERSION:
- 3.7.3
POSTGRESQL_VERSION:
- 10.3-alpine
# branches:
# include: [ master, dev, feature/* ]
# exclude: [ release/1.0.0, release/1.1.* ]