-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.gitlab-ci.yml
executable file
·104 lines (95 loc) · 2.29 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
variables:
FF_USE_FASTZIP: 1
COMPOSER_CACHE_DIR: ${CI_PROJECT_DIR}/.composer-cache
PHP_VERSION: '8.1'
default:
image: ${CI_REGISTRY}/connector/connector-utils/ci-docker/php/cli:${PHP_VERSION}
tags:
- docker
include:
- project: 'connector/connector-utils/CI-Templates'
file:
- 'auto-create-mr/ci.yaml'
stages:
- createMR
- build
- test
build:
stage: build
script:
- composer config http-basic.gitlab.jtl-software.com gitlab-ci-token "${CI_JOB_TOKEN}"
- composer install --no-progress --no-interaction
cache:
key:
files:
- composer.lock
- composer.json
paths:
- vendor/
artifacts:
paths:
- vendor/
random_files:
image: alpine:latest
stage: test
needs: []
script:
- >-
if [ `find . \( -name .idea -o -name .code -o -name .DS_Store \) -not -path "./vendor/*"` ] ; then
echo "Found .idea, .code or .DS_Store. Please remove them from your project.";
exit 1
fi
code_quality:
stage: test
needs:
- build
script:
- composer run phpcs:ci
artifacts:
paths:
- phpcs-quality-report.json
when: always
phpstan:
stage: test
needs:
- build
script:
- composer run phpstan:ci
artifacts:
paths:
- phpstan-quality-report.json
when: always
combine_reports:
stage: test
needs:
- code_quality
- phpstan
when: always
script:
- >-
if [[ -f phpcs-quality-report.json ]] && [[ -f phpstan-quality-report.json ]]; then
jq -s 'add' phpcs-quality-report.json phpstan-quality-report.json > codeclimate-quality-report.json;
elif [[ -f phpcs-quality-report.json ]]; then
mv phpcs-quality-report.json codeclimate-quality-report.json;
elif [[ -f phpstan-quality-report.json ]]; then
mv phpstan-quality-report.json codeclimate-quality-report.json;
fi
artifacts:
reports:
codequality: codeclimate-quality-report.json
when: always
tests:
stage: test
needs:
- build
allow_failure: true # there might be some timezone issues with the tests
parallel:
matrix:
- PHP_VERSION: ['8.1', '8.2', '8.3']
image: ${CI_REGISTRY}/connector/connector-utils/ci-docker/php/cli:${PHP_VERSION}
script:
- composer run tests:ci
artifacts:
reports:
junit: phpunit.xml
when: always