blessing-skin-server/.circleci/config.yml
2019-04-27 13:09:10 +08:00

113 lines
2.6 KiB
YAML

version: 2
jobs:
frontend:
working_directory: ~/repo
docker:
- image: circleci/node:10
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run: yarn
- save_cache:
paths:
- node_modules
- ~/.yarn
key: v1-dependencies-{{ checksum "yarn.lock" }}
- run: yarn lint
- run: yarn test --coverage -w=2
- run: yarn codecov
composer:
working_directory: ~/repo
docker:
- image: blessingskin/ci:7.1
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "composer.lock" }}
- v1-dependencies-
- run: composer install -n --prefer-dist
- save_cache:
paths:
- vendor
key: v1-dependencies-{{ checksum "composer.lock" }}
- run: cp .env.testing .env
- run: php artisan key:random
- run: php artisan salt:random
- persist_to_workspace:
root: ~/repo
paths:
- .
php7.1:
working_directory: ~/repo
docker:
- image: blessingskin/ci:7.1
steps:
- attach_workspace:
at: ~/repo
- run: touch storage/testing.sqlite
- run: ./vendor/bin/phpunit --coverage-clover=coverage.xml
- run: bash <(curl -s https://codecov.io/bash) -cF php
php7.2:
working_directory: ~/repo
docker:
- image: blessingskin/ci:7.2
steps:
- attach_workspace:
at: ~/repo
- run: touch storage/testing.sqlite
- run: ./vendor/bin/phpunit
php7.3:
working_directory: ~/repo
docker:
- image: blessingskin/ci:7.3
steps:
- attach_workspace:
at: ~/repo
- run: touch storage/testing.sqlite
- run: ./vendor/bin/phpunit
api_test:
working_directory: ~/repo
docker:
- image: blessingskin/ci:rust
steps:
- attach_workspace:
at: ~/repo
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Cargo.lock" }}
- v1-dependencies-
- run: ./scripts/api-test.sh
- save_cache:
paths:
- target
key: v1-dependencies-{{ checksum "Cargo.lock" }}
workflows:
version: 2
install_and_test:
jobs:
- frontend
- composer
- php7.1:
requires:
- composer
- php7.2:
requires:
- composer
- php7.3:
requires:
- composer
- api_test:
requires:
- composer