-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
150 lines (139 loc) · 3.38 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# set the default docker image
image: registry.gitlab.com/tjvb/phpimages:php83
stages:
- prepare # prepare the cache
- check # check the codestyles
- test
- report
prepare_cache:
stage: prepare
script:
- composer validate
- composer install
# we use this artifact for all the jobs
artifacts:
name: "vendor"
paths:
- vendor/*
lint:
stage: check
script:
# lint recursive
- find src/ -type f -name '*.php' -exec php -l {} \; | (! grep -v "No syntax errors detected" )
dependencies: []
phpstan:
stage: check
script:
# check for phpstan errors
- php -d memory_limit=500M vendor/bin/phpstan analyse --error-format=gitlab | tee phpstan.json
- cat phpstan.json
dependencies:
- prepare_cache
needs:
- prepare_cache
artifacts:
paths:
- phpstan.json
reports:
codequality: phpstan.json
when: always
phpmd:
stage: check
script:
- composer phpmd
dependencies:
- prepare_cache
needs:
- prepare_cache
code-style:
stage: check
script:
- vendor/bin/ecs
dependencies:
- prepare_cache
needs:
- prepare_cache
# We check the content with vale
vale:
image:
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/jdkato/vale
entrypoint: [""]
stage: check
script:
- /bin/vale --config=tools/vale/.vale.ini README.md CONTRIBUTING.md
needs: []
dependencies: []
infection:
image: registry.gitlab.com/tjvb/phpimages:php83
stage: test
script:
- composer install
- vendor/bin/phpunit --migrate-configuration
- vendor/bin/infection
dependencies:
- prepare_cache
needs:
- prepare_cache
artifacts:
paths:
- build/infection.log
when: always
test_lowest:
stage: test
image: registry.gitlab.com/tjvb/phpimages:php80
script:
# Install composer
- rm -f composer.lock
- composer update --prefer-lowest
- vendor/bin/phpunit --coverage-text --colors=never --log-junit=phpunitresult/junit.xml
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
artifacts:
reports:
junit: phpunitresult/junit.xml
dependencies:
- prepare_cache
needs:
- prepare_cache
test:
parallel:
matrix:
- LARAVEL: 9
TESTBENCH: 7
PHP:
- 80
- 81
- 82
- 83
- LARAVEL: 10
TESTBENCH: 8
PHP:
- 81
- 82
- 83
- LARAVEL: 11
TESTBENCH: 9
PHP:
- 82
- 83
- 84
image: registry.gitlab.com/tjvb/phpimages:php$PHP
stage: test
script:
- echo "Laravel $LARAVEL"
- echo "PHP $PHP"
- echo "TESTBENCH $TESTBENCH"
- composer require --dev "orchestra/testbench=^$TESTBENCH"
- vendor/bin/phpunit --migrate-configuration || true
- XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --colors=never --coverage-cobertura=phpunitresult/cobertura-coverage.xml --log-junit=phpunitresult/junit.xml
- sed -i 's~ filename="~ filename="src/~' phpunitresult/cobertura-coverage.xml
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
artifacts:
reports:
junit: phpunitresult/junit.xml
coverage_report:
coverage_format: cobertura
path: phpunitresult/cobertura-coverage.xml
needs:
- prepare_cache
dependencies:
- prepare_cache