jeffy-g/rm-cstyle-cmts

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

orbs:
  codecov: codecov/codecov@4.1.0
  # The Node.js orb contains a set of prepackaged CircleCI configuration you can utilize
  # Orbs reduce the amount of configuration required for common tasks.
  # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/node
  node: circleci/node@5.2.0
jobs:
  # Below is the definition of your job to build and test your app, you can rename and customize it as you want.
  build-and-test:
    # These next lines define a Docker executor: https://circleci.com/docs/2.0/executor-types/
    # You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
    # A list of available CircleCI Docker Convenience Images are available here: https://circleci.com/developer/images/image/cimg/node
    docker:
      - image: cimg/node:22.3
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
            - v1-deps-{{ checksum "yarn.lock" }}
            - v1-deps-
      - run:
          name: install packages
          command: |
            yarn install
      - save_cache:
          key: v1-deps-{{ checksum "yarn.lock" }}
          paths:
            - node_modules
      - run:
          name: lint, build
          command: |
            echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -"
            echo '                   lint -> build'
            echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -"
            npm run all
      - run:
          name: Run benchmark
          command: |
            echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -"
            echo '                   run benchmark'
            echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -"
            npm run bench
            npm run benchmark
      - run:
          name: Run tests
          command: |
            echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -"
            echo '                     run tests'
            echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -"
            npm run test

      - codecov/upload:
          file: "./coverage/coverage-final.json"

      - store_test_results:
          path: test-results

    # The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass
    resource_class: large

workflows:
  flows:
    jobs:
      - build-and-test