mirror of
https://github.com/usatiuk/writer.git
synced 2025-10-29 00:17:48 +01:00
circle ci setup
This commit is contained in:
47
.circleci/config.yml
Normal file
47
.circleci/config.yml
Normal 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
|
||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user