Skip to content

Commit

Permalink
circle-ci speed: multiple parallel build jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xadada committed Feb 1, 2018
1 parent 8175dbe commit 7bc4b65
Showing 1 changed file with 69 additions and 16 deletions.
85 changes: 69 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,93 @@ version: 2

# Reusable definitions shared between jobs
defs:
defaults: &defaults
docker:
- image: circleci/node:carbon-browsers
working_directory: ~/app
steps:
step-update-path: &step-update-path
name: Update $PATH
step-update-env: &step-update-env
name: Update environment
command: |
echo "export PATH=$PATH:$(yarn global bin)" >> $BASH_ENV
echo "export PATH=$PATH:$(yarn global bin):~/app/node_modules/.bin" >> $BASH_ENV
git config --global user.email "$CIRCLECI_EMAIL"
git config --global user.name "Circle CI Build Bot"
jobs:
build:
docker:
- image: circleci/node:carbon-browsers
checkout_code:
<<: *defaults
steps:
- checkout
- run:
name: Configure build environment
command: |
git config --global user.email "$CIRCLECI_EMAIL"
git config --global user.name "Circle CI Build Bot"
- persist_to_workspace:
root: .
paths:
- .
install_dependencies:
<<: *defaults
steps:
- attach_workspace:
at: .
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
keys:
- dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
- dependency-cache-{{ .Branch }}-
- dependency-cache-
- run:
name: Install dependencies
command: |
yarn global add [email protected]
yarn
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- persist_to_workspace:
root: .
paths:
- .
lint:
<<: *defaults
steps:
- attach_workspace:
at: .
- run:
<<: *step-update-env
- run:
name: Run linters
command: |
yarn lint
test:
<<: *defaults
steps:
- attach_workspace:
at: .
- run:
<<: *step-update-path
<<: *step-update-env
- run:
name: Run tests
name: Ember build
command: |
npm rebuild node-sass 2>&1 > /dev/null
ember --version --verbose
yarn test
# see: https://github.com/stefanpenner/broccoli-persistent-filter#warning
BROCCOLI_PERSISTENT_FILTER_CACHE_ROOT=cache; COVERAGE=true ember build -e test --output-path=dist
- run:
name: Ember test
command: |
ember --version --verbose
BROCCOLI_PERSISTENT_FILTER_CACHE_ROOT=cache; yarn test --path=dist
yarn coverage
workflows:
version: 2
build_lint_test:
jobs:
- checkout_code
- install_dependencies:
requires:
- checkout_code
- lint:
requires:
- install_dependencies
- test:
requires:
- install_dependencies

0 comments on commit 7bc4b65

Please sign in to comment.