SuitestAutomation/suitest-js-api

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1

executors:
  node-14:
    docker:
      - image: cimg/node:14.21
  node-16:
    docker:
      - image: cimg/node:16.20
  node-18:
    docker:
      - image: cimg/node:18.19
  node-20:
    docker:
      - image: cimg/node:20.4

jobs:
  build:
    environment:
      CC_TEST_REPORTER_ID: b8382b02e5d130520012123a7fcc97b478a6294991078cdabb721315bd2a9dd9

    working_directory: ~/suitest-js-api

    parameters:
      version:
        type: string
    executor: node-<< parameters.version >>

    steps:
      - checkout

      - run: node --version

      - run:
          name: Install dependencies
          command: |
            npm ci

      # install code climate
      - 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 tests!
      - run:
          name: Run Unit Tests
          command: |
            npm run lint
            ./cc-test-reporter before-build
            npm run coverage
            ./cc-test-reporter after-build --coverage-input-type lcov --exit-code $?

      - run:
          name: Check TypeScript definitions
          command: |
            npm run test-definitions
workflows:
  workflow:
    jobs:
      - build:
          matrix:
            parameters:
              version: ["14", "16", "18", "20"]