218 lines
7.2 KiB
YAML
218 lines
7.2 KiB
YAML
version: 2
|
|
jobs:
|
|
qa_js_security_php5:
|
|
working_directory: /home/circleci/mailpoet
|
|
docker:
|
|
- image: circleci/php:5.6.30-apache-browsers
|
|
- image: circleci/mysql:5.7
|
|
environment:
|
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: "Set up virtual host"
|
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
|
- restore_cache:
|
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
- restore_cache:
|
|
key: npm-{{ checksum "package.json" }}
|
|
- run:
|
|
name: "Set up test environment"
|
|
command: source ./.circleci/setup.bash && setup php5
|
|
- save_cache:
|
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
paths:
|
|
- vendor
|
|
- save_cache:
|
|
key: npm-{{ checksum "package.json" }}
|
|
paths:
|
|
- node_modules
|
|
- run:
|
|
name: "QA Scripts"
|
|
command: ./do qa
|
|
- run:
|
|
name: "Preparing test results folder"
|
|
command: mkdir test-results
|
|
- run:
|
|
name: "JS tests"
|
|
command: |
|
|
mkdir test-results/mocha
|
|
./do t:j test-results/mocha/junit.xml
|
|
- run:
|
|
name: "Composer security check"
|
|
command: |
|
|
./do s:composer
|
|
- run:
|
|
name: "PHP Unit tests"
|
|
command: |
|
|
WP_TEST_PATH="/home/circleci/mailpoet/wordpress" ./do t:u --xml
|
|
- store_test_results:
|
|
path: test-results/mocha
|
|
- store_artifacts:
|
|
path: test-results/mocha
|
|
destination: mocha
|
|
- store_test_results:
|
|
path: tests/_output
|
|
- store_artifacts:
|
|
path: tests/_output
|
|
destination: codeception
|
|
- store_artifacts:
|
|
path: /tmp/fake-mailer/
|
|
destination: fake-mailer
|
|
acceptance_tests:
|
|
working_directory: /home/circleci/mailpoet
|
|
machine: true
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: "Set up virtual host"
|
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
|
- restore_cache:
|
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
- restore_cache:
|
|
key: npm-{{ checksum "package.json" }}
|
|
- run:
|
|
name: "Set up test environment"
|
|
command: |
|
|
sudo apt-get update
|
|
sudo apt-get install circleci-php-5.6.23
|
|
sudo rm /usr/bin/php
|
|
sudo ln -s /opt/circleci/php/5.6.23/bin/php /usr/bin/php
|
|
# Install NodeJS+NPM
|
|
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
|
|
sudo apt-get install nodejs build-essential
|
|
# install plugin dependencies
|
|
curl -sS https://getcomposer.org/installer | php
|
|
php composer.phar install
|
|
./do install
|
|
./do compile:all --env production
|
|
- save_cache:
|
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
paths:
|
|
- vendor
|
|
- save_cache:
|
|
key: npm-{{ checksum "package.json" }}
|
|
paths:
|
|
- node_modules
|
|
- run:
|
|
name: Run acceptance tests
|
|
command: |
|
|
docker-compose run codeception --steps --debug -vvv --html --xml
|
|
- store_artifacts:
|
|
path: tests/_output
|
|
- store_test_results:
|
|
path: tests/_output
|
|
acceptance_tests_multisite:
|
|
working_directory: /home/circleci/mailpoet
|
|
machine: true
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: "Set up virtual host"
|
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
|
- restore_cache:
|
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
- restore_cache:
|
|
key: npm-{{ checksum "package.json" }}
|
|
- run:
|
|
name: "Set up test environment"
|
|
command: |
|
|
sudo apt-get update
|
|
sudo apt-get install circleci-php-5.6.23
|
|
sudo rm /usr/bin/php
|
|
sudo ln -s /opt/circleci/php/5.6.23/bin/php /usr/bin/php
|
|
# Install NodeJS+NPM
|
|
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
|
|
sudo apt-get install nodejs build-essential
|
|
# install plugin dependencies
|
|
curl -sS https://getcomposer.org/installer | php
|
|
php composer.phar install
|
|
./do install
|
|
./do compile:all --env production
|
|
- save_cache:
|
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
paths:
|
|
- vendor
|
|
- save_cache:
|
|
key: npm-{{ checksum "package.json" }}
|
|
paths:
|
|
- node_modules
|
|
- run:
|
|
name: Run acceptance tests
|
|
command: |
|
|
docker-compose run -e MULTISITE=1 codeception --steps --debug -vvv --html --xml
|
|
- store_artifacts:
|
|
path: tests/_output
|
|
- store_test_results:
|
|
path: tests/_output
|
|
php7:
|
|
working_directory: /home/circleci/mailpoet
|
|
docker:
|
|
- image: circleci/php:7.1-apache-browsers
|
|
- image: circleci/mysql:5.7
|
|
environment:
|
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: "Set up virtual host"
|
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
|
- restore_cache:
|
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
- restore_cache:
|
|
key: npm-{{ checksum "package.json" }}
|
|
- run:
|
|
name: "Set up test environment"
|
|
command: source ./.circleci/setup.bash && setup php7
|
|
- run:
|
|
name: "PHP Unit tests"
|
|
command: |
|
|
./do t:u --xml
|
|
- store_test_results:
|
|
path: tests/_output
|
|
- store_artifacts:
|
|
path: tests/_output
|
|
destination: codeception
|
|
- store_artifacts:
|
|
path: /tmp/fake-mailer/
|
|
destination: fake-mailer
|
|
php7_multisite:
|
|
working_directory: /home/circleci/mailpoet
|
|
docker:
|
|
- image: circleci/php:7.1-apache-browsers
|
|
- image: circleci/mysql:5.7
|
|
environment:
|
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: "Set up virtual host"
|
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
|
- restore_cache:
|
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
- restore_cache:
|
|
key: npm-{{ checksum "package.json" }}
|
|
- run:
|
|
name: "Set up test environment"
|
|
command: source ./.circleci/setup.bash && setup php7_multisite
|
|
- run:
|
|
name: "PHP Unit tests"
|
|
command: |
|
|
./do t:multisite-unit --xml
|
|
- store_test_results:
|
|
path: tests/_output
|
|
- store_artifacts:
|
|
path: tests/_output
|
|
destination: codeception
|
|
- store_artifacts:
|
|
path: /tmp/fake-mailer/
|
|
destination: fake-mailer
|
|
workflows:
|
|
version: 2
|
|
build_and_test:
|
|
jobs:
|
|
- qa_js_security_php5
|
|
- php7
|
|
- php7_multisite
|
|
- acceptance_tests
|
|
- acceptance_tests_multisite |