Browse Source

👷 Add lint step

pull/1/head
anthony 5 years ago
parent
commit
dc24baa55f
  1. 43
      .circleci/config.yml

43
.circleci/config.yml

@ -1,13 +1,26 @@
version: 2
# --- Constants --- #
globals: globals:
images: images:
node: &node cimg/node:lts node: &node cimg/node:lts
postgres: &postgres circleci/postgres:9.6.5 postgres: &postgres circleci/postgres:9.6.5
caches: caches:
dependencies: &dependencies dependencies-{{ checksum "package.json" }}
# --- Commands --- #
commands:
init:
description: Setup the environment
steps:
- checkout
- restore_cache:
keys:
- *dependencies
# --- Jobs definitions --- #
version: 2
jobs: jobs:
build: &shared-config build: &shared-config
docker: docker:
@ -17,20 +30,18 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- dependencies-{{ checksum "package.json" }}
- *dependencies
# fallback to using the latest cache if no exact match is found # fallback to using the latest cache if no exact match is found
- dependencies- - dependencies-
- run: yarn install - run: yarn install
- save_cache: - save_cache:
paths: paths:
- node_modules - node_modules
key: dependencies-{{ checksum "package.json" }}
key: *dependencies
test: test:
<<: *shared-config <<: *shared-config
steps: steps:
- checkout
- restore_cache:
key: dependencies-{{ checksum "package.json" }}
- init
- run: yarn test - run: yarn test
test-e2e: test-e2e:
@ -43,16 +54,25 @@ jobs:
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres
steps: steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}
- init
- run: - run:
command: yarn test:e2e command: yarn test:e2e
environment: environment:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
lint:
<<: *shared-config
steps:
- init
- run:
name: Check files format
command: yarn format:check
- run:
name: Lint files
command: yarn lint
# --- Workflow definition --- #
workflows: workflows:
version: 2 version: 2
@ -65,3 +85,6 @@ workflows:
- test-e2e: - test-e2e:
requires: requires:
- build - build
- lint:
requires:
- build
Loading…
Cancel
Save