|
|
@ -1,17 +1,18 @@ |
|
|
version: 2.1 |
|
|
version: 2.1 |
|
|
workflows: |
|
|
workflows: |
|
|
build_and_lint: |
|
|
|
|
|
|
|
|
build_and_test: |
|
|
jobs: |
|
|
jobs: |
|
|
- build |
|
|
- build |
|
|
- lint: |
|
|
- lint: |
|
|
requires: |
|
|
requires: |
|
|
- build |
|
|
- build |
|
|
- database |
|
|
|
|
|
- test: |
|
|
|
|
|
|
|
|
- tests: |
|
|
requires: |
|
|
requires: |
|
|
- build |
|
|
- build |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- db |
|
|
|
|
|
- e2e: |
|
|
|
|
|
requires: |
|
|
|
|
|
- db |
|
|
jobs: |
|
|
jobs: |
|
|
build: |
|
|
build: |
|
|
docker: |
|
|
docker: |
|
|
@ -19,10 +20,22 @@ jobs: |
|
|
steps: |
|
|
steps: |
|
|
- checkout |
|
|
- checkout |
|
|
- restore_cache: |
|
|
- restore_cache: |
|
|
key: yarn-packagesV3-{{ checksum "yarn.lock" }} |
|
|
|
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
- run: yarn global add node-gyp && yarn install |
|
|
- run: yarn global add node-gyp && yarn install |
|
|
- save_cache: |
|
|
- save_cache: |
|
|
key: yarn-packagesV3-{{ checksum "yarn.lock" }} |
|
|
|
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
|
|
|
paths: |
|
|
|
|
|
- ./node_modules |
|
|
|
|
|
tests: |
|
|
|
|
|
docker: |
|
|
|
|
|
- image: "circleci/node:12" |
|
|
|
|
|
steps: |
|
|
|
|
|
- checkout |
|
|
|
|
|
- restore_cache: |
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
|
|
|
- run: yarn test:ci |
|
|
|
|
|
- save_cache: |
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
paths: |
|
|
paths: |
|
|
- ./node_modules |
|
|
- ./node_modules |
|
|
lint: |
|
|
lint: |
|
|
@ -31,31 +44,44 @@ jobs: |
|
|
steps: |
|
|
steps: |
|
|
- checkout |
|
|
- checkout |
|
|
- restore_cache: |
|
|
- restore_cache: |
|
|
key: yarn-packagesV3-{{ checksum "yarn.lock" }} |
|
|
|
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
- run: yarn lint && yarn format:check |
|
|
- run: yarn lint && yarn format:check |
|
|
test: |
|
|
|
|
|
|
|
|
- save_cache: |
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
|
|
|
paths: |
|
|
|
|
|
- ./node_modules |
|
|
|
|
|
db: |
|
|
docker: |
|
|
docker: |
|
|
- image: "circleci/node:12" |
|
|
|
|
|
|
|
|
- image: circleci/postgres:alpine |
|
|
|
|
|
environment: |
|
|
|
|
|
PG_USER: circleci-demo-go |
|
|
|
|
|
PG_DB: circle_test |
|
|
|
|
|
|
|
|
steps: |
|
|
steps: |
|
|
- checkout |
|
|
- checkout |
|
|
- restore_cache: |
|
|
- restore_cache: |
|
|
key: yarn-packagesV3-{{ checksum "yarn.lock" }} |
|
|
|
|
|
- run: yarn test:ci |
|
|
|
|
|
database: |
|
|
|
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
|
|
|
|
|
|
|
|
|
- save_cache: |
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
|
|
|
paths: |
|
|
|
|
|
- ./node_modules |
|
|
|
|
|
e2e: |
|
|
docker: |
|
|
docker: |
|
|
- image: "circleci/node:12" |
|
|
- image: "circleci/node:12" |
|
|
|
|
|
steps: |
|
|
|
|
|
- checkout |
|
|
|
|
|
- restore_cache: |
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
|
|
|
- run: |
|
|
|
|
|
command: yarn test:e2e |
|
|
environment: |
|
|
environment: |
|
|
DATABASE_URL: postgres://psqluer:psqlpassword@localhost:5432/psdb |
|
|
|
|
|
JWT_SECRET: passedb |
|
|
|
|
|
|
|
|
DATABASE_URL: postgres://$PG_USER@localhost:5432/$PG_DB |
|
|
|
|
|
JWT_SECRET: yeet |
|
|
API_PORT: 3000 |
|
|
API_PORT: 3000 |
|
|
API_HOST: localhost |
|
|
API_HOST: localhost |
|
|
API_PROTOCOL: http |
|
|
API_PROTOCOL: http |
|
|
- image: "circleci/postgres:9.6.2-alpine" |
|
|
|
|
|
environment: |
|
|
|
|
|
POSTGRES_USER: psqluer |
|
|
|
|
|
POSTGRES_PASSWORD: psqlpassword |
|
|
|
|
|
steps: |
|
|
|
|
|
- checkout |
|
|
|
|
|
- restore_cache: |
|
|
|
|
|
key: yarn-packagesV3-{{ checksum "yarn.lock" }} |
|
|
|
|
|
- run: yarn yarn test:e2e |
|
|
|
|
|
|
|
|
- save_cache: |
|
|
|
|
|
key: yarn-packages-v3{{ checksum "yarn.lock" }} |
|
|
|
|
|
paths: |
|
|
|
|
|
- ./node_modules |