Skip to content

Commit

Permalink
Merge pull request #25 from wp-cli/circle-v2
Browse files Browse the repository at this point in the history
Update `circle.yml` to use its v2 API
  • Loading branch information
schlessera committed Jul 24, 2018
2 parents 59ea85f + 309ed1b commit f49b9ab
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 31 deletions.
5 changes: 3 additions & 2 deletions bin/install-package-tests.sh
Expand Up @@ -3,8 +3,9 @@
set -ex

install_db() {
mysql -e 'CREATE DATABASE IF NOT EXISTS wp_cli_test;' -uroot
mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot
mysql -e 'CREATE DATABASE IF NOT EXISTS wp_cli_test;' -uroot -h 127.0.0.1
mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"127.0.0.1" IDENTIFIED BY "password1"' -uroot -h 127.0.0.1
mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test_scaffold.* TO "wp_cli_test"@"127.0.0.1" IDENTIFIED BY "password1"' -uroot -h 127.0.0.1
}

install_db
58 changes: 29 additions & 29 deletions circle.yml
@@ -1,29 +1,29 @@
machine:
php:
version: 5.6.22
environment:
PATH: "$HOME/$CIRCLE_PROJECT_REPONAME/vendor/bin:$PATH"
WP_CLI_BIN_DIR: "$HOME/$CIRCLE_PROJECT_REPONAME/vendor/bin"

dependencies:
cache_directories:
- ~/.composer/cache
pre:
# Set the PHP timezone so that Behat does not fail.
- echo "date.timezone = 'US/Central'" > /opt/circleci/php/$(phpenv global)/etc/conf.d/wp-cli-timezone.ini
# Disable xdebug, which makes Composer slower.
- echo "" > /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini
# Increase memory limit
- echo "memory_limit = 512M" > /opt/circleci/php/$(phpenv global)/etc/conf.d/memory.ini
override:
- composer require wp-cli/wp-cli:dev-master
- composer install
- bash bin/install-package-tests.sh

test:
pre:
- composer validate
override:
- WP_VERSION=latest bash bin/test.sh
- rm -rf '/tmp/wp-cli-test core-download-cache'
- WP_VERSION=trunk bash bin/test.sh
version: 2
jobs:
build:
working_directory: ~/wp-cli/package-tests
parallelism: 1
docker:
- image: circleci/php:7.1
- image: circleci/mysql:5.6
steps:
- checkout
- run: |
sudo sh -c "printf '\ndeb http://ftp.us.debian.org/debian sid main\n' >> /etc/apt/sources.list"
sudo apt-get update
sudo docker-php-ext-install mysqli
sudo apt-get install mysql-client-5.7
- run: |
echo -e "memory_limit = 1024M" | sudo tee /usr/local/etc/php/php.ini > /dev/null
- run: |
composer require wp-cli/wp-cli:dev-master
composer install
bash bin/install-package-tests.sh
- run: |
echo 'export PATH=$HOME/wp-cli/package-tests/vendor/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- run: |
composer validate
WP_VERSION=latest bash bin/test.sh
rm -rf '/tmp/wp-cli-test core-download-cache'
WP_VERSION=trunk bash bin/test.sh

0 comments on commit f49b9ab

Please sign in to comment.