-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.yml
117 lines (108 loc) · 3.53 KB
/
config.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
version: 2
jobs:
build:
working_directory: ~/@projectname@
docker:
- image: circleci/php:7.1-node-browsers
- image: circleci/mysql:5.7-ram
command: --max_allowed_packet=16M
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_ROOT_PASSWORD: ''
MYSQL_DATABASE: circle_test
environment:
- PALANTIR_ENVIRONMENT: circle
- DRUPAL_ROOT: web
- NODE_VERSION: 8
steps:
- run:
name: Install packages
command: sudo apt-get install -y libpng-dev mysql-client
- run:
name: Install nvm
command: |
set +e
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
touch $BASH_ENV
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- run:
name: Install PHP extensions
command: sudo docker-php-ext-install pdo_mysql gd
- run:
name: Configure PHP
command: |
echo "sendmail_path=/bin/true" | sudo tee -a "/usr/local/etc/php/php.ini"
echo "memory_limit=-1" | sudo tee -a "/usr/local/etc/php/php.ini"
- run:
name: PHP version
command: php -r 'phpinfo(INFO_GENERAL | INFO_CREDITS | INFO_CONFIGURATION | INFO_MODULES);'
- run:
name: Composer version
command: composer --version
- run:
name: Create artifacts directory
command: mkdir /tmp/artifacts
- run:
name: Configure URL in /etc/hosts
command: echo 127.0.0.1 ${CIRCLE_PROJECT_REPONAME}.local | sudo tee -a /etc/hosts
# Composer package cache
- restore_cache:
keys:
- composer-v1-
# Source cache
- restore_cache:
keys:
- source-v1-{{ .Branch }}
- source-v1-
- checkout
- run:
name: Composer install
command: composer install --no-interaction --prefer-dist
# Composer package cache - update when the contents of the Composer cache directory
# change
- run: ls -1R ~/.composer/cache/ > /tmp/composer-cache.txt
- save_cache:
key: composer-v1-{{ checksum "/tmp/composer-cache.txt" }}
paths:
- ~/.composer
# Source cache - update when branch changes
- save_cache:
key: source-v1-{{ .Branch }}
paths:
- ".git"
- run:
name: Wait for DB
# Dockerize is preinstalled in circleci/* docker image
command: dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
- run:
name: Build Drupal's settings.php
command: vendor/bin/phing build
- run:
name: Install Drupal
command: vendor/bin/phing install
- run:
name: Run any migrations
command: vendor/bin/phing migrate
- run:
name: Run code reviews
command: vendor/bin/phing code-review
- run:
name: Run Behat tests
command: |
nohup php -S ${CIRCLE_PROJECT_REPONAME}.local:8000 -t $(pwd)/${DRUPAL_ROOT}/ > /tmp/artifacts/phpd.log 2>&1 &
vendor/bin/phing test
- store_artifacts:
path: /tmp/artifacts
- store_test_results:
path: /tmp/artifacts
workflows:
version: 2
build:
jobs:
- build:
filters:
branches:
ignore:
- gh-pages
- /.*(readme|documentation).*/