Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
guastallaigor authored Jun 2, 2020
2 parents dfc1566 + 58e1da8 commit ba5b1c5
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 218 deletions.
87 changes: 70 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
orbs:
node: circleci/[email protected]
version: 2.1

defaults: &defaults
docker:
- image: circleci/node

working_directory: ~/app


supported-node-versions: &supported-node-versions
node-version: ["10.20.1", "12.16.3", "13.14.0", "14.2.0"]



jobs:
commitlint:
docker:
- image: williamlauze/circleci-commitlint:latest
- image: secretbase/circleci-commitlint:1.0.2
working_directory: ~/app
environment:
CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>

steps:
- checkout
Expand All @@ -25,6 +28,9 @@ jobs:
checkout:
<<: *defaults

docker:
- image: circleci/node:lts

steps:
- restore_cache:
name: Restore Repository Cache
Expand All @@ -50,38 +56,73 @@ jobs:
install-dependencies:
<<: *defaults

parameters:
node-version:
type: string

docker:
- image: "circleci/node:<< parameters.node-version >>"

steps:

- attach_workspace:
at: .

- restore_cache:
name: Restore npm Package Cache
keys:
- npm-{{ checksum "package-lock.json" }}
- npm-
- "npm-<< parameters.node-version >>-{{ checksum \"package-lock.json\" }}"

- run:
name: Move node_modules to correct location for install
command: "[ ! -d \"node_modules_<< parameters.node-version >>\" ] || mv \"node_modules_<< parameters.node-version >>\" node_modules"

- run:
name: Install Dependencies
command: npm install

- run:
name: Move node_modules to correct location for cache
command: mv node_modules "node_modules_<< parameters.node-version >>"

- save_cache:
name: Save npm Package Cache
key: npm-{{ checksum "package-lock.json" }}
key: "npm-<< parameters.node-version >>-{{ checksum \"package-lock.json\" }}"
paths:
- node_modules
- "node_modules_<< parameters.node-version >>"

- persist_to_workspace:
root: .
paths:
- node_modules
- "node_modules_<< parameters.node-version >>"

build:
<<: *defaults

docker:
- image: "circleci/node:lts"

steps:
- checkout

build-in-all-supported-versions-of-node:
<<: *defaults

parameters:
node-version:
type: string

docker:
- image: "circleci/node:<< parameters.node-version >>"

steps:
- attach_workspace:
at: .

- run:
name: Move node_modules to correct location for build
command: "[ ! -d \"node_modules_<< parameters.node-version >>\" ] || mv \"node_modules_<< parameters.node-version >>\" node_modules"

- restore_cache:
name: Restore Build Cache
keys:
Expand All @@ -108,13 +149,18 @@ jobs:
lint:
<<: *defaults

docker:
- image: "circleci/node:lts"

steps:
- attach_workspace:
at: .

- run:
command: npm i -D stylelint-config-prettier stylelint-config-recess-order stylelint-config-standard stylelint-prettier stylelint-scss
- run:
name: Lint styles
command: npx stylelint -- --fix
command: npx stylelint scss/**/*.scss "--fix"

# test:
# <<: *defaults
Expand Down Expand Up @@ -149,6 +195,9 @@ jobs:
release:
<<: *defaults

docker:
- image: circleci/node:lts

steps:
- attach_workspace:
at: .
Expand All @@ -160,10 +209,6 @@ jobs:
name: Release
command: npx semantic-release





workflows:
version: 2

Expand All @@ -177,6 +222,9 @@ workflows:
- install-dependencies:
requires:
- checkout
matrix:
parameters:
<<: *supported-node-versions
# - test:
# requires:
# - install-dependencies
Expand All @@ -185,14 +233,19 @@ workflows:
# - install-dependencies
- lint:
requires:
- install-dependencies
- build:
- checkout
- build
- build-in-all-supported-versions-of-node:
requires:
- install-dependencies
matrix:
parameters:
<<: *supported-node-versions

- release:
requires:
- commitlint
- build
- build-in-all-supported-versions-of-node
- lint
# - test
filters:
Expand Down
Loading

0 comments on commit ba5b1c5

Please sign in to comment.