|
| 1 | +unit_tests: &unit_tests |
| 2 | + steps: |
| 3 | + - checkout |
| 4 | + - restore_cache: |
| 5 | + key: dependency-cache-{{ checksum "package-lock.json" }} |
| 6 | + - run: |
| 7 | + name: Install Latest NPM. |
| 8 | + # npm@3 is buggy |
| 9 | + command: if [[ $(npm -v | cut -c -1) > 3 ]] ; then npm i -g npm@latest; else echo "Skip npm updating"; fi |
| 10 | + - run: |
| 11 | + name: NPM Install. |
| 12 | + command: npm ci || npm i |
| 13 | + - run: |
| 14 | + name: Run Test. |
| 15 | + command: npm run ci:test |
| 16 | +canary_tests: &canary_tests |
| 17 | + steps: |
| 18 | + - checkout |
| 19 | + - restore_cache: |
| 20 | + key: dependency-cache-{{ checksum "package-lock.json" }} |
| 21 | + - run: |
| 22 | + name: Install Latest NPM. |
| 23 | + command: npm i -g npm@latest |
| 24 | + - run: |
| 25 | + name: NPM Install. |
| 26 | + command: npm ci |
| 27 | + - run: |
| 28 | + name: Install Webpack Canary. |
| 29 | + command: npm i --no-save webpack@next |
| 30 | + - run: |
| 31 | + name: Run Test. |
| 32 | + command: if [[ $(compver --name webpack --gte next --lt latest) < 1 ]] ; then printf "Next is older than Latest - Skipping Canary Suite"; else npm run ci:test; fi |
| 33 | + |
| 34 | +version: 2 |
| 35 | +jobs: |
| 36 | + dependency_cache: |
| 37 | + docker: |
| 38 | + - image: webpackcontrib/circleci-node-base:latest |
| 39 | + steps: |
| 40 | + - checkout |
| 41 | + - restore_cache: |
| 42 | + key: dependency-cache-{{ checksum "package-lock.json" }} |
| 43 | + - run: |
| 44 | + name: Install Latest NPM. |
| 45 | + command: npm i -g npm@latest |
| 46 | + - run: |
| 47 | + name: NPM Install. |
| 48 | + command: npm ci |
| 49 | + - save_cache: |
| 50 | + key: dependency-cache-{{ checksum "package-lock.json" }} |
| 51 | + paths: |
| 52 | + - ./node_modules |
| 53 | + node6-latest: |
| 54 | + docker: |
| 55 | + - image: webpackcontrib/circleci-node6:latest |
| 56 | + <<: *unit_tests |
| 57 | + node8-latest: |
| 58 | + docker: |
| 59 | + - image: webpackcontrib/circleci-node8:latest |
| 60 | + <<: *unit_tests |
| 61 | + node10-latest: |
| 62 | + docker: |
| 63 | + - image: webpackcontrib/circleci-node10:latest |
| 64 | + steps: |
| 65 | + - checkout |
| 66 | + - restore_cache: |
| 67 | + key: dependency-cache-{{ checksum "package-lock.json" }} |
| 68 | + - run: |
| 69 | + name: Install Latest NPM. |
| 70 | + command: npm i -g npm@latest |
| 71 | + - run: |
| 72 | + name: NPM Install. |
| 73 | + command: npm ci |
| 74 | + - run: |
| 75 | + name: Run Test. |
| 76 | + command: npm run ci:coverage |
| 77 | + - run: |
| 78 | + name: Submit coverage data to codecov. |
| 79 | + command: bash <(curl -s https://codecov.io/bash) |
| 80 | + when: on_success |
| 81 | + node10-canary: |
| 82 | + docker: |
| 83 | + - image: webpackcontrib/circleci-node10:latest |
| 84 | + <<: *canary_tests |
| 85 | + analysis: |
| 86 | + docker: |
| 87 | + - image: webpackcontrib/circleci-node-base:latest |
| 88 | + steps: |
| 89 | + - checkout |
| 90 | + - restore_cache: |
| 91 | + key: dependency-cache-{{ checksum "package-lock.json" }} |
| 92 | + - run: |
| 93 | + name: Install Latest NPM. |
| 94 | + command: npm i -g npm@latest |
| 95 | + - run: |
| 96 | + name: NPM Install. |
| 97 | + command: npm ci |
| 98 | + - run: |
| 99 | + name: Run linting. |
| 100 | + command: npm run lint |
| 101 | + - run: |
| 102 | + name: Run NPM Audit. |
| 103 | + command: npm run security |
| 104 | + - run: |
| 105 | + name: Validate Commit Messages. |
| 106 | + command: npm run ci:lint:commits |
| 107 | + |
| 108 | +workflows: |
| 109 | + version: 2 |
| 110 | + test: |
| 111 | + jobs: |
| 112 | + - dependency_cache |
| 113 | + - analysis: |
| 114 | + requires: |
| 115 | + - dependency_cache |
| 116 | + filters: |
| 117 | + tags: |
| 118 | + only: /.*/ |
| 119 | + - node6-latest: |
| 120 | + requires: |
| 121 | + - dependency_cache |
| 122 | + filters: |
| 123 | + tags: |
| 124 | + only: /.*/ |
| 125 | + - node8-latest: |
| 126 | + requires: |
| 127 | + - analysis |
| 128 | + - node6-latest |
| 129 | + filters: |
| 130 | + tags: |
| 131 | + only: /.*/ |
| 132 | + - node10-latest: |
| 133 | + requires: |
| 134 | + - analysis |
| 135 | + - node6-latest |
| 136 | + filters: |
| 137 | + tags: |
| 138 | + only: /.*/ |
| 139 | + - node10-canary: |
| 140 | + requires: |
| 141 | + - analysis |
| 142 | + - node6-latest |
| 143 | + filters: |
| 144 | + tags: |
| 145 | + only: /.*/ |
0 commit comments