<commit_before>version: 2
jobs:
    dapp_lint:
        docker:
            - image: node:8.7
        working_directory: ~/project/dapp
        steps:
            - checkout:
                path: ~/project
            - restore_cache:
                keys:
                    - dapp1-modules-{{ checksum "yarn.lock" }}
                    - dapp1-modules
            - run: yarn
            - save_cache:
                key: dapp1-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run: node_modules/.bin/solium --dir contracts/

    dapp_coverage:
        docker:
            - image: node:8.7
        working_directory: ~/project/dapp
        steps:
            - checkout:
                path: ~/project
            - restore_cache:
                keys:
                    - dapp1-modules-{{ checksum "yarn.lock" }}
                    - dapp1-modules
            - run: yarn
            - save_cache:
                key: dapp1-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run: yarn run solidity-coverage
            - store_artifacts:
                path: ~/project/dapp/coverage

    dapp_test:
        docker:
            - image: node:8.7
        working_directory: ~/project/dapp
        steps:
            - checkout:
                path: ~/project
            - run: mkdir ~/project/dapp/junit
            - restore_cache:
                keys:
                    - dapp1-modules-{{ checksum "yarn.lock" }}
                    - dapp1-modules
            - run: yarn
            - save_cache:
                key: dapp1-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run:
                command: sh test.sh
                environment:
                    MOCHA_FILE: junit/test-results.xml
            - store_test_results:
                path: ~/project/dapp/junit
            - store_artifacts:
                path: ~/project/dapp/junit
    
    getline_ts_build:
        docker:
            - image: getline/ci-frontend:latest
        working_directory: ~/project/getline.ts
        steps:
            - checkout:
                path: ~/project
            - restore_cache:
                keys:
                    - getlinets2-modules-{{ checksum "yarn.lock" }}
                    - getlinets2-modules
            - run: yarn
            - save_cache:
                key: getlinets2-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run:
                command: yarn generate
            - run:
                command: yarn tsc
        
    frontend_build:
        docker:
            - image: getline/ci-frontend:latest
        working_directory: ~/project/frontend
        steps:
            - checkout:
                path: ~/project
            - restore_cache:
                keys:
                    - frontend2-modules-{{ checksum "yarn.lock" }}
                    - frontend2-modules
            - run: yarn
            - save_cache:
                key: frontend2-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run:
                command: yarn build
            - store_artifacts:
                path: ~/project/frontend/dist

workflows:
    version: 2
    frontend:
        jobs:
            - getline_ts_build
            - frontend_build:
                requires:
                  - getline_ts_build
    dapp:
        jobs:
            - dapp_test
            - dapp_lint
            - dapp_coverage<commit_msg>Persist getline.ts build in workspace<commit_after>version: 2
jobs:
    dapp_lint:
        docker:
            - image: node:8.7
        working_directory: ~/project/dapp
        steps:
            - checkout:
                path: ~/project
            - restore_cache:
                keys:
                    - dapp1-modules-{{ checksum "yarn.lock" }}
                    - dapp1-modules
            - run: yarn
            - save_cache:
                key: dapp1-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run: node_modules/.bin/solium --dir contracts/

    dapp_coverage:
        docker:
            - image: node:8.7
        working_directory: ~/project/dapp
        steps:
            - checkout:
                path: ~/project
            - restore_cache:
                keys:
                    - dapp1-modules-{{ checksum "yarn.lock" }}
                    - dapp1-modules
            - run: yarn
            - save_cache:
                key: dapp1-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run: yarn run solidity-coverage
            - store_artifacts:
                path: ~/project/dapp/coverage

    dapp_test:
        docker:
            - image: node:8.7
        working_directory: ~/project/dapp
        steps:
            - checkout:
                path: ~/project
            - run: mkdir ~/project/dapp/junit
            - restore_cache:
                keys:
                    - dapp1-modules-{{ checksum "yarn.lock" }}
                    - dapp1-modules
            - run: yarn
            - save_cache:
                key: dapp1-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run:
                command: sh test.sh
                environment:
                    MOCHA_FILE: junit/test-results.xml
            - store_test_results:
                path: ~/project/dapp/junit
            - store_artifacts:
                path: ~/project/dapp/junit
    
    getline_ts_build:
        docker:
            - image: getline/ci-frontend:latest
        working_directory: ~/project/getline.ts
        steps:
            - checkout:
                path: ~/project
            - restore_cache:
                keys:
                    - getlinets2-modules-{{ checksum "yarn.lock" }}
                    - getlinets2-modules
            - run: yarn
            - save_cache:
                key: getlinets2-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run:
                command: yarn generate
            - run:
                command: yarn tsc
            - run:
                command: mkdir -p /tmp/workspace && cp -rv dist /tmp/workspace/getline.ts-dist
            - persist_to_workspace:
                root: /tmp/workspace
                paths: getline.ts-dist
        
    frontend_build:
        docker:
            - image: getline/ci-frontend:latest
        working_directory: ~/project/frontend
        steps:
            - checkout:
                path: ~/project
            - attach_workspace:
                at: /tmp/workspace
            - restore_cache:
                keys:
                    - frontend2-modules-{{ checksum "yarn.lock" }}
                    - frontend2-modules
            - run: yarn
            - save_cache:
                key: frontend2-modules-{{ checksum "yarn.lock" }}
                paths:
                    - node_modules/
            - run:
                command: rm -rf ~/rpoject/getline.ts/dist && cp -rv /tmp/workspace/getline.ts-dist ~/project/getline.ts/dist
            - run:
                command: yarn build
            - store_artifacts:
                path: ~/project/frontend/dist

workflows:
    version: 2
    frontend:
        jobs:
            - getline_ts_build
            - frontend_build:
                requires:
                  - getline_ts_build
    dapp:
        jobs:
            - dapp_test
            - dapp_lint
            - dapp_coverage
{'fraction_non_alphanumeric': 0.08984725965858041, 'fraction_numerical': 0.00590424849184957, 'mean_word_length': 0.9568056253139126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2183068', 'n_tokens_mistral': 2214, 'n_tokens_neox': 2063, 'n_words': 397}