Merge pull request #556 from sharetribe/circle-ci-2

Switch to CircleCI 2
This commit is contained in:
Boyan Tabakov 2017-11-17 13:51:37 +02:00 committed by GitHub
commit 94700e19a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 31 deletions

43
.circleci/config.yml Normal file
View file

@ -0,0 +1,43 @@
version: 2
jobs:
build:
docker:
- image: node:6.11.5
environment:
YARN_VERSION: 1.2.1
steps:
- checkout
- restore_cache:
key: yarn-cache
- run:
name: set PATH
command: echo 'export PATH="${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"' >> $BASH_ENV
- run:
name: install yarn
command: |
if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then
echo "Downloading and installing Yarn"
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
else
echo "The correct version of Yarn is already installed"
fi
- run:
name: yarn
command: yarn
- save_cache:
key: yarn-cache
paths:
- ~/.cache/yarn
- ~/.yarn
- run:
name: audit
command: yarn run audit
- run:
name: format-ci
command: yarn run format-ci
- run:
name: build
command: yarn run build
- run:
name: test
command: yarn run test-ci

View file

@ -1,31 +0,0 @@
# https://circleci.com/docs/install-and-use-yarn/
machine:
node:
version: 6.11.5
environment:
YARN_VERSION: 1.2.1
PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
dependencies:
pre:
- |
if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then
echo "Downloading and installing Yarn"
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
else
echo "The correct version of Yarn is already installed"
fi
override:
- yarn
cache_directories:
- ~/.cache/yarn
- ~/.yarn
test:
pre:
- yarn run audit
- yarn run format-ci
- yarn run build
override:
- yarn run test-ci