Skip to content

Commit

Permalink
feat: split testing into reusable jobs (IN-734) (#163)
Browse files Browse the repository at this point in the history
* feat: split testing into reusable jobs

* fix: remove newline

* feat: parameterize executor

* feat: add more jobs

* feat: add more jobs

* feat: add remaining jobs

* feat: add remaining jobs
  • Loading branch information
Xavientois committed Jun 20, 2023
1 parent 1b6651f commit d377238
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/@orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ description: "Voiceflow's common CI/CD orb"
orbs:
slack: circleci/slack@4.2.1
gh: circleci/github-cli@1.0
sonarcloud: sonarsource/sonarcloud@1.1.1
18 changes: 18 additions & 0 deletions src/jobs/monorepo/monorepo_analyze_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
parameters:
run_on_root:
description: Check that allow the command to run on root
type: boolean
default: false
executor:
description: Executor to run the command on
type: executor
default: node-executor
executor: << parameters.executor >>
steps:
- checkout
- attach_workspace:
at: ~/voiceflow
- install_node_modules
- monorepo_analyze_dependencies:
run_on_root: << parameters.run_on_root >>
force_execution: true
18 changes: 18 additions & 0 deletions src/jobs/monorepo/monorepo_dependency_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
parameters:
run_on_root:
description: Check that allow the command to run on root
type: boolean
default: false
executor:
description: Executor to run the command on
type: executor
default: node-executor
executor: << parameters.executor >>
steps:
- checkout
- attach_workspace:
at: ~/voiceflow
- install_node_modules
- monorepo_dependency_tests:
run_on_root: << parameters.run_on_root >>
force_execution: true
18 changes: 18 additions & 0 deletions src/jobs/monorepo/monorepo_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
parameters:
run_on_root:
description: Check that allow the command to run on root
type: boolean
default: false
executor:
description: Executor to run the command on
type: executor
default: node-executor
executor: << parameters.executor >>
steps:
- checkout
- attach_workspace:
at: ~/voiceflow
- install_node_modules
- monorepo_integration_tests:
run_on_root: << parameters.run_on_root >>
force_execution: true
18 changes: 18 additions & 0 deletions src/jobs/monorepo/monorepo_lint_dockerfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
parameters:
run_on_root:
description: Check that allow the command to run on root
type: boolean
default: false
executor:
description: Executor to run the command on
type: executor
default: node-executor
executor: << parameters.executor >>
steps:
- checkout
- attach_workspace:
at: ~/voiceflow
- install_node_modules
- monorepo_lint_dockerfile:
run_on_root: << parameters.run_on_root >>
force_execution: true
28 changes: 28 additions & 0 deletions src/jobs/monorepo/monorepo_lint_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
parameters:
run_on_root:
description: Check that allow the command to run on root
type: boolean
default: false
executor:
description: Executor to run the command on
type: executor
default: node-executor
executor: << parameters.executor >>
steps:
- checkout
- attach_workspace:
at: ~/voiceflow
- install_node_modules
- restore_cache:
name: Restoring eslint Cache
keys:
- eslint-cache-{{`{{ .Branch }}`}}
- eslint-cache-master
- monorepo_lint_report:
run_on_root: << parameters.run_on_root >>
force_execution: true
- save_cache:
name: Saving eslint Cache
key: eslint-cache-{{`{{ .Branch }}`}}-{{`{{ .BuildNum }}`}}
paths:
- ~/voiceflow/apps/creator-app/.eslintcache
18 changes: 18 additions & 0 deletions src/jobs/monorepo/monorepo_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
parameters:
run_on_root:
description: Check that allow the command to run on root
type: boolean
default: false
executor:
description: Executor to run the command on
type: executor
default: node-executor
executor: << parameters.executor >>
steps:
- checkout
- attach_workspace:
at: ~/voiceflow
- install_node_modules
- monorepo_unit_tests:
run_on_root: << parameters.run_on_root >>
force_execution: true
10 changes: 10 additions & 0 deletions src/jobs/monorepo/sonarcloud_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
parameters:
executor:
description: Executor to run the command on
type: executor
default: node-executor
executor: << parameters.executor >>
steps:
- checkout
- sonarcloud/scan:
cache_version: 2

0 comments on commit d377238

Please sign in to comment.