This repository was archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
112 lines (104 loc) · 2.39 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
# set the default docker image
image: registry.gitlab.com/tjvb/phpimages:php74
default:
interruptible: true
stages:
- prepare # prepare the cache
- check # check the code styles
- test
prepare_cache:
stage: prepare
script:
- composer validate
- COMPOSER_MEMORY_LIMIT=-1 composer update
# 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" )
needs: []
dependencies: []
phpcs:
stage: check
script:
- vendor/bin/phpcs
needs:
- prepare_cache
dependencies:
- prepare_cache
phpmd:
stage: check
script:
- vendor/bin/phpmd src/ text phpmd.xml.dist
needs:
- prepare_cache
dependencies:
- prepare_cache
test_lowest:
stage: test
script:
# Install composer
- rm -f composer.lock
- COMPOSER_MEMORY_LIMIT=-1 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
needs:
- prepare_cache
dependencies:
- prepare_cache
test:
stage: test
parallel:
matrix:
- LARAVEL: 7
TESTBENCH: 5
PHP:
- 74
- LARAVEL: 8
TESTBENCH: 6
PHP:
- 74
- 80
- 81
- 82
- 83
- LARAVEL: 9
TESTBENCH: 7
PHP:
- 80
- 81
- 82
- 83
- LARAVEL: 10
TESTBENCH: 8
PHP:
- 81
- 82
- 83
image: registry.gitlab.com/tjvb/phpimages:php$PHP
script:
- echo "Laravel $LARAVEL"
- echo "PHP $PHP"
- echo "TESTBENCH $TESTBENCH"
- composer require -w --dev orchestra/testbench=^$TESTBENCH
- 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