CircleCI and tools.deps

The following yaml file is a basic setup for CircleCI when using tools.deps. The main issue I struggled with and that took me well over an hour to resolve is that CircleCI includes a default .gitconfig in their docker images. This results in a Authentication failure whenever you have a git coordinate in your deps.edn . The cure is to get rid of that config before you do any dependency loading.

# Clojure CircleCI 2.0 configuration file
#
version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: circleci/clojure:openjdk-11-tools-deps-1.10.1.727
      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/postgres:9.4
    working_directory: ~/repo
    environment:
      # Customize the JVM maximum heap limit
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      # This is important as otherwise a :git/url coordinate in your 
      # deps.edn fails.
      - run:
          name: Get rid of erroneous git config
          command: |
              rm -rf ~/.gitconfig
      # Download and cache dependencies
      - restore_cache:
          keys:
            - v1-dependencies-{{ checksum "deps.edn" }}
            # fallback to using the latest cache if no exact match is found
            - v1-dependencies-
      
      # Adapt to aliase you need
      - run: clojure -P -M:test
      - save_cache:
          paths:
            - ~/.m2
          key: v1-dependencies-{{ checksum "deps.edn" }}
      # run tests!
      - run: clojure -M:test -m cognitect.test-runner
YAML