rickvanlieshout.com/.circleci/config.yml

105 lines
2.2 KiB
YAML
Raw Normal View History

2018-11-09 18:08:48 +01:00
version: 2
2018-11-11 13:51:30 +01:00
defaults: &defaults
docker:
- image: circleci/node:10.15.3
2018-11-11 13:51:30 +01:00
working_directory: ~/gatsby-starter-lumen
2018-11-09 18:08:48 +01:00
jobs:
2018-11-11 13:51:30 +01:00
install:
<<: *defaults
2018-11-09 18:08:48 +01:00
steps:
- checkout
- restore_cache:
keys:
2018-11-11 13:07:39 +01:00
- dependencies-{{ checksum "yarn.lock" }}
2018-11-11 13:51:30 +01:00
- run: yarn install --frozen-lockfile
2018-11-09 18:08:48 +01:00
- save_cache:
paths:
- node_modules
2018-11-11 13:07:39 +01:00
key: dependencies-{{ checksum "yarn.lock" }}
2018-11-11 13:51:30 +01:00
2019-05-09 19:34:21 +02:00
flow-typed:
2019-05-09 19:37:29 +02:00
<<: *defaults
2019-05-09 19:34:21 +02:00
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
2019-05-09 20:49:39 +02:00
- restore_cache:
keys:
- flow-typed-{{ checksum "yarn.lock" }}
2019-05-09 19:34:21 +02:00
- run: yarn flow-typed
2019-05-09 19:44:40 +02:00
- save_cache:
paths:
- flow-typed
key: flow-typed-{{ checksum "yarn.lock" }}
2019-05-09 19:34:21 +02:00
2018-11-11 13:51:30 +01:00
lint:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
2019-05-09 20:28:50 +02:00
- dependencies-{{ checksum "yarn.lock" }}
2019-05-09 20:49:39 +02:00
- restore_cache:
keys:
- flow-typed-{{ checksum "yarn.lock" }}
2018-11-11 13:51:30 +01:00
- run: yarn lint
test:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- run: yarn test --runInBand --no-cache
coverage:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- run: yarn test:coverage --runInBand --no-cache
- save_cache:
key: coverage-{{ .Environment.CIRCLE_SHA1 }}
paths:
- coverage
codecov:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
keys:
- coverage-output-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn global add codecov
- run: yarn codecov
2018-11-09 18:08:48 +01:00
workflows:
version: 2
2018-11-11 13:59:49 +01:00
test:
2018-11-09 18:08:48 +01:00
jobs:
2018-11-11 13:51:30 +01:00
- install
2019-05-09 19:34:21 +02:00
- flow-typed:
requires:
- install
2018-11-11 13:51:30 +01:00
- lint:
requires:
2019-05-09 19:34:21 +02:00
- flow-typed
2018-11-11 13:51:30 +01:00
- install
- test:
requires:
- install
- coverage:
requires:
- install
- codecov:
requires:
- coverage