|
| 1 | +# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/ |
| 2 | +version: 2 # use CircleCI 2.0 |
| 3 | +jobs: # a collection of steps |
| 4 | + build: # runs not using Workflows must have a `build` job as entry point |
| 5 | + docker: # run the steps with Docker |
| 6 | + - image: circleci/node:lts # ...with this image as the primary container; this is where all `steps` will run |
| 7 | + steps: |
| 8 | + - checkout |
| 9 | + - run: |
| 10 | + name: update-npm |
| 11 | + command: 'sudo npm install -g npm@latest' |
| 12 | + - run: |
| 13 | + name: Check current version of node |
| 14 | + command: node -v |
| 15 | + - run: |
| 16 | + name: Check current version of NPM |
| 17 | + command: npm -v |
| 18 | + |
| 19 | + - restore_cache: # special step to restore the dependency cache |
| 20 | + # Read about caching dependencies: https://circleci.com/docs/2.0/caching/ |
| 21 | + key: dependency-cache-{{ checksum "package.json" }} |
| 22 | + - run: |
| 23 | + name: install-npm-wee |
| 24 | + command: npm install |
| 25 | + - save_cache: # special step to save the dependency cache |
| 26 | + key: dependency-cache-{{ checksum "package.json" }} |
| 27 | + paths: |
| 28 | + - ./node_modules |
| 29 | + |
| 30 | + - run: # run tests |
| 31 | + name: test |
| 32 | + command: npm run ci |
| 33 | + |
| 34 | + - store_artifacts: # special step to save test results as as artifact |
| 35 | + # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ |
| 36 | + path: test-results.xml |
| 37 | + prefix: tests |
| 38 | + - store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ |
| 39 | + path: coverage |
| 40 | + prefix: coverage |
| 41 | + - store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/ |
| 42 | + path: test-results.xml |
0 commit comments