forked from KroneMultimedia/plugin-hacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
103 lines (91 loc) · 2.17 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
---
stages:
- tests
- release_publish
- wordpress.org
- github.com
Unit Test:
dependencies: []
image: gitlab.krone.at:5000/krn/backend:beta
tags:
- docker
services:
- mysql:5.7
stage: tests
variables:
# Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
MYSQL_ROOT_PASSWORD: somepw
script:
- composer update
- echo "zend_extension=xdebug.so" > /usr/local/etc/php/conf.d/xdebug.ini
- bin/install-wp-tests.sh wordpress_test root 'somepw' 127.0.0.1 latest
- composer update
- vendor/bin/phpunit --colors=always --coverage-text=1.txt
- grep "Lines:" 1.txt
except:
- /^v.*/ # do not unit test release tags
- after_build
- after_build_beta
tests:phpcs:
image: gitlab.krone.at:5000/krn/docker_base:beta
stage: tests
script:
# Check for var_dump/dump
- export PATH=~/.composer/vendor/bin:$PATH
- php-cs-fixer fix --verbose --dry-run --rules=@PSR2 || true
tags:
- docker
except:
- /^v([0-9]+).*/
tests:phpstan:
image: gitlab.krone.at:5000/krn/docker_base:beta
stage: tests
script:
# Check for var_dump/dump
- export PATH=~/.composer/vendor/bin:$PATH
- phpstan analyse src/ || true
tags:
- docker
except:
- /^v([0-9]+).*/
tests:phpcompatibility:
image: gitlab.krone.at:5000/krn/docker_base:beta
stage: tests
script:
# Check for var_dump/dump
- export PATH=~/.composer/vendor/bin:$PATH
- phpcs -p src --standard=PHPCompatibility --extensions=php
- phpcs -p tests --standard=PHPCompatibility --extensions=php
tags:
- docker
except:
- /^v([0-9]+).*/
release:publish:
image: gitlab.krone.at:5000/krn/fastlane_runner:latest
dependencies: []
stage: release_publish
script:
- fastlane publish_release
tags:
- docker
artifacts:
paths:
- latest_release.txt
only:
- release
- fastlane
- beta
- master
svn update:
image: gitlab.krone.at:5000/krn/backend:beta
dependencies: ["release:publish"]
stage: wordpress.org
script:
- bin/deploy-to-wp.sh $(cat latest_release.txt) kmm-hacks
tags:
- docker
only:
- master
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_DEPLOY_KEY")