message: ci: update circleci yml
diff: @@ -3,18 +3,30 @@ jobs:
  build:
  docker:
  - image: node:6
  - working_directory: ~/wd
  + working_directory: ~/working_directory
  steps:
  - checkout
  - run:
  name: Trigger Jobs
  + # Generate CircleCI API token with `all` privilege and set to $CIRCLE_API_TOKEN
  command: |
  function trigger_job() {
  job_name=$1
  - curl --user ${CIRCLE_API_TOKEN}: \
  + echo "trigger_job $job_name"
  + http_code=$(curl --user ${CIRCLE_API_TOKEN}: \
  --data build_parameters[CIRCLE_JOB]=$job_name \
  --data revision=$CIRCLE_SHA1 \
  - https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/$CIRCLE_BRANCH
  + -o curl.output \
  + -w '%{http_code}\n' \
  + -s \
  + https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/$CIRCLE_BRANCH)
  + cat curl.output
  + echo ""
  + echo "http_code: $http_code"
  + if [[ ! "$http_code" =~ ^20[0-9]$ ]]; then
  + echo "Bad status code: $http_code" >&2
  + return 1
  + fi
  }
  trigger_job node-v4
  trigger_job node-v6
  @@ -25,7 +37,7 @@ jobs:
  - image: node
  environment:
  TEST_REPORTS: /tmp/test-reports
  - working_directory: ~/wd
  + working_directory: ~/working_directory
  steps:
  - run:
  name: Versions
  @@ -35,8 +47,9 @@ jobs:
  - checkout
  - restore_cache:
  keys:
  - - v1-yarn-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
  - - v1-yarn-master-{{ .Environment.CIRCLE_JOB }}
  + - v{{ .Environment.CIRCLE_CACHE_VERSION }}-yarn-lock-{{ checksum "yarn.lock" }}-{{ .Environment.CIRCLE_JOB }}
  + - v{{ .Environment.CIRCLE_CACHE_VERSION }}-yarn-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
  + - v{{ .Environment.CIRCLE_CACHE_VERSION }}-yarn-cache-master-{{ .Environment.CIRCLE_JOB }}
  - run:
  name: Install dependencies
  command: yarn install
  @@ -44,14 +57,22 @@ jobs:
  name: Test
  command: |
  mkdir -p $TEST_REPORTS
  + # Will be fixed in yarn v0.23
  # https://github.com/yarnpkg/yarn/pull/2843
  # yarn test
  npm test
  - save_cache:
  - key: v1-yarn-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-#{{ .BuildNum }}
  + key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-yarn-lock-{{ checksum "yarn.lock" }}-{{ .Environment.CIRCLE_JOB }}
  + paths:
  + - node_modules
  + - save_cache:
  + key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-yarn-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-#{{ .BuildNum }}
  paths:
  - ~/.cache/yarn
  - store_test_results:
  + # Variables are not available in `path`
  + # https://discuss.circleci.com/t/can-i-use-variables-in-cache-paths/11393
  + # path: {{ .Environment.TEST_REPORTS }}
  path: /tmp/test-reports
  node-v4:
  