Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
config.yml 20.27 KiB
defaults: &defaults
  working_directory: /home/circleci/metabase/metabase/
  docker:
    - image: circleci/clojure:lein-2.8.1-node-browsers

restore-be-deps-cache: &restore-be-deps-cache
  keys:
    - be-deps-{{ checksum "project.clj" }}
    - be-deps-

restore-fe-deps-cache: &restore-fe-deps-cache
  keys:
    - fe-deps-{{ checksum "yarn.lock" }}
    - fe-deps-

version: 2.1
jobs:

########################################################################################################################
#                                                       CHECKOUT                                                       #
########################################################################################################################

  checkout:
    <<: *defaults
    steps:
      - restore_cache:
          keys:
            - source-{{ .Branch }}-{{ .Revision }}
            - source-{{ .Branch }}
            - source-
      - checkout
      - save_cache:
          key: source-{{ .Branch }}-{{ .Revision }}
          paths:
            - .git
      # The basic idea here is to generate a file with checksums for all the backend source files, and save it as
      # `./backend-checksums.txt`. Then we'll use the checksum of that files for uberjar caching; thus we can reuse
      # the same uberjar for integration tests across any build where the backend files are the same
      - run:
          name: Generate checksums of all backend source files to use as Uberjar cache key
          command: >
            for file in `find ./src -type f -name '*.clj' | sort`;
              do echo `md5sum $file` >> backend-checksums.txt;
            done
      - persist_to_workspace:
          root: /home/circleci/
          paths:
            - metabase/metabase

########################################################################################################################
#                                                       BACKEND                                                        #
########################################################################################################################

  be-deps:
    <<: *defaults
    steps:
      - attach_workspace:
          at: /home/circleci/
      - restore_cache:
          <<: *restore-be-deps-cache
      - run: lein deps
      - save_cache:
          key: be-deps-{{ checksum "project.clj" }}
          paths:
            - /home/circleci/.m2

  be-tests:
    <<: *defaults
    steps:
      - attach_workspace: