-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
circle-ci speed: multiple parallel build jobs
- Loading branch information
Showing
1 changed file
with
69 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |