From c535153e1f30b7f74f4a7d4271248641a2735969 Mon Sep 17 00:00:00 2001 From: shibafu Date: Fri, 2 Aug 2019 00:49:11 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=9A=E6=9C=9F=E7=9A=84=E3=81=AB?= =?UTF-8?q?=E5=AE=9F=E9=9A=9B=E3=81=AE=E3=83=AA=E3=82=AF=E3=82=A8=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E4=BC=B4=E3=81=86MetadataResolver=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E5=AE=9F=E8=A1=8C=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 101 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 93 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0500ccd..e681dcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ -version: 2 +version: 2.1 -jobs: +executors: build: docker: - image: circleci/php:7.1-node-browsers @@ -17,38 +17,75 @@ jobs: POSTGRES_DB: tissue POSTGRES_USER: tissue POSTGRES_PASSWORD: tissue + +commands: + initialize: steps: - checkout - - run: sudo apt update - run: sudo apt install -y libpq-dev - run: sudo docker-php-ext-install zip - run: sudo docker-php-ext-install pdo_pgsql - + restore_composer: + steps: - restore_cache: keys: - v1-dependencies-{{ checksum "composer.json" }} - v1-dependencies- - - run: composer install -n --prefer-dist + save_composer: + steps: - save_cache: key: v1-dependencies-{{ checksum "composer.json" }} paths: - ./vendor - + restore_npm: + steps: - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} - v1-dependencies- - - run: yarn install + save_npm: + steps: - save_cache: key: v1-dependencies-{{ checksum "package.json" }} paths: - ./node_modules - ~/.yarn - - run: php artisan migrate +jobs: + build: + executor: build + steps: + - initialize + + - restore_composer + - run: composer install -n --prefer-dist + - save_composer + + - restore_npm + - run: yarn install + - save_npm + - run: yarn run prod + - persist_to_workspace: + root: . + paths: + - public + + test: + executor: build + steps: + - initialize + + - restore_composer + - restore_npm + + - attach_workspace: + at: . + + - run: php artisan migrate + # Run linter - run: command: | @@ -79,3 +116,51 @@ jobs: - run: command: bash <(curl -s https://codecov.io/bash) -f /tmp/phpunit/coverage.xml when: always + + test_resolver: + executor: build + environment: + TEST_USE_HTTP_MOCK: false + steps: + - initialize + + - restore_composer + + - attach_workspace: + at: . + + - run: php artisan migrate + + # Run unit test + - run: + command: | + mkdir -p /tmp/phpunit + ./vendor/bin/phpunit --log-junit /tmp/phpunit/phpunit.xml --coverage-clover=/tmp/phpunit/coverage.xml + when: always + - store_test_results: + path: /tmp/phpunit + - store_artifacts: + path: /tmp/phpunit/coverage.xml + +workflows: + version: 2.1 + test: + jobs: + - build + - test: + requires: + - build + scheduled_resolver_test: + triggers: + - schedule: + cron: "4 0 * * 1" + filters: + branches: + only: + - develop + jobs: + - build + - test_resolver: + requires: + - build + From a1850b666b6b3cb6f8e3b347267ebe341c8cf281 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sat, 10 Aug 2019 12:18:36 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=9A=E6=9C=9F=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=A7=E3=81=AFMetadataResolver=E3=81=AE=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=AE=E3=81=BF=E3=82=92=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 2 +- phpunit.xml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e681dcc..70b05da 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -135,7 +135,7 @@ jobs: - run: command: | mkdir -p /tmp/phpunit - ./vendor/bin/phpunit --log-junit /tmp/phpunit/phpunit.xml --coverage-clover=/tmp/phpunit/coverage.xml + ./vendor/bin/phpunit --testsuite MetadataResolver --log-junit /tmp/phpunit/phpunit.xml --coverage-clover=/tmp/phpunit/coverage.xml when: always - store_test_results: path: /tmp/phpunit diff --git a/phpunit.xml b/phpunit.xml index 9ecda83..c29a86d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -16,6 +16,10 @@ ./tests/Unit + + + ./tests/Unit/MetadataResolver +