-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
58 lines (53 loc) · 1.22 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
stages:
- install
- tests
- deploy
install:
stage: install
only:
- branches
image: redbitcz/gitlab-ci-php:7.4
cache:
key:
files:
- composer.json
prefix: ${CI_COMMIT_REF_SLUG}
paths:
- composer.lock
- vendor/
artifacts:
untracked: true
paths:
- vendor/
script:
- composer install --optimize-autoloader
tests:phpstan:
stage: tests
only:
- branches
image: redbitcz/gitlab-ci-php:7.4
dependencies:
- install
script:
- php -d memory_limit=512M vendor/bin/phpstan analyse src/ tests/ --level 6
tests:nette_tester:
stage: tests
only:
- branches
image: redbitcz/gitlab-ci-php:7.4
dependencies:
- install
script:
- php -d memory_limit=512M vendor/bin/tester tests/ -s
deploy:composer:tag:
stage: deploy
only:
- tags
script:
- curl -fsS -u "__token__:${COMPOSER_PACKAGE_BUILDER_TOKEN}" --data "tag=${CI_COMMIT_TAG}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/composer"
deploy:composer:branch:
stage: deploy
only:
- branches
script:
- curl -fsS -u "__token__:${COMPOSER_PACKAGE_BUILDER_TOKEN}" --data "branch=${CI_COMMIT_REF_NAME}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/composer"