forked from Automattic/sensei
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
46 lines (41 loc) · 1.98 KB
/
circle.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
## Customize the test machine
machine:
timezone:
America/Los_Angeles # Set the timezone
php:
version: 5.4.21
# Add some environment variables
environment:
CIRCLE_ENV: test
WP_MULTISITE: 0
WP_CORE_DIR: /home/ubuntu/wordpress-develop
SENSEI_CODING_STANDARD_DIR: /home/ubuntu/sensei_coding_standard
WP_TESTS_DIR: /home/ubuntu/wordpress-develop/tests/phpunit
plugin_loc: /home/ubuntu/$CIRCLE_PROJECT_REPONAME
plugin_slug: $CIRCLE_PROJECT_REPONAME
plugin_dir: /home/ubuntu/wordpress-develop/src/wp-content/plugins/$plugin_slug
plugin_tests_dir: /home/ubuntu/wordpress-develop/src/wp-content/plugins/$plugin_slug/tests
## Customize dependencies
dependencies:
cache_directories:
- "node_modules"
- "~/.npm/_git-remotes/"
pre:
#enable xdebug. LINE 1/2 to uncomment if you want to run a code coverage report.
- sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini
#setup WP install
- git clone git://develop.git.wordpress.org/ $WP_CORE_DIR;
- cd $WP_CORE_DIR && cp wp-tests-config-sample.php wp-tests-config.php && sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php && sed -i "s/yourusernamehere/root/" wp-tests-config.php && sed -i "s/yourpasswordhere//" wp-tests-config.php;
# set up database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot;
# setup phpunit
- wget https://phar.phpunit.de/phpunit-old.phar && chmod +x phpunit-old.phar && mv phpunit-old.phar /home/ubuntu/.phpenv/shims/phpunit
#Sensei Specific remove npm file as it is not needed
# Clone sensei-coding-standard
- git clone https://github.com/Automattic/sensei-coding-standard.git $SENSEI_CODING_STANDARD_DIR;
## tests override
test:
override:
#run tests with coverage
- cd $SENSEI_CODING_STANDARD_DIR; php bin/phpcs.phar --report-full --report-summary --standard=Sensei $plugin_loc
- cd $plugin_loc; phpunit #ignoring coverage for speed reasons: --coverage-html $CIRCLE_ARTIFACTS