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.
76 lines
1.8 KiB
76 lines
1.8 KiB
version: 2.1
|
|
workflows:
|
|
build_and_test:
|
|
jobs:
|
|
- build
|
|
- lint:
|
|
requires:
|
|
- build
|
|
- tests:
|
|
requires:
|
|
- build
|
|
- e2e:
|
|
requires:
|
|
- build
|
|
jobs:
|
|
build:
|
|
docker:
|
|
- image: "circleci/node:12"
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: yarn-v3{{ checksum "yarn.lock" }}
|
|
- run: yarn global add node-gyp && yarn install
|
|
- save_cache:
|
|
key: yarn-v3{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- ./node_modules
|
|
tests:
|
|
docker:
|
|
- image: "circleci/node:12"
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: yarn-v3{{ checksum "yarn.lock" }}
|
|
- run: yarn test:ci
|
|
- save_cache:
|
|
key: yarn-v3{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- ./node_modules
|
|
lint:
|
|
docker:
|
|
- image: "circleci/node:12"
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: yarn-v3{{ checksum "yarn.lock" }}
|
|
- run: yarn lint && yarn format:check
|
|
- save_cache:
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- ./node_modules
|
|
e2e:
|
|
docker:
|
|
- image: "circleci/postgres:9.6.2-alpine"
|
|
environment:
|
|
PG_USER: julien_dudek
|
|
PG_DB: testdb
|
|
PG_PASSWORD: unpass
|
|
|
|
- image: "circleci/node:12"
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: yarn-v3{{ checksum "yarn.lock" }}
|
|
- run:
|
|
command: yarn test:e2e
|
|
environment:
|
|
DATABASE_URL: postgres://$PG_USER:$PG_PASSWORD@localhost:5432/$PG_DB
|
|
JWT_SECRET: m1iii
|
|
API_PORT: 3000
|
|
API_HOST: localhost
|
|
API_PROTOCOL: http
|
|
- save_cache:
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- ./node_modules
|