<commit_before>defaults: &defaults
    working_directory: /home/circleci/src/github.com/bankrs/bosgo

buildsteps: &buildsteps
    steps:
      - checkout

      - run: mkdir -p $TEST_RESULTS

      - run: go get github.com/jstemmer/go-junit-report

      - run:
          name: go vet
          command: |
            go vet ./... | tee ${TEST_RESULTS}/go-vet-${VERSION}.out

      - run:
          name: go test
          command: |
            trap "/home/circleci/bin/go-junit-report <${TEST_RESULTS}/go-test-${VERSION}.out > ${TEST_RESULTS}/go-test-report-${VERSION}.xml" EXIT
            go test ./... | tee ${TEST_RESULTS}/go-test-${VERSION}.out

      - run:
          name: go test -race
          command: |
            go test -race ./... | tee ${TEST_RESULTS}/go-test-race-${VERSION}.out

      - store_artifacts:
          path: /tmp/test-results
          destination: raw-test-output

      - store_test_results:
          path: /tmp/test-results


jobs:
  go-latest:
    <<: *defaults
    environment:
      GOPATH: /home/circleci
      TEST_RESULTS: /tmp/test-results
      VERSION: latest
    docker:
      - image: golang:latest
    <<: *buildsteps

  go-1.8:
    <<: *defaults
    environment:
      GOPATH: /home/circleci
      TEST_RESULTS: /tmp/test-results
      VERSION: 1.8
    docker:
      - image: golang:1.8
    <<: *buildsteps

workflows:
  version: 2
  build_and_test:
    jobs:
      - go-latest
      - go-1.8<commit_msg>Travis: add go-1.9 job<commit_after>defaults: &defaults
    working_directory: /home/circleci/src/github.com/bankrs/bosgo

buildsteps: &buildsteps
    steps:
      - checkout

      - run: mkdir -p $TEST_RESULTS

      - run: go get github.com/jstemmer/go-junit-report

      - run:
          name: go vet
          command: |
            go vet ./... | tee ${TEST_RESULTS}/go-vet-${VERSION}.out

      - run:
          name: go test
          command: |
            trap "/home/circleci/bin/go-junit-report <${TEST_RESULTS}/go-test-${VERSION}.out > ${TEST_RESULTS}/go-test-report-${VERSION}.xml" EXIT
            go test ./... | tee ${TEST_RESULTS}/go-test-${VERSION}.out

      - run:
          name: go test -race
          command: |
            go test -race ./... | tee ${TEST_RESULTS}/go-test-race-${VERSION}.out

      - store_artifacts:
          path: /tmp/test-results
          destination: raw-test-output

      - store_test_results:
          path: /tmp/test-results


jobs:
  go-latest:
    <<: *defaults
    environment: &job-environment
      GOPATH: /home/circleci
      TEST_RESULTS: /tmp/test-results
      VERSION: latest
    docker:
      - image: golang:latest
    <<: *buildsteps

  go-1.9:
    <<: *defaults
    environment:
      <<: *job-environment
      VERSION: 1.9
    docker:
      - image: golang:1.9
    <<: *buildsteps

  go-1.8:
    <<: *defaults
    environment:
      <<: *job-environment
      VERSION: 1.8
    docker:
      - image: golang:1.8
    <<: *buildsteps

workflows:
  version: 2
  build_and_test:
    jobs:
      - go-latest
      - go-1.9
      - go-1.8
{'fraction_non_alphanumeric': 0.13991500490356326, 'fraction_numerical': 0.009153318077803204, 'mean_word_length': 1.7567567567567568, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1160706', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1006, 'n_words': 195}