-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
135 lines (126 loc) · 3.65 KB
/
.gitlab-ci.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
include:
remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml
.test-php-custom:
stage: test
variables:
PHP_VERSION: 8.0
image: ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev
cache:
key: "zmsbase"
paths:
- cache
script:
- $CLI_COMPOSER
- $CLI_PHPCS
- $CLI_PHPMD
- docker-php-ext-enable xdebug
- $CLI_PHPUNIT $CLI_PHPUNIT_PARAM
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
artifacts:
paths:
- public/_tests
expire_in: 7d
reports:
junit: public/_tests/junit.xml
test-php-80:
extends: .test-php-custom
allow_failure: true
services:
- name: mariadb:10.1
alias: mysql
command: ["mysqld", "--general-log=1", "--general-log-file=/var/log/mysql/general.log"]
before_script:
- $CLI_COMPOSER
- rm -rf data
- ln -s vendor/eappointment/zmsdb/tests/Zmsdb/fixtures data
- vendor/bin/importTestData --commit
variables:
PHP_VERSION: "8.0"
MYSQL_PORT: "tcp://mysql:3306"
MYSQL_DATABASE: zmsbo
MYSQL_ROOT_PASSWORD: zmsapi
only:
changes:
- .gitlab-ci.yml
- composer.lock
- composer.json
- schema/**/*
- templates/**/*
- src/**/*
- tests/**/*.{json,php}
#test-php-81:
# extends: .test-php
# allow_failure: true
# variables:
# PHP_VERSION: "8.1"
# only:
# changes:
# - .gitlab-ci.yml
# - composer.lock
# - composer.json
# - schema/**/*
# - templates/**/*
# - src/**/*
# - tests/**/*.{json,php}
outdated:
extends: .test-phpoutdated
apidoc:
stage: .pre
variables:
PHP_VERSION: "8.0"
image: ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev
before_script:
- $CLI_COMPOSER --no-scripts
- bin/configure
- npm install
artifacts:
paths:
- public
script:
- npm run build
- swagger-cli validate ./public/doc/swagger.yaml
- swagger-cli bundle -r -o ./public/doc/swagger.json ./public/doc/swagger.yaml
- wget -P ./public/doc/assets/ "https://rebilly.github.io/ReDoc/releases/v1.22.3/redoc.min.js"
- wget -P ./public/_test/assets/ "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.6.0/swagger-ui-bundle.js"
- wget -P ./public/_test/assets/ "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.6.0/swagger-ui.css"
- wget -P ./public/_test/assets/ "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.6.0/swagger-ui-standalone-preset.js"
- find public/
only:
changes:
- .gitlab-ci.yml
- composer.lock
- composer.json
- src/**/*
- tests/**/*.{json,php}
- routing.php
pages:
stage: deploy
needs:
- job: apidoc
artifacts: true
script:
- echo "/zmsapi/_tests/coverage/ /zmsapi/_tests/coverage/index.html 302" >> public/_redirects
- echo "/zmsapi/doc/ /zmsapi/public/doc/index.html 302" >> public/_redirects
- find public/
artifacts:
paths:
- public
only:
refs:
- main
changes:
- src/**/*
- tests/**/*.{json,php}
- routing.php
- .gitlab-ci.yml
environment:
name: analytics
url: https://eappointment.gitlab.io/zmsapi
build-docker:
extends: .build-docker
variables:
PHP_VERSION: "8.0"
only:
- tags
- main
- branches