-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
34 lines (29 loc) · 1.05 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
stages:
- test
- deploy
variables:
DOCKER_DRIVER: overlay2
unit_test:
image: php:8
# before_script:
# - apt-get update && apt-get install -y git
# - curl -fsSL https://getcomposer.org/download/2.0.8/composer.phar -o /usr/local/bin/composer && chmod +x /usr/local/bin/composer
# - composer install
script:
# - ./vendor/bin/phpunit --testdox tests
- curl -fsSL https://phar.phpunit.de/phpunit-9.phar -o /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit
- /usr/local/bin/phpunit --bootstrap ./tests/bootstrap.php --testdox tests
deploy_composer_tag:
image: curlimages/curl:7.72.0
only:
- tags
stage: deploy
script:
- 'curl --header "Job-Token: ${CI_JOB_TOKEN}" --data tag="${CI_COMMIT_TAG}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/composer"'
deploy_composer_branch:
image: curlimages/curl:7.72.0
only:
- branches
stage: deploy
script:
- 'curl --header "Job-Token: ${CI_JOB_TOKEN}" --data branch="${CI_COMMIT_BRANCH}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/composer"'