-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
96 lines (85 loc) · 2.87 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
image: docker:23.0.1
services:
- docker:dind
stages:
- code_test
- build
.code_check: &code_check
image: registry.gitlab.com/burrak-symfony/twitch/php:latest
script:
- php -v
- composer require --dev --no-update --ansi php-parallel-lint/php-parallel-lint:"1.*"
- composer update --no-scripts --prefer-dist --ansi
- ./vendor/bin/parallel-lint -e php,php3,php4,php5,phtml,phpt,phps --exclude vendor .
code_check_80:
<<: *code_check
image: registry.gitlab.com/burrak-symfony/twitch/php:latest
stage: code_test
whitespace_check:
image: registry.gitlab.com/burrak-symfony/twitch/php:latest
stage: code_test
script:
- if grep --include=*.{php,php3,php4,php5,phtml,phpt,phps} -rl $'\xEF\xBB\xBF' .; then echo 'Files contains unicode byte order mark (BOM)!'; exit 1; fi
- if grep -rlP --include=\*.{cs,php,phpt} '[[:blank:]](\r)?$' .; then echo 'Please remove trailing whitespace'; exit 1; fi
- if grep -rlP --include=\*.{php,phpt} '\r' .; then echo 'Please save with UNIX line endings'; exit 1; fi
phpstan_project_tests:
image: registry.gitlab.com/burrak-symfony/twitch/php:latest
stage: code_test
allow_failure: false
artifacts:
when: always
expire_in: 1d
paths:
- log/
script:
- composer update --no-scripts --prefer-dist --ansi
- php -d memory_limit=-1 ./vendor/bin/phpstan analyse -l8 -c phpstan.neon src
php_code_standard:
image: registry.gitlab.com/burrak-symfony/twitch/php:latest
stage: code_test
allow_failure: false
artifacts:
when: always
expire_in: 1d
paths:
- log/
script:
- composer update --no-scripts --prefer-dist --ansi
- ./vendor/bin/phpcs -p --standard=./tests/php_codesniffer/ruleset.xml src
php_copy_detector:
image: registry.gitlab.com/burrak-symfony/twitch/php:latest
stage: code_test
allow_failure: false
script:
- rm -rf ../php_cpd
- composer create-project sebastian/phpcpd ../php_cpd
- ../php_cpd/phpcpd `pwd`/src/
- rm -rf ../php_cpd
phpunit:
image: registry.gitlab.com/burrak-symfony/twitch/php:latest
stage: code_test
allow_failure: false
script:
- composer update --no-scripts --prefer-dist --ansi
- ./vendor/bin/phpunit
coverage:
image: registry.gitlab.com/burrak-symfony/twitch/php:latest
stage: code_test
allow_failure: false
script:
- composer update --no-scripts --prefer-dist --ansi
- ./vendor/bin/phpunit --coverage-text --colors=never
coverage: /\s+Lines:\s+(\d+\.\d+%)/
build:
stage: build
image: docker:stable
before_script:
- apk add --no-cache python3 py3-pip docker-compose
- pip3 install --no-cache-dir awscli
script:
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin 372854371796.dkr.ecr.eu-central-1.amazonaws.com
- docker-compose -f docker-compose.aws.yml build
- docker-compose push
only:
- pre-prod
- main