You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
1.9 KiB
93 lines
1.9 KiB
version: 2.1
|
|
|
|
commands:
|
|
restore_cache_cmd:
|
|
steps:
|
|
- restore_cache:
|
|
key: yarn-v2-packages-{{ checksum "yarn.lock" }}
|
|
save_cache_cmd:
|
|
steps:
|
|
- save_cache:
|
|
paths:
|
|
- ./node_modules
|
|
key: yarn-v2-packages-{{ checksum "yarn.lock" }}
|
|
|
|
jobs:
|
|
build1:
|
|
docker:
|
|
- image: "circleci/node:12"
|
|
|
|
steps:
|
|
- checkout
|
|
- restore_cache_cmd
|
|
- run:
|
|
command: "yarn global add node-gyp && yarn install"
|
|
name: "installation"
|
|
- save_cache_cmd
|
|
|
|
lint1:
|
|
docker:
|
|
- image: "circleci/node:12"
|
|
|
|
steps:
|
|
- checkout
|
|
- restore_cache_cmd
|
|
- run:
|
|
command: "yarn lint && yarn format:check"
|
|
name: "lint and format check"
|
|
- save_cache_cmd
|
|
|
|
unit1:
|
|
docker:
|
|
- image: "circleci/node:12"
|
|
|
|
steps:
|
|
- checkout
|
|
- restore_cache_cmd
|
|
- run:
|
|
command: "yarn test:ci"
|
|
name: "test unitaires"
|
|
- save_cache_cmd
|
|
|
|
database:
|
|
docker:
|
|
- image: "circleci/node:12"
|
|
environment:
|
|
DATABASE_URL: postgres://psqluer:psqlpassword@localhost:5432/psdb
|
|
JWT_SECRET: some string yo want
|
|
API_PORT: 3000
|
|
API_HOST: localhost
|
|
API_PROTOCOL: http
|
|
|
|
- image: "circleci/postgres:9.6.2-alpine"
|
|
environment:
|
|
POSTGRES_USER: psqluer
|
|
POSTGRES_PASSWORD: psqlpassword
|
|
POSTGRES_DB: psdb
|
|
|
|
steps:
|
|
- checkout
|
|
- restore_cache_cmd
|
|
- run:
|
|
command: "yarn test:e2e"
|
|
name: "test end 2 end db postgres"
|
|
- save_cache_cmd
|
|
|
|
workflows:
|
|
version: 2
|
|
|
|
test_workflow:
|
|
jobs:
|
|
- build1
|
|
- lint1:
|
|
requires:
|
|
- build1
|
|
- unit1:
|
|
requires:
|
|
- build1
|
|
|
|
- database:
|
|
requires:
|
|
- build1
|
|
- lint1
|
|
- unit1
|