-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
73 lines (65 loc) · 1.43 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
stages:
- build
- tests
- badges
include:
- template: Composer.gitlab-ci.yml
variables:
PHP_IMAGE: composer:latest
PYTHON_IMAGE: python:3.6.15
.template-qa-step:
stage: tests
image: ${PHP_IMAGE}
timeout: 5m
variables:
QA_TOOL: ${CI_JOB_NAME}
STATUS: 0
before_script:
- composer install -o --ignore-platform-reqs
- echo "QA_TOOL_STATUS=failed" > ${QA_TOOL}.env
after_script:
- if [[ -f SUCCESS ]]; then echo "QA_TOOL_STATUS=success" > ${QA_TOOL}.env; fi
artifacts:
reports:
dotenv: ${QA_TOOL}.env
when: always
expire_in: 1 day
phpstan:
extends: .template-qa-step
script:
- vendor/bin/phpstan analyse ./src ./tests -l 8
- touch SUCCESS
code-sniffer:
extends: .template-qa-step
script:
- vendor/bin/phpcs src/ tests/ --standard=./config/codesniffer_ruleset.xml -p
- touch SUCCESS
.template-create-badge:
stage: badges
image: ${PYTHON_IMAGE}
variables:
COLOR: green
before_script:
- pip install anybadge
script:
- anybadge -l ${QA_TOOL} -v ${QA_TOOL_STATUS} -c ${COLOR} -f ${QA_TOOL}.svg
artifacts:
paths:
- ${QA_TOOL}.svg
when: always
expire_in: 4 weeks
when: always
only:
- main
badge_phpstan:
extends: .template-create-badge
variables:
QA_TOOL: phpstan
dependencies:
- phpstan
badge_codesniffer:
extends: .template-create-badge
variables:
QA_TOOL: code-sniffer
dependencies:
- code-sniffer