prebid/Prebid.js

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
#

aliases:
  - &environment
      docker:
        # specify the version you desire here
        - image: cimg/node:20.14.0-browsers
      resource_class: xlarge
        # Specify service dependencies here if necessary
        # CircleCI maintains a library of pre-built images
        # documented at https://circleci.com/docs/2.0/circleci-images/
        # - image: circleci/mongo:3.4.4
      working_directory: ~/Prebid.js

  - &restore_dep_cache
      keys:
        - v1-dependencies-{{ checksum "package.json" }}

  - &save_dep_cache
      paths:
        - node_modules
      key: v1-dependencies-{{ checksum "package.json" }}

  - &install
      name: Install gulp cli
      command: sudo npm install -g gulp-cli

  - &run_unit_test
      name: BrowserStack testing
      command: gulp test --browserstack --nolintfix

  - &run_endtoend_test
      name: BrowserStack End to end testing
      command: gulp e2e-test

  - &unit_test_steps
    - checkout
    - restore_cache: *restore_dep_cache
    - run: npm ci
    - save_cache: *save_dep_cache
    - run: *install
    - run: *run_unit_test

  - &endtoend_test_steps
    - checkout
    - restore_cache: *restore_dep_cache
    - run: npm install
    - save_cache: *save_dep_cache
    - run: *install
    - run: *run_endtoend_test

version: 2
jobs:
  build:
    <<: *environment
    steps: *unit_test_steps

  e2etest:
    <<: *environment
    steps: *endtoend_test_steps

workflows:
  version: 2
  commit:
    jobs:
      - build
      - e2etest:
          requires:
            - build

experimental:
  pipelines: true