---
version: 2
jobs:
  serverTest:
    docker:
      - image: isic/isic_test:latest
      - image: circleci/mongo:3.6-ram
        command: ["mongod", "--storageEngine", "ephemeralForTest"]

    working_directory: /home/circleci/project

    steps:
      - checkout:
          path: /home/circleci/project

      - run:
          name: Run Tox
          command: tox

  webBuild_webTest:
    docker:
      - image: isic/isic_test:latest

    working_directory: /home/circleci/project

    steps:
      - checkout:
          path: /home/circleci/project
      - restore_cache:
          key: yarn-{{ arch }}-{{ checksum "isic-archive-gui/yarn.lock" }}
      - run:
          name: Install ISIC GUI dependencies
          command: yarn install
          working_directory: isic-archive-gui
      - run:
          name: Build ISIC Admin GUI
          command: yarn run build
          working_directory: isic-archive-gui
      - run:
          name: Build ISIC Integration GUI
          command: yarn run build:integration
          working_directory: isic-archive-gui
      - run:
          name: Lint ISIC GUI
          command: yarn run lint --no-fix
          working_directory: isic-archive-gui
      - save_cache:
          paths: /home/circleci/.cache/yarn
          key: yarn-{{ arch }}-{{ checksum "isic-archive-gui/yarn.lock" }}

workflows:
  version: 2
  test_all:
    jobs:
      - serverTest
      - webBuild_webTest

---
version: 2
jobs:
  serverTest:
    docker:
      - image: isic/isic_test:latest
      - image: circleci/mongo:3.6-ram
        command: ["mongod", "--storageEngine", "ephemeralForTest", "--dbpath", "/dev/shm/mongo"]

    working_directory: /home/circleci/project

    steps:
      - checkout:
          path: /home/circleci/project

      - run:
          name: Run Tox
          command: tox

  webBuild_webTest:
    docker:
      - image: isic/isic_test:latest

    working_directory: /home/circleci/project

    steps:
      - checkout:
          path: /home/circleci/project
      - restore_cache:
          key: yarn-{{ arch }}-{{ checksum "isic-archive-gui/yarn.lock" }}
      - run:
          name: Install ISIC GUI dependencies
          command: yarn install
          working_directory: isic-archive-gui
      - run:
          name: Build ISIC Admin GUI
          command: yarn run build
          working_directory: isic-archive-gui
      - run:
          name: Build ISIC Integration GUI
          command: yarn run build:integration
          working_directory: isic-archive-gui
      - run:
          name: Lint ISIC GUI
          command: yarn run lint --no-fix
          working_directory: isic-archive-gui
      - save_cache:
          paths: /home/circleci/.cache/yarn
          key: yarn-{{ arch }}-{{ checksum "isic-archive-gui/yarn.lock" }}

workflows:
  version: 2
  test_all:
    jobs:
      - serverTest
      - webBuild_webTest

Revert "Remove unnecessary mongo flag for CI"
Revert "Remove unnecessary mongo flag for CI"
