-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (55 loc) · 1.58 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
# GitLab pipelines definition.
#
# @package ApiOpenStudioAdmin
# @license This Source Code Form is subject to the terms of the ApiOpenStudio Public License.
# If a copy of the MPL was not distributed with this file,
# You can obtain one at https://www.apiopenstudio.com/license/.
# @author john89 (https://gitlab.com/john89)
# @copyright 2020-2030 Naala Pty Ltd
# @link https://www.apiopenstudio.com
#cache:
# key: "$CI_COMMIT_REF_SLUG"
# paths:
# - vendor/
# - .composer/
# - composer.lock
stages:
- lint
##################################
## LINTING
##################################
phpcs:
image: php:7.4
stage: lint
only:
- merge_request
artifacts:
when: on_failure
paths:
- phpcs.txt
script:
- apt-get update
- apt-get install -y libzip-dev openssh-client rsync libxslt-dev unzip
- docker-php-ext-install zip xsl
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
- php composer.phar install
- echo "Linting the codebase."
- ./vendor/bin/phpcs --standard=PSR12 --report-file=phpcs.txt --ignore=*.min.js,*.min.css includes/*.php public/*.php
#eslint:
# image: node
# stage: lint
# only:
# - merge_request
# artifacts:
# when: on_failure
# paths:
# - eslint.txt
# script:
# - npm i eslint
# - node_modules/eslint/bin/eslint.js -o ./eslint.txt includes/js/*.js