diff --git a/.circleci/config.yml b/.circleci/config.yml index 505baea..98b15ad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,10 +33,7 @@ jobs: - restore_cache: key: yarn-packages-v2{{ checksum "yarn.lock" }} - run: yarn test:ci - - save_cache: - key: yarn-packages-v2{{ checksum "yarn.lock" }} - paths: - - ./node_modules + lint: docker: - image: cimg/node:14.10.1 @@ -45,26 +42,27 @@ jobs: - restore_cache: key: yarn-packages-v2{{ checksum "yarn.lock" }} - run: yarn lint && yarn format:check - - save_cache: - key: yarn-packages-v2{{ checksum "yarn.lock" }} - paths: - - ./node_modules e2e: docker: - - image: cimg/node:14.10.1 - steps: - - checkout - - restore_cache: - key: yarn-packages-v2{{ checksum "yarn.lock" }} - - run: - command: yarn test:e2e - environment: - DATABASE_URL: postgres://circleci-demo-go:toto@localhost:5432/circle_test - JWT_SECRET: yeet - API_PORT: 3000 - API_HOST: localhost - API_PROTOCOL: http - - save_cache: - key: yarn-packages-v2{{ checksum "yarn.lock" }} - paths: - - ./node_modules \ No newline at end of file + - image: cimg/node:14.10.1 + - image: circleci/postgres + environment: + POSTGRES_USER: e2e + POSTGRES_DB: psdb + POSTGRES_PASSWORD: test + steps: + - checkout + - restore_cache: + key: yarn-packages-v2{{ checksum "yarn.lock" }} + - run: + name: Waiting for POSTGRES + command: dockerize -wait tcp://localhost:5432 -timeout 1m + - run: + name: Launching e2e test + command: yarn test:e2e + environment: + DATABASE_URL: "postgres://e2e:test@localhost:5432/psdb" + API_PORT: 3000 + API_HOST: localhost + API_PROTOCOL: http + JWT_SECRET: yeet \ No newline at end of file