forked from learnweb/moodle-mod_moodleoverflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
75 lines (69 loc) · 2.62 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
services:
- mysql:latest
cache:
paths:
- $HOME/.composer/cache
variables:
DB: "mysqli"
MYSQL_ROOT_PASSWORD: "superrootpass"
TRAVIS_BUILD_DIR: "$CI_PROJECT_DIR"
MUSTACHE_IGNORE_NAMES: "email_html_body.mustache, email_html.mustache, email_text.mustache"
before_script:
# Prepare oracle-java8
- echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" > /etc/apt/sources.list.d/webupd8team-java.list
- echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" >> /etc/apt/sources.list.d/webupd8team-java.list
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
- apt-get update
# Add Australian locale
- apt-get install -y locales
- echo "en_AU.UTF-8 UTF-8" > /etc/locale.gen
- locale-gen en_AU.UTF-8
- /usr/sbin/update-locale LANG=en_AU.UTF-8
# Install php-gd (and others)
- echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
- echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
- apt-get install -y git libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev libicu-dev g++ mysql-client oracle-java8-installer oracle-java8-set-default
- docker-php-ext-install -j$(nproc) iconv mcrypt intl zip mysqli
- docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
- docker-php-ext-install -j$(nproc) gd
# Install phpunit.
- curl -o /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar
- chmod +x /usr/local/bin/phpunit
- cd ../..
# Install NVM and node
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
- source $HOME/.nvm/nvm.sh
- nvm install node
# Install composer.
- curl -sS https://getcomposer.org/installer | php
- mv composer.phar /usr/local/bin/composer
- composer create-project -n --no-dev moodlerooms/moodle-plugin-ci ci ^2
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
- chmod u+x /builds/ci/bin/moodle-plugin-ci
- chmod u+x /builds/ci/bin/*
- umask u+x
- moodle-plugin-ci install --db-user=root --db-pass=superrootpass --db-host=mysql -vvv
.job_template: &job_definition
script:
- EXIT_STATUS=0
- moodle-plugin-ci phplint
- moodle-plugin-ci phpcpd
- moodle-plugin-ci phpmd
- moodle-plugin-ci codechecker
- moodle-plugin-ci savepoints
- moodle-plugin-ci mustache
- moodle-plugin-ci grunt
- moodle-plugin-ci validate
- moodle-plugin-ci phpunit
- moodle-plugin-ci behat
- exit $EXIT_STATUS
job1:
<<: *job_definition
image: php:7.1
variables:
MOODLE_BRANCH: "MOODLE_33_STABLE"
job2:
<<: *job_definition
image: php:7.1
variables:
MOODLE_BRANCH: "master"