Skip to content

Commit

Permalink
⚡️(circleci) decrease the number of jobs
Browse files Browse the repository at this point in the history
To reduce the number of jobs and thus improve our CI global performance
(for parallel workflows), we've merged related jobs (mostly linting
jobs).
  • Loading branch information
jmaupetit committed Apr 17, 2019
1 parent 1d2d560 commit ed0ff7f
Showing 1 changed file with 14 additions and 88 deletions.
102 changes: 14 additions & 88 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:
paths:
- src/richie/locale/django.pot

lint-back-isort:
lint-back:
docker:
- image: circleci/python:3.7-stretch
working_directory: ~/fun
Expand All @@ -165,48 +165,18 @@ jobs:
- restore_cache:
keys:
- v2-back-dependencies-{{ .Revision }}
- run:
name: Lint code with isort
command: ~/.local/bin/isort --recursive --check-only .

lint-back-flake8:
docker:
- image: circleci/python:3.7-stretch
working_directory: ~/fun
steps:
- checkout
- restore_cache:
keys:
- v2-back-dependencies-{{ checksum "setup.cfg" }}
- run:
name: Lint code with flake8
command: ~/.local/bin/flake8

lint-back-pylint:
docker:
- image: circleci/python:3.7-stretch
working_directory: ~/fun
steps:
- checkout
- restore_cache:
keys:
- v2-back-dependencies-{{ checksum "setup.cfg" }}
- run:
name: Lint code with pylint
command: ~/.local/bin/pylint src/richie/apps src/richie/plugins sandbox tests

lint-back-black:
docker:
- image: circleci/python:3.7-stretch
working_directory: ~/fun
steps:
- checkout
- restore_cache:
keys:
- v2-back-dependencies-{{ checksum "setup.cfg" }}
name: Lint code with isort
command: ~/.local/bin/isort --recursive --check-only .
- run:
name: Lint code with black
command: ~/.local/bin/black src/richie/apps src/richie/plugins sandbox tests --check
- run:
name: Lint code with pylint
command: ~/.local/bin/pylint src/richie/apps src/richie/plugins sandbox tests

# Restore front & back POT files containing strings to translate and upload them to our
# translation management tool
Expand Down Expand Up @@ -525,7 +495,7 @@ jobs:
- src/richie/static/richie/js/*.js
- src/richie/static/richie/css/*.css

lint-front-tslint:
lint-front:
docker:
- image: circleci/node:10
working_directory: ~/fun/src/frontend
Expand All @@ -538,17 +508,6 @@ jobs:
- run:
name: Lint code with tslint
command: yarn lint

lint-prettier:
docker:
- image: circleci/node:10
working_directory: ~/fun/src/frontend
steps:
- checkout:
path: ~/fun
- restore_cache:
keys:
- v5-front-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Lint JS/TS/JSON and CSS/SCSS code with prettier
command: yarn prettier --list-different "js/**/*.+(ts|tsx|json|js|jsx)" "*.+(ts|tsx|json|js|jsx)" "**/*.+(css|scss)"
Expand Down Expand Up @@ -627,29 +586,21 @@ workflows:
filters:
tags:
only: /.*/
- lint-front-tslint:
requires:
- build-front
filters:
tags:
only: /.*/
- lint-prettier:
- lint-front:
requires:
- build-front
filters:
tags:
only: /.*/
- test-front:
requires:
- lint-front-tslint
- lint-prettier
- lint-front
filters:
tags:
only: /.*/
- test-front-package:
requires:
- lint-front-tslint
- lint-prettier
- lint-front
filters:
tags:
only: /.*/
Expand Down Expand Up @@ -696,46 +647,22 @@ workflows:
filters:
tags:
only: /.*/
- lint-back-black:
requires:
- build-back
filters:
tags:
only: /.*/
- lint-back-isort:
requires:
- build-back
filters:
tags:
only: /.*/
- lint-back-flake8:
requires:
- build-back
filters:
tags:
only: /.*/
- lint-back-pylint:
- lint-back:
requires:
- build-back
filters:
tags:
only: /.*/
- test-back-mysql:
requires:
- lint-back-black
- lint-back-isort
- lint-back-flake8
- lint-back-pylint
- lint-back
- build-front-production
filters:
tags:
only: /.*/
- test-back-postgresql:
requires:
- lint-back-black
- lint-back-isort
- lint-back-flake8
- lint-back-pylint
- lint-back
- build-front-production
filters:
tags:
Expand Down Expand Up @@ -805,8 +732,7 @@ workflows:
# succeed and it has been tagged with a tag starting with the letter v
- npm:
requires:
- lint-front-tslint
- lint-prettier
- lint-front
- test-front
- test-front-package
filters:
Expand Down

0 comments on commit ed0ff7f

Please sign in to comment.