-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
39 lines (35 loc) · 1.26 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
image: php:7.4
before_script:
# Install composer & nodejs dependencies
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- apt-get update && apt-get install -y wget git zip unzip nodejs
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy( 'https://getcomposer.org/installer', 'composer-setup.php' );"
- php -r "if ( hash_file( 'SHA384', 'composer-setup.php' ) === file_get_contents( 'installer.sig' ) ) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink( 'composer-setup.php' ); } echo PHP_EOL;"
- php composer-setup.php
- php -r "unlink( 'composer-setup.php' ); unlink( 'installer.sig' );"
- php -v
- php composer.phar -V
- node -v
- npm -v
- php composer.phar install
- npm install
# Composer stores all downloaded packages in the vendor/ directory.
# Do not use the following if the vendor/ directory is committed to
# your git repository.
# Same with npm and node_modules.
cache:
paths:
- vendor/
- node_modules/
stages:
- lint
lint:
stage: lint
script:
# Lint assets (JS + CSS + SCSS)
- npm run lint
# Scan phpmd
- ./vendor/bin/phpmd web/app,config text phpmd.xml --suffixes php
# Lint php (phpcs)
- ./vendor/bin/phpcs -p -s -v --standard=phpcs.xml --extensions=php ./web/app ./config