<commit_before>version: 2.1

executors:
  golang:
    docker:
      - image: cimg/go:1.14

commands:
  attach_to_workspace:
    steps:
      - attach_workspace:
          at: ~/

  save_module_cache:
    steps:
      - save_cache:
          key: cimg-go-pkg-mod-{{ checksum "go.sum" }}
          paths:
            - "/home/circleci/go/pkg/mod"

  restore_module_cache:
    steps:
      - run:
          name: create modules dir
          command: mkdir -p ~/go/pkg/mod
      - restore_cache: # restores saved cache if no changes are detected since last run
          keys:
            - cimg-go-pkg-mod-{{ checksum "go.sum" }}
      - persist_to_workspace:
          root: ~/
          paths: go/pkg/mod

workflows:
  version: 2
  build-and-test:
    jobs:
      - setup-and-lint
      - build:
          requires:
            - setup-and-lint
      - cross-compile:
          requires:
            - build
      - loadtest:
          requires:
            - build
      - test:
          requires:
            - setup-and-lint
      - gosec:
          requires:
            - setup-and-lint
      - coverage:
          requires:
            - setup-and-lint
      - publish-stable:
          requires:
            - cross-compile
            - loadtest
            - test
            - gosec
            - coverage
          filters:
            branches:
              ignore: /.*/
            tags:
              only: /^v[0-9].[0-9].[0-9]+.*/

jobs:
  setup-and-lint:
    executor: golang<commit_msg>Enable publishing releases from tags (#749)<commit_after>version: 2.1

executors:
  golang:
    docker:
      - image: cimg/go:1.14

commands:
  attach_to_workspace:
    steps:
      - attach_workspace:
          at: ~/

  save_module_cache:
    steps:
      - save_cache:
          key: cimg-go-pkg-mod-{{ checksum "go.sum" }}
          paths:
            - "/home/circleci/go/pkg/mod"

  restore_module_cache:
    steps:
      - run:
          name: create modules dir
          command: mkdir -p ~/go/pkg/mod
      - restore_cache: # restores saved cache if no changes are detected since last run
          keys:
            - cimg-go-pkg-mod-{{ checksum "go.sum" }}
      - persist_to_workspace:
          root: ~/
          paths: go/pkg/mod

workflows:
  version: 2
  build-and-test:
    jobs:
      - setup-and-lint:
          filters:
            tags:
              only: /^v([0-9])+.([0-9])+.([0-9])+.*/
      - build:
          requires:
            - setup-and-lint
          filters:
            tags:
              only: /^v([0-9])+.([0-9])+.([0-9])+.*/
      - cross-compile:
          requires:
            - build
          filters:
            tags:
              only: /^v([0-9])+.([0-9])+.([0-9])+.*/
      - loadtest:
          requires:
            - build
          filters:
            tags:
              only: /^v([0-9])+.([0-9])+.([0-9])+.*/
      - test:
          requires:
            - setup-and-lint
          filters:
            tags:
              only: /^v([0-9])+.([0-9])+.([0-9])+.*/
      - gosec:
          requires:
            - setup-and-lint
          filters:
            tags:
              only: /^v([0-9])+.([0-9])+.([0-9])+.*/
      - coverage:
          requires:
            - setup-and-lint
          filters:
            tags:
              only: /^v([0-9])+.([0-9])+.([0-9])+.*/
      - publish-stable:
          requires:
            - cross-compile
            - loadtest
            - test
            - gosec
            - coverage
          filters:
            branches:
              ignore: /.*/
            tags:
              only: /^v([0-9])+.([0-9])+.([0-9])+.*/

jobs:
  setup-and-lint:
    executor: golang
{'fraction_non_alphanumeric': 0.14569176406632237, 'fraction_numerical': 0.018755096493612396, 'mean_word_length': 1.1076746849942727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2183049', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1186, 'n_words': 218}