Skip to content
This repository has been archived by the owner on Aug 16, 2020. It is now read-only.

Commit

Permalink
circleciの設定を入れる
Browse files Browse the repository at this point in the history
  • Loading branch information
kadoyau committed Dec 7, 2019
1 parent 08b8ee6 commit b3d15c9
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/php:7.3-apache-node-browsers # ...with this image as the primary container; this is where all `steps` will run
environment:
REVIEWDOG_VERSION: 0.9.11

This comment has been minimized.

Copy link
@kadoyau

kadoyau Dec 7, 2019

Author Owner

reviewdogのバージョンが古いです

- image: circleci/postgres:11.6
environment:
POSTGRES_DB: default
POSTGRES_USER: default
POSTGRES_PASSWORD: secret
working_directory: ~/laravel # directory where steps will run

steps:
- checkout
- run:
name: Install and enable pdo_pgsql php extension
command: |
sudo apt-get update && sudo apt-get install libpq-dev
sudo docker-php-ext-install bcmath json pdo_pgsql && sudo docker-php-ext-enable pdo_pgsql
- run: sudo composer self-update

# Download and cache dependencies
- 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-

- run: composer install -n --prefer-dist

- save_cache:
key: v1-dependencies-{{ checksum "composer.json" }}
paths:
- ./vendor
- restore_cache:
keys:
- node-v1-{{ checksum "package.json" }}
- node-v1-
- run: yarn install
- save_cache:
key: node-v1-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Install and build CRA
command: | # TODO: cache
yarn install
yarn run build:production
working_directory: ~/laravel/front
- run: cp .env.ci .env.testing
- run: php artisan key:generate --env=testing
- run: php artisan migrate --env=testing --force

- run:
name: Run tests
command: |
./vendor/bin/phpunit --log-junit /tmp/test-results/phpunit/logfile.xml
- store_test_results:
path: /tmp/test-results
10 changes: 10 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
APP_KEY=
APP_DEBUG=true
APP_ENV=ci

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=default
DB_USERNAME=default
DB_PASSWORD=secret

0 comments on commit b3d15c9

Please sign in to comment.