|
| 1 | +version: 2 |
| 2 | +jobs: |
| 3 | + setup: |
| 4 | + docker: |
| 5 | + - image: ${AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/analytics.js-integrations-ci |
| 6 | + steps: |
| 7 | + - run: |
| 8 | + name: Checkout code |
| 9 | + command: checkout |
| 10 | + - restore_cache: |
| 11 | + key: deps-{{ checksum "yarn.lock" }} |
| 12 | + - run: |
| 13 | + name: Authenticate npm |
| 14 | + command: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH |
| 15 | + - run: |
| 16 | + name: Install |
| 17 | + command: yarn install --frozen-lockfile |
| 18 | + - save_cache: |
| 19 | + key: deps-{{ checksum "yarn.lock" }} |
| 20 | + paths: |
| 21 | + - node_modules |
| 22 | + - persist_to_workspace: |
| 23 | + root: . |
| 24 | + paths: [.] |
| 25 | + |
| 26 | + lint: |
| 27 | + docker: |
| 28 | + - image: ${AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/analytics.js-integrations-ci |
| 29 | + steps: |
| 30 | + - attach_workspace: { at: . } |
| 31 | + - restore_cache: |
| 32 | + key: deps-{{ checksum "yarn.lock" }} |
| 33 | + - run: |
| 34 | + name: Run Linter (not enforcing for now) |
| 35 | + command: yarn lint |
| 36 | + |
| 37 | + test: |
| 38 | + docker: |
| 39 | + - image: ${AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/analytics.js-integrations-ci |
| 40 | + steps: |
| 41 | + - attach_workspace: { at: . } |
| 42 | + - restore_cache: |
| 43 | + key: deps-{{ checksum "yarn.lock" }} |
| 44 | + - run: |
| 45 | + name: Run Tests |
| 46 | + command: yarn test |
| 47 | + |
| 48 | + test_saucelabs: |
| 49 | + docker: |
| 50 | + - image: ${AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/analytics.js-integrations-ci |
| 51 | + steps: |
| 52 | + - attach_workspace: { at: . } |
| 53 | + - restore_cache: |
| 54 | + key: deps-{{ checksum "yarn.lock" }} |
| 55 | + - run: |
| 56 | + name: Run Tests |
| 57 | + command: yarn test:ci |
| 58 | + |
| 59 | + test_snyk: |
| 60 | + docker: |
| 61 | + - image: ${AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/analytics.js-integrations-ci |
| 62 | + steps: |
| 63 | + - attach_workspace: { at: . } |
| 64 | + - restore_cache: |
| 65 | + key: deps-{{ checksum "yarn.lock" }} |
| 66 | + - run: |
| 67 | + name: Snyk Setup |
| 68 | + command: curl -sL https://github.com/raw/segmentio/snyk_helpers/master/initialization/snyk.sh | sh |
| 69 | + |
| 70 | + publish: |
| 71 | + docker: |
| 72 | + - image: ${AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/analytics.js-integrations-ci |
| 73 | + steps: |
| 74 | + - attach_workspace: { at: . } |
| 75 | + - restore_cache: |
| 76 | + key: deps-{{ checksum "yarn.lock" }} |
| 77 | + - run: |
| 78 | + name: Authenticate npm |
| 79 | + command: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH |
| 80 | + - run: |
| 81 | + name: Publish packages |
| 82 | + command: yarn lerna publish from-package --yes |
| 83 | + |
| 84 | +workflows: |
| 85 | + version: 2 |
| 86 | + test: |
| 87 | + jobs: |
| 88 | + - setup |
| 89 | + - lint: |
| 90 | + requires: |
| 91 | + - setup |
| 92 | + - test: |
| 93 | + requires: |
| 94 | + - setup |
| 95 | + - test_saucelabs: |
| 96 | + requires: |
| 97 | + - test |
| 98 | + - setup |
| 99 | + - test_snyk: |
| 100 | + requires: |
| 101 | + - setup |
| 102 | + - publish: |
| 103 | + requires: |
| 104 | + - test |
| 105 | + - test_saucelabs |
| 106 | + - test_snyk |
| 107 | + filters: |
| 108 | + branches: |
| 109 | + only: master |
0 commit comments