<commit_before>defaults: &defaults
    working_directory: /tmp/ffxiv-teamcraft
    docker:
    - image: supamiu/circleci-node-wine


version: 2
jobs:
    setup:
        <<: *defaults
        steps:
        - checkout
        - run:
            name: Show current branch
            command: echo ${CIRCLE_BRANCH}
        - restore_cache:
            keys:
            - v1-dependencies-{{ checksum "package.json" }}
            - v1-dependencies-
        - run:
            name: Update npm
            command: npm i -g npm
        - run:
            name: Install local dependencies
            command: npm ci
        - run:
            name: Install functions dependencies
            command: cd functions && npm install && cd ../
        - save_cache:
            key: v1-dependencies-{{ checksum "package.json" }}
            paths:
            - node_modules
            - functions/node_modules
        - persist_to_workspace:
            root: /tmp
            paths:
            - ffxiv-teamcraft/*


    lint:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Lint code and JSON
            command: npm run lint


    test:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Testing
            command: npm run test
        - run:
            name: Codecov upload
            command: npm run codecov


    build:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Building
            command: |
                if [ "${CIRCLE_BRANCH}" == "master" ]; then
                    npm run build:prod
                elif [ "${CIRCLE_BRANCH}" == "5.0.0"]; then
                    npm run build:preview
                else
                    npm run build:beta
                fi
        - save_cache:
            key: dist-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
            paths:
            - dist
        - persist_to_workspace:
              root: /tmp
              paths:
                  - ffxiv-teamcraft/*


    deploy-web:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Deploying web
            command: ./node_modules/.bin/firebase deploy -P default --token "$FIREBASE_TOKEN"

    deploy-desktop:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Deploying desktop
            command: npm run electron:setup:publish


    deploy-staging:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Deploying web
            command: ./node_modules/.bin/firebase deploy -P beta --token "$FIREBASE_TOKEN"

    deploy-preview:
        <<: *defaults
        steps:
        - attach_workspace:
              at: /tmp
        - run:
              name: Deploying web
              command: ./node_modules/.bin/firebase deploy -P preview --token "$FIREBASE_TOKEN"


workflows:
    version: 2
    flow:
        jobs:
        - setup
        - lint:
              requires:
              - setup
        - build:
              requires:
              - lint
        - deploy-web:
              requires:
              - build
              filters:
                  branches:
                      only: master
        - deploy-desktop:
              requires:
                  - build
              filters:
                  branches:
                      only: master
        - deploy-staging:
              requires:
              - build
              filters:
                  branches:
                      only: staging
        - deploy-preview:
              requires:
              - build
              filters:
                  branches:
                      only: 5.0.0

<commit_msg>chore: more testing for CI<commit_after>defaults: &defaults
    working_directory: /tmp/ffxiv-teamcraft
    docker:
    - image: supamiu/circleci-node-wine


version: 2
jobs:
    setup:
        <<: *defaults
        steps:
        - checkout
        - run:
            name: Show current branch
            command: echo ${CIRCLE_BRANCH}
        - restore_cache:
            keys:
            - v1-dependencies-{{ checksum "package.json" }}
            - v1-dependencies-
        - run:
            name: Update npm
            command: sudo npm i -g npm
        - run:
            name: Install local dependencies
            command: npm ci
        - run:
            name: Install functions dependencies
            command: cd functions && npm install && cd ../
        - save_cache:
            key: v1-dependencies-{{ checksum "package.json" }}
            paths:
            - node_modules
            - functions/node_modules
        - persist_to_workspace:
            root: /tmp
            paths:
            - ffxiv-teamcraft/*


    lint:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Lint code and JSON
            command: npm run lint


    test:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Testing
            command: npm run test
        - run:
            name: Codecov upload
            command: npm run codecov


    build:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Building
            command: |
                if [ "${CIRCLE_BRANCH}" == "master" ]; then
                    npm run build:prod
                elif [ "${CIRCLE_BRANCH}" == "5.0.0"]; then
                    npm run build:preview
                else
                    npm run build:beta
                fi
        - save_cache:
            key: dist-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
            paths:
            - dist
        - persist_to_workspace:
              root: /tmp
              paths:
                  - ffxiv-teamcraft/*


    deploy-web:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Deploying web
            command: ./node_modules/.bin/firebase deploy -P default --token "$FIREBASE_TOKEN"

    deploy-desktop:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Deploying desktop
            command: npm run electron:setup:publish


    deploy-staging:
        <<: *defaults
        steps:
        - attach_workspace:
            at: /tmp
        - run:
            name: Deploying web
            command: ./node_modules/.bin/firebase deploy -P beta --token "$FIREBASE_TOKEN"

    deploy-preview:
        <<: *defaults
        steps:
        - attach_workspace:
              at: /tmp
        - run:
              name: Deploying web
              command: ./node_modules/.bin/firebase deploy -P preview --token "$FIREBASE_TOKEN"


workflows:
    version: 2
    flow:
        jobs:
        - setup
        - lint:
              requires:
              - setup
        - build:
              requires:
              - lint
        - deploy-web:
              requires:
              - build
              filters:
                  branches:
                      only: master
        - deploy-desktop:
              requires:
                  - build
              filters:
                  branches:
                      only: master
        - deploy-staging:
              requires:
              - build
              filters:
                  branches:
                      only: staging
        - deploy-preview:
              requires:
              - build
              filters:
                  branches:
                      only: 5.0.0


{'fraction_non_alphanumeric': 0.085501389239707, 'fraction_numerical': 0.0030310684516291994, 'mean_word_length': 0.9847117794486215, 'pattern_counts': {'":': 0, '<': 35, '<?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': '1506785', 'n_tokens_mistral': 2136, 'n_tokens_neox': 2022, 'n_words': 509}