-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
94 lines (86 loc) · 2.21 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
stages:
- deps
- check
- build
- version
- pack
- release
cache:
- key: composer-cache
paths:
- /root/.cache/composer/
- /root/.composer/cache
policy: pull-push
- key: $CI_COMMIT_REF_SLUG
paths:
- vendor
policy: pull-push
phan:
stage: check
image: jbuncle/php-build-phan
only:
refs:
- branches
before_script:
- composer global config github-oauth.github.com $GITHUB_TOKEN
- composer global config http-basic.nexus.jbuncle.co.uk composer-publisher $NEXUS_PASS
- composer install --ignore-platform-reqs --prefer-dist
script:
- phan --target-php-version=7.4
- phan --target-php-version=8.0
phpcs:
stage: check
image: cyberpearuk/php-build-docker
only:
refs:
- branches
before_script:
- composer global config github-oauth.github.com $GITHUB_TOKEN
- composer global config http-basic.nexus.jbuncle.co.uk composer-publisher $NEXUS_PASS
- composer install --ignore-platform-reqs --prefer-dist
script:
- vendor/bin/phpcs -n -s --standard=php-standards ./src
version:
stage: version
image: jbuncle/php-autosemver
needs:
- job: phpcs
artifacts: false
- job: phan
artifacts: false
script:
- echo "VERSION=$(next-version)" >> build.env
- cat build.env
artifacts:
reports:
dotenv: build.env
only:
refs:
- master
git-tag:
stage: release
image: jbuncle/php-autosemver
needs:
- job: version
artifacts: true
script:
- git-tag ${VERSION}
only:
refs:
- master
nexus-publish:
stage: release
image: jbuncle/composer-nexus-upload
needs:
- job: version
artifacts: true
script:
- nexus-upload
--repository=https://nexus.jbuncle.co.uk/repository/composer-private/
--username=composer-publisher
--password=$NEXUS_PASS
--version=${VERSION}
--ignore="/^(vendor|nbproject|\.gitlab\-ci\.yml|\.phan|tests|phpunit\.xml)/"
only:
refs:
- master