-
Notifications
You must be signed in to change notification settings - Fork 17
/
.gitlab-ci.yml
105 lines (95 loc) · 2.57 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
variables:
DOCKER_IMAGE: '$IMAGE_URL'
image: '$DOCKER_IMAGE'
stages:
- lint
- test
- validate
- deploy
- release
lint php-parallel-lint:
stage: lint
before_script:
- composer config --no-plugins allow-plugins.php-http/discovery true
- composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader
script:
- ./vendor/bin/parallel-lint --exclude vendor/ .
lint php-cs-fixer:
stage: lint
before_script:
- composer config --no-plugins allow-plugins.php-http/discovery true
- composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader
script:
- ./vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no
lint phpstan:
stage: lint
before_script:
- composer config --no-plugins allow-plugins.php-http/discovery true
- composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader
script:
- ./vendor/bin/phpstan --no-progress --memory-limit="2G" --error-format=gitlab > phpstan-report.json || (cat phpstan-report.json && exit 1)
artifacts:
when: always
reports:
codequality: phpstan-report.json
lint composer:
stage: lint
script:
- composer config --no-plugins allow-plugins.php-http/discovery true
- composer validate --no-interaction --strict
lint secretsscan:
image: '$IMAGE_URL_PYTHON'
stage: lint
script:
- ci/scan_secrets.sh
test phpunit:
stage: test
needs: []
variables:
PHP_XDEBUG: "1"
XDEBUG_MODE: coverage
before_script:
- composer config --no-plugins allow-plugins.php-http/discovery true
- composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader
script:
- ./vendor/bin/phpunit --coverage-text --testdox
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
artifacts:
when: always
paths:
- build
expire_in: 1 day
reports:
junit: build/logs/junit.xml
coverage_report:
coverage_format: cobertura
path: build/cobertura.xml
validate tag-message:
stage: validate
needs: []
only:
- tags
script:
- ci/validate_tag_message.sh $CI_COMMIT_TAG
validate tag-version-consistency:
stage: validate
needs: []
only:
- tags
script:
- composer config --no-plugins allow-plugins.php-http/discovery true
- composer dump-autoload
- php ci/ValidateTagVersionConsistency.php $CI_COMMIT_TAG
deploy deploy-to-github:
stage: deploy
only:
- tags
script:
- ci/deploy_to_github.sh
release release-to-github:
image: '$IMAGE_URL_PYTHON'
stage: release
only:
- tags
script:
- ci/release_to_github.sh $CI_COMMIT_TAG