From 0515efec1be79a47d7d12ce6725b696d750f6d26 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 27 Aug 2018 21:40:30 -0600 Subject: [PATCH] Update CI config --- .circleci/config.yml | 51 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e422c744a..f7df69a88 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,22 +6,30 @@ version: 2 jobs: build: docker: - # specify the version you desire here - - image: circleci/php:7.1.5-browsers - + # Specify the version you desire here + - image: circleci/php:7.1-jessie-node-browsers + # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/mysql:9.4 - - working_directory: ~/repo + # Using the RAM variation mitigates I/O contention + # for database intensive operations. + # - image: circleci/mysql:5.7-ram + # + # - image: redis:2.8.19 steps: - checkout + - run: sudo apt update && sudo apt install zlib1g-dev libsqlite3-dev + - run: sudo docker-php-ext-install zip + # Download and cache dependencies + + # composer cache - 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- @@ -29,9 +37,30 @@ jobs: - run: composer install -n --prefer-dist - save_cache: + key: composer-v1-{{ checksum "composer.lock" }} paths: - - ./vendor - key: v1-dependencies-{{ checksum "composer.json" }} - - # run tests! - - run: phpunit \ No newline at end of file + - vendor + + # node cache + + - restore_cache: + keys: + - node-v3-{{ checksum "package.json" }} + - node-v3- + - run: yarn install + - save_cache: + key: node-v3-{{ checksum "package.json" }} + paths: + - node_modules + - ~/.yarn + + # prepare the database + - run: touch storage/testing.sqlite + - run: php artisan migrate --env=testing --database=sqlite_testing --force + + # run tests with phpunit or codecept + - run: ./vendor/bin/phpunit + - store_test_results: + path: tests/_output + - store_artifacts: + path: tests/_output \ No newline at end of file