tissue/.circleci/config.yml

82 lines
2.2 KiB
YAML
Raw Normal View History

2019-03-02 17:31:41 +09:00
version: 2
2019-06-26 15:31:14 +09:00
2019-03-02 17:31:41 +09:00
jobs:
build:
docker:
2019-03-05 20:25:06 +09:00
- image: circleci/php:7.1-node-browsers
2019-03-02 17:31:41 +09:00
environment:
APP_DEBUG: true
APP_ENV: testing
APP_KEY: base64:f2tcw34GKT8EOtb5myZxJ8QLdgNivmyPhoQIPY2YfK8=
DB_CONNECTION: pgsql
DB_DATABASE: tissue
DB_USERNAME: tissue
DB_PASSWORD: tissue
- image: circleci/postgres:10-alpine
environment:
POSTGRES_DB: tissue
POSTGRES_USER: tissue
POSTGRES_PASSWORD: tissue
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_cache:
keys:
- v1-dependencies-{{ checksum "composer.json" }}
- v1-dependencies-
- run: composer install -n --prefer-dist
- save_cache:
key: v1-dependencies-{{ checksum "composer.json" }}
paths:
- ./vendor
2019-03-05 20:25:06 +09:00
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: yarn install
- save_cache:
key: v1-dependencies-{{ checksum "package.json" }}
paths:
- ./node_modules
- ~/.yarn
2019-03-02 17:31:41 +09:00
- run: php artisan migrate
- run: yarn run prod
2019-03-02 17:31:41 +09:00
# Run linter
- run:
command: |
mkdir -p /tmp/php-cs-fixer
./vendor/bin/php-cs-fixer fix --dry-run --diff --format=junit > /tmp/php-cs-fixer/php-cs-fixer.xml
when: always
- store_test_results:
path: /tmp/php-cs-fixer
# Run stylelint
- run:
name: stylelint
command: yarn run stylelint
when: always
2019-03-02 17:31:41 +09:00
# Run unit test
- run:
command: |
mkdir -p /tmp/phpunit
2019-06-26 15:31:14 +09:00
./vendor/bin/phpunit --log-junit /tmp/phpunit/phpunit.xml --coverage-clover=/tmp/phpunit/coverage.xml
2019-03-02 17:31:41 +09:00
when: always
- store_test_results:
path: /tmp/phpunit
2019-06-26 15:31:14 +09:00
- store_artifacts:
path: /tmp/phpunit/coverage.xml
# Upload coverage
- run:
2019-06-26 15:46:35 +09:00
command: bash <(curl -s https://codecov.io/bash) -f /tmp/phpunit/coverage.xml
2019-06-26 15:31:14 +09:00
when: always