-
-
Notifications
You must be signed in to change notification settings - Fork 225
/
config.yml
79 lines (65 loc) · 2.57 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
version: 2
jobs:
build:
docker:
# ref: https://circleci.com/docs/2.0/circleci-images/
- image: circleci/php:7.2.8-zts-node-browsers
environment:
- CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
- CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
- MYSQL_HOST: 127.0.0.1
- MYSQL_DATABASE: circle_test
- MYSQL_USER: root
- MYSQL_ALLOW_EMPTY_PASSWORD: true
- image: circleci/mariadb:latest-ram
environment:
- MYSQL_USER: root
- MYSQL_ALLOW_EMPTY_PASSWORD: true
- MYSQL_DATABASE: circle_test
steps:
- checkout
- run:
name: Install dependencies
command: sudo docker-php-ext-install mysqli pdo pdo_mysql
- run:
name: Setup CI environment
command: |
touch includes/configure.php
mkdir -p screenshots
- run: php --version
- restore_cache:
keys:
# "composer.lock" can be used if it is committed to the repo
- v1-dependencies-{{ checksum "composer.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Install Composer
command: composer install --no-interaction --no-suggest --ignore-platform-reqs
- save_cache:
key: v1-dependencies-{{ checksum "composer.json" }}
paths:
- ./vendor
- ~/.composer
- run:
name: Run PHPunit tests
command: vendor/bin/phpunit -c testFramework/unittests/phpunit.xml
- run:
name: Start PhantomJS
command: phantomjs --webdriver=8643 --ignore-ssl-errors=true
background: true
- run:
name: Start PHP Webserver
command: php -S 127.0.0.1:8000
background: true
- run:
name: Wait for MySQL container
command: dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
- run:
name: Run Web Tests
command: vendor/bin/behat
- store_artifacts:
path: /home/circleci/project/screenshots
- run:
name: Notify Webhook
command: if [ -n "${DEPLOY_WEBHOOK}" ]; then wget -O - $DEPLOY_WEBHOOK ; fi