patrickmichalina/typescript-monads

View on GitHub
circle.yml

Summary

Maintainability
Test Coverage
defaults: &defaults
  docker:
    - image: cimg/node:18.12.0

version: 2
jobs:
    build:
      <<: *defaults
      steps:
        - checkout
        - restore_cache:
            key: dependency-cache-{{ checksum "package.json" }}
        - run:
            name: Install npm
            command: npm ci
        - run:
            name: Build
            command: npm run build
        - run:
            name: Check code quality
            command: npm run lint
        - run:
            name: Setup Code Climate test-reporter
            command: |
                curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
                chmod +x ./cc-test-reporter
        - run:
            name: Before-Test
            command: ./cc-test-reporter before-build
        - run:
            name: Execute Tests
            command: npm test
        - run:
            name: After-Test
            command: ./cc-test-reporter after-build --coverage-input-type lcov --exit-code $?
        - save_cache:
            key: dependency-cache-{{ checksum "package.json" }}
            paths:
              - node_modules
    semver:
        <<: *defaults
        steps:
        - checkout
        - restore_cache:
            key: dependency-cache-{{ checksum "package.json" }}
        - run:
            name: Install npm
            command: npm install
        - run:
            name: Prep Dist Folder
            command: npm run dist
        - run:
            name: Build
            command: npm run build
        - run:
            name: Semantic Release
            command: node_modules/.bin/semantic-release

workflows:
  version: 2
  build_test_release:
    jobs:
      - build
      - semver:
          requires:
            - build
          filters:
            branches:
              only: master