circle ci setup

This commit is contained in:
2019-03-09 00:15:27 +03:00
parent 83382d3db1
commit d8ed3c8e1c
2 changed files with 47 additions and 23 deletions

47
.circleci/config.yml Normal file
View File

@@ -0,0 +1,47 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:10
- image: circleci/mariadb:10
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: writer_test
MYSQL_USER: writer
MYSQL_PASSWORD: writer
working_directory: ~/writer
steps:
- checkout
- restore_cache:
keys:
- backend-dependencies-{{ checksum "package.json" }}
- frontend-dependencies-{{ checksum "frontend/package.json" }}
- run:
name: install backend deps
command: npm i
- run:
name: install frontend deps
command: cd frontend && npm i
- save_cache:
paths:
- node_modules
key: backend-dependencies-{{ checksum "package.json" }}
- save_cache:
paths:
- frontend/node_modules
key: frontend-dependencies-{{ checksum "frontend/package.json" }}
- run:
name: test backend
command: npm test
- run:
name: install frontend
command: cd frontend && npm test

View File

@@ -1,23 +0,0 @@
image: node:10
stages:
- test-backend
variables:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: writer_test
MYSQL_USER: writer
MYSQL_PASSWORD: writer
cache:
paths:
- node_modules/
- frontend/node_modules
test-backend:
stage: test-backend
services:
- mariadb:10
script:
- npm i
- npm test